From 560061d19da5a7c5acdae0f1eb1e09c0b85a46c3 Mon Sep 17 00:00:00 2001 From: epanipinto-jc Date: Wed, 19 Oct 2022 01:22:29 -0600 Subject: [PATCH 1/5] latest --- config_v1.json | 4 +- config_v2.json | 4 +- docker-compose.yml | 2 +- jcapiv1/.swagger-codegen/VERSION | 2 +- jcapiv1/.travis.yml | 1 - jcapiv1/README.md | 149 +- jcapiv1/docs/Application.md | 14 +- jcapiv1/docs/ApplicationConfig.md | 1 - jcapiv1/docs/ApplicationConfigAcsUrl.md | 3 +- .../docs/ApplicationConfigAcsUrlTooltip.md | 1 - ...ApplicationConfigAcsUrlTooltipVariables.md | 1 - .../ApplicationConfigConstantAttributes.md | 1 - ...pplicationConfigConstantAttributesValue.md | 1 - .../ApplicationConfigDatabaseAttributes.md | 1 - jcapiv1/docs/ApplicationLogo.md | 10 + jcapiv1/docs/ApplicationTemplatesApi.md | 53 +- jcapiv1/docs/ApplicationsApi.md | 65 +- jcapiv1/docs/Applicationslist.md | 2 +- jcapiv1/docs/Applicationtemplate.md | 9 +- jcapiv1/docs/ApplicationtemplateJit.md | 1 - ...response.md => ApplicationtemplateLogo.md} | 5 +- jcapiv1/docs/ApplicationtemplateOidc.md | 12 + jcapiv1/docs/ApplicationtemplateProvision.md | 11 + jcapiv1/docs/Applicationtemplateslist.md | 1 - jcapiv1/docs/Command.md | 9 +- jcapiv1/docs/CommandResultsApi.md | 65 +- jcapiv1/docs/CommandTriggersApi.md | 18 +- jcapiv1/docs/Commandfilereturn.md | 3 +- jcapiv1/docs/CommandfilereturnResults.md | 1 - jcapiv1/docs/Commandresult.md | 5 +- jcapiv1/docs/CommandresultResponse.md | 1 - jcapiv1/docs/CommandresultResponseData.md | 1 - jcapiv1/docs/Commandresultslist.md | 5 +- jcapiv1/docs/CommandresultslistResults.md | 19 + jcapiv1/docs/CommandsApi.md | 165 +- jcapiv1/docs/Commandslist.md | 1 - jcapiv1/docs/CommandslistResults.md | 1 - jcapiv1/docs/Error.md | 11 + jcapiv1/docs/ErrorDetails.md | 9 + jcapiv1/docs/Fde.md | 1 - .../Mfa.md => jcapiv1/docs/IdResetmfaBody.md | 5 +- jcapiv1/docs/ManagedServiceProviderApi.md | 239 + jcapiv1/docs/Mfa.md | 2 +- jcapiv1/docs/MfaEnrollment.md | 12 + .../docs/MfaEnrollmentStatus.md | 3 +- jcapiv1/docs/Organization.md | 21 + jcapiv1/docs/Organizationentitlement.md | 12 + ...anizationentitlementEntitlementProducts.md | 16 + jcapiv1/docs/OrganizationsApi.md | 141 +- jcapiv1/docs/OrganizationsIdBody.md | 9 + jcapiv1/docs/Organizationsettings.md | 38 + .../OrganizationsettingsDisplayPreferences.md | 9 + ...onsettingsDisplayPreferencesOrgInsights.md | 27 + ...PreferencesOrgInsightsApplicationsUsage.md | 9 + ...splayPreferencesOrgInsightsConsoleStats.md | 13 + ...eferencesOrgInsightsDeviceNotifications.md | 14 + ...PreferencesOrgInsightsUserNotifications.md | 14 + jcapiv1/docs/OrganizationsettingsFeatures.md | 11 + ...zationsettingsFeaturesDirectoryInsights.md | 4 +- ...ettingsFeaturesDirectoryInsightsPremium.md | 11 + ...anizationsettingsFeaturesSystemInsights.md | 14 + ...ationsettingsNewSystemUserStateDefaults.md | 11 + .../OrganizationsettingsPasswordPolicy.md | 34 + .../docs/OrganizationsettingsUserPortal.md | 9 + jcapiv1/docs/Organizationsettingsput.md | 30 + ...onsettingsputNewSystemUserStateDefaults.md | 11 + .../OrganizationsettingsputPasswordPolicy.md | 31 + jcapiv1/docs/Organizationslist.md | 1 - jcapiv1/docs/OrganizationslistResults.md | 1 - jcapiv1/docs/RadiusServersApi.md | 169 +- jcapiv1/docs/Radiusserver.md | 5 +- jcapiv1/docs/Radiusserverpost.md | 5 +- jcapiv1/docs/Radiusserverput.md | 5 +- jcapiv1/docs/RadiusserversIdBody.md | 18 + jcapiv1/docs/Radiusserverslist.md | 1 - jcapiv1/docs/Search.md | 1 - jcapiv1/docs/SearchApi.md | 189 +- jcapiv1/docs/Sshkeylist.md | 1 - jcapiv1/docs/Sshkeypost.md | 1 - jcapiv1/docs/Sso.md | 12 + .../docs/StateActivateBody.md | 5 +- jcapiv1/docs/System.md | 19 +- .../docs/SystemBuiltInCommands.md | 5 +- jcapiv1/docs/SystemDomainInfo.md | 10 + jcapiv1/docs/SystemMdm.md | 14 + jcapiv1/docs/SystemMdmInternal.md | 9 + jcapiv1/docs/SystemNetworkInterfaces.md | 1 - jcapiv1/docs/SystemOsVersionDetail.md | 14 + jcapiv1/docs/SystemProvisionMetadata.md | 9 + .../SystemProvisionMetadataProvisioner.md | 10 + jcapiv1/docs/SystemServiceAccountState.md | 11 + jcapiv1/docs/SystemSshdParams.md | 1 - jcapiv1/docs/SystemSystemInsights.md | 1 - jcapiv1/docs/SystemUserMetrics.md | 13 + jcapiv1/docs/Systemput.md | 1 - jcapiv1/docs/SystemputAgentBoundMessages.md | 1 - jcapiv1/docs/SystemsApi.md | 338 +- jcapiv1/docs/Systemslist.md | 1 - jcapiv1/docs/Systemuser.md | 50 - jcapiv1/docs/Systemuserput.md | 11 +- jcapiv1/docs/SystemuserputAddresses.md | 1 - .../docs/SystemuserputAttributes.md | 6 +- jcapiv1/docs/SystemuserputPhoneNumbers.md | 1 - jcapiv1/docs/SystemuserputRelationships.md | 10 + jcapiv1/docs/Systemuserputpost.md | 12 +- jcapiv1/docs/SystemuserputpostAddresses.md | 1 - jcapiv1/docs/SystemuserputpostPhoneNumbers.md | 1 - .../docs/SystemuserputpostRecoveryEmail.md | 9 + jcapiv1/docs/Systemuserreturn.md | 15 +- jcapiv1/docs/SystemuserreturnAddresses.md | 1 - jcapiv1/docs/SystemuserreturnPhoneNumbers.md | 1 - jcapiv1/docs/SystemuserreturnRecoveryEmail.md | 11 + jcapiv1/docs/SystemusersApi.md | 356 +- jcapiv1/docs/Systemuserslist.md | 1 - jcapiv1/docs/Tag.md | 21 - jcapiv1/docs/Tagpost.md | 19 - jcapiv1/docs/Tagput.md | 19 - jcapiv1/docs/TagsApi.md | 323 - jcapiv1/docs/Triggerreturn.md | 9 + jcapiv1/docs/TrustedappConfigGet.md | 10 + .../docs/TrustedappConfigGetTrustedApps.md | 11 + jcapiv1/docs/TrustedappConfigPut.md | 9 + jcapiv1/docs/Userput.md | 15 + jcapiv1/docs/Userreturn.md | 25 + jcapiv1/docs/UserreturnGrowthData.md | 10 + jcapiv1/docs/UsersApi.md | 174 + jcapiv1/docs/Usersystembindingsput.md | 11 - jcapiv1/jcapiv1/__init__.py | 77 +- jcapiv1/jcapiv1/api/__init__.py | 3 +- .../jcapiv1/api/application_templates_api.py | 107 +- jcapiv1/jcapiv1/api/applications_api.py | 109 +- jcapiv1/jcapiv1/api/command_results_api.py | 141 +- jcapiv1/jcapiv1/api/command_triggers_api.py | 51 +- jcapiv1/jcapiv1/api/commands_api.py | 356 +- .../api/managed_service_provider_api.py | 441 ++ jcapiv1/jcapiv1/api/organizations_api.py | 259 +- jcapiv1/jcapiv1/api/radius_servers_api.py | 327 +- jcapiv1/jcapiv1/api/search_api.py | 367 +- jcapiv1/jcapiv1/api/systems_api.py | 671 +- jcapiv1/jcapiv1/api/systemusers_api.py | 746 +-- jcapiv1/jcapiv1/api/tags_api.py | 645 -- jcapiv1/jcapiv1/api/users_api.py | 330 + jcapiv1/jcapiv1/api_client.py | 26 +- jcapiv1/jcapiv1/configuration.py | 55 +- jcapiv1/jcapiv1/models/__init__.py | 73 +- jcapiv1/jcapiv1/models/application.py | 218 +- jcapiv1/jcapiv1/models/application_config.py | 15 +- .../models/application_config_acs_url.py | 67 +- .../application_config_acs_url_tooltip.py | 13 +- ...cation_config_acs_url_tooltip_variables.py | 11 +- .../application_config_constant_attributes.py | 14 +- ...cation_config_constant_attributes_value.py | 11 +- .../application_config_database_attributes.py | 11 +- jcapiv1/jcapiv1/models/application_logo.py | 142 + jcapiv1/jcapiv1/models/applicationslist.py | 41 +- jcapiv1/jcapiv1/models/applicationtemplate.py | 240 +- .../jcapiv1/models/applicationtemplate_jit.py | 11 +- .../models/applicationtemplate_logo.py | 110 + .../models/applicationtemplate_oidc.py | 209 + .../models/applicationtemplate_provision.py | 162 + .../models/applicationtemplateslist.py | 13 +- jcapiv1/jcapiv1/models/body.py | 253 - jcapiv1/jcapiv1/models/body1.py | 141 - jcapiv1/jcapiv1/models/command.py | 139 +- jcapiv1/jcapiv1/models/commandfilereturn.py | 19 +- .../models/commandfilereturn_results.py | 11 +- jcapiv1/jcapiv1/models/commandresult.py | 25 +- .../jcapiv1/models/commandresult_response.py | 13 +- .../models/commandresult_response_data.py | 11 +- jcapiv1/jcapiv1/models/commandresultslist.py | 25 +- .../models/commandresultslist_results.py | 392 ++ jcapiv1/jcapiv1/models/commandslist.py | 13 +- .../jcapiv1/models/commandslist_results.py | 11 +- jcapiv1/jcapiv1/models/error.py | 168 + jcapiv1/jcapiv1/models/error_details.py | 118 + jcapiv1/jcapiv1/models/errorresponse.py | 115 - jcapiv1/jcapiv1/models/fde.py | 11 +- jcapiv1/jcapiv1/models/id_resetmfa_body.py | 162 + jcapiv1/jcapiv1/models/mfa.py | 39 +- jcapiv1/jcapiv1/models/mfa_enrollment.py | 188 + .../jcapiv1/models/mfa_enrollment_status.py | 95 + jcapiv1/jcapiv1/models/organization.py | 422 ++ .../jcapiv1/models/organizationentitlement.py | 188 + ...izationentitlement_entitlement_products.py | 292 + .../jcapiv1/models/organizations_id_body.py | 110 + .../jcapiv1/models/organizationsettings.py | 872 +++ ...rganizationsettings_display_preferences.py | 110 + ...ttings_display_preferences_org_insights.py | 578 ++ ...erences_org_insights_applications_usage.py | 110 + ..._preferences_org_insights_console_stats.py | 214 + ...ences_org_insights_device_notifications.py | 240 + ...erences_org_insights_user_notifications.py | 240 + .../models/organizationsettings_features.py | 162 + ...ionsettings_features_directory_insights.py | 110 + ...ngs_features_directory_insights_premium.py | 162 + ...zationsettings_features_system_insights.py | 240 + ...settings_new_system_user_state_defaults.py | 186 + .../organizationsettings_password_policy.py | 762 +++ .../organizationsettings_user_portal.py | 110 + .../jcapiv1/models/organizationsettingsput.py | 664 ++ ...tingsput_new_system_user_state_defaults.py | 180 + ...organizationsettingsput_password_policy.py | 684 ++ jcapiv1/jcapiv1/models/organizationslist.py | 13 +- .../models/organizationslist_results.py | 11 +- jcapiv1/jcapiv1/models/radiusserver.py | 123 +- jcapiv1/jcapiv1/models/radiusserverpost.py | 123 +- jcapiv1/jcapiv1/models/radiusserverput.py | 123 +- .../jcapiv1/models/radiusservers_id_body.py | 353 ++ jcapiv1/jcapiv1/models/radiusserverslist.py | 13 +- jcapiv1/jcapiv1/models/search.py | 11 +- jcapiv1/jcapiv1/models/sshkeylist.py | 11 +- jcapiv1/jcapiv1/models/sshkeypost.py | 11 +- jcapiv1/jcapiv1/models/sso.py | 188 + jcapiv1/jcapiv1/models/state_activate_body.py | 110 + jcapiv1/jcapiv1/models/system.py | 394 +- .../models/system_built_in_commands.py | 148 + jcapiv1/jcapiv1/models/system_domain_info.py | 136 + jcapiv1/jcapiv1/models/system_mdm.py | 252 + jcapiv1/jcapiv1/models/system_mdm_internal.py | 110 + .../models/system_network_interfaces.py | 17 +- .../models/system_os_version_detail.py | 240 + .../models/system_provision_metadata.py | 110 + .../system_provision_metadata_provisioner.py | 142 + .../models/system_service_account_state.py | 162 + jcapiv1/jcapiv1/models/system_sshd_params.py | 11 +- .../jcapiv1/models/system_system_insights.py | 11 +- jcapiv1/jcapiv1/models/system_user_metrics.py | 214 + jcapiv1/jcapiv1/models/systemput.py | 13 +- .../models/systemput_agent_bound_messages.py | 11 +- jcapiv1/jcapiv1/models/systemslist.py | 13 +- jcapiv1/jcapiv1/models/systemuser.py | 1194 ---- jcapiv1/jcapiv1/models/systemuserbinding.py | 87 - .../jcapiv1/models/systemuserbindingsput.py | 147 - jcapiv1/jcapiv1/models/systemuserput.py | 226 +- .../jcapiv1/models/systemuserput_addresses.py | 27 +- .../models/systemuserput_attributes.py | 136 + .../models/systemuserput_phone_numbers.py | 15 +- .../models/systemuserput_relationships.py | 136 + jcapiv1/jcapiv1/models/systemuserputpost.py | 229 +- .../models/systemuserputpost_addresses.py | 11 +- .../models/systemuserputpost_phone_numbers.py | 11 +- .../systemuserputpost_recovery_email.py | 110 + jcapiv1/jcapiv1/models/systemuserreturn.py | 332 +- .../models/systemuserreturn_addresses.py | 27 +- .../models/systemuserreturn_phone_numbers.py | 15 +- .../models/systemuserreturn_recovery_email.py | 162 + jcapiv1/jcapiv1/models/systemuserslist.py | 13 +- jcapiv1/jcapiv1/models/tag.py | 407 -- jcapiv1/jcapiv1/models/tagpost.py | 356 -- jcapiv1/jcapiv1/models/tagput.py | 355 -- jcapiv1/jcapiv1/models/tagslist.py | 147 - jcapiv1/jcapiv1/models/triggerreturn.py | 110 + .../jcapiv1/models/trustedapp_config_get.py | 142 + .../trustedapp_config_get_trusted_apps.py | 169 + .../jcapiv1/models/trustedapp_config_put.py | 113 + jcapiv1/jcapiv1/models/userput.py | 266 + jcapiv1/jcapiv1/models/userreturn.py | 526 ++ .../jcapiv1/models/userreturn_growth_data.py | 136 + jcapiv1/jcapiv1/models/usersystembinding.py | 87 - .../jcapiv1/models/usersystembindingsput.py | 147 - jcapiv1/jcapiv1/rest.py | 14 +- jcapiv1/setup.py | 17 +- jcapiv1/test/test_application.py | 7 +- jcapiv1/test/test_application_config.py | 7 +- .../test/test_application_config_acs_url.py | 7 +- ...test_application_config_acs_url_tooltip.py | 7 +- ...cation_config_acs_url_tooltip_variables.py | 7 +- ..._application_config_constant_attributes.py | 7 +- ...cation_config_constant_attributes_value.py | 7 +- ..._application_config_database_attributes.py | 7 +- jcapiv1/test/test_application_logo.py | 39 + .../test/test_application_templates_api.py | 9 +- jcapiv1/test/test_applications_api.py | 9 +- jcapiv1/test/test_applicationslist.py | 7 +- jcapiv1/test/test_applicationtemplate.py | 7 +- jcapiv1/test/test_applicationtemplate_jit.py | 7 +- jcapiv1/test/test_applicationtemplate_logo.py | 39 + jcapiv1/test/test_applicationtemplate_oidc.py | 39 + .../test_applicationtemplate_provision.py | 39 + jcapiv1/test/test_applicationtemplateslist.py | 7 +- jcapiv1/test/test_body.py | 40 - jcapiv1/test/test_body1.py | 40 - jcapiv1/test/test_command.py | 7 +- jcapiv1/test/test_command_results_api.py | 9 +- jcapiv1/test/test_command_triggers_api.py | 9 +- jcapiv1/test/test_commandfilereturn.py | 7 +- .../test/test_commandfilereturn_results.py | 7 +- jcapiv1/test/test_commandresult.py | 7 +- jcapiv1/test/test_commandresult_response.py | 7 +- .../test/test_commandresult_response_data.py | 7 +- jcapiv1/test/test_commandresultslist.py | 7 +- .../test/test_commandresultslist_results.py | 39 + jcapiv1/test/test_commands_api.py | 16 +- jcapiv1/test/test_commandslist.py | 7 +- jcapiv1/test/test_commandslist_results.py | 7 +- jcapiv1/test/test_error.py | 39 + jcapiv1/test/test_error_details.py | 39 + jcapiv1/test/test_errorresponse.py | 40 - jcapiv1/test/test_fde.py | 7 +- jcapiv1/test/test_id_resetmfa_body.py | 39 + .../test/test_managed_service_provider_api.py | 61 + jcapiv1/test/test_mfa.py | 7 +- jcapiv1/test/test_mfa_enrollment.py | 39 + jcapiv1/test/test_mfa_enrollment_status.py | 39 + jcapiv1/test/test_organization.py | 39 + jcapiv1/test/test_organizationentitlement.py | 39 + ...izationentitlement_entitlement_products.py | 39 + jcapiv1/test/test_organizations_api.py | 23 +- jcapiv1/test/test_organizations_id_body.py | 39 + jcapiv1/test/test_organizationsettings.py | 39 + ...rganizationsettings_display_preferences.py | 39 + ...ttings_display_preferences_org_insights.py | 39 + ...erences_org_insights_applications_usage.py | 39 + ..._preferences_org_insights_console_stats.py | 39 + ...ences_org_insights_device_notifications.py | 39 + ...erences_org_insights_user_notifications.py | 39 + .../test_organizationsettings_features.py | 39 + ...ionsettings_features_directory_insights.py | 39 + ...ngs_features_directory_insights_premium.py | 39 + ...zationsettings_features_system_insights.py | 39 + ...settings_new_system_user_state_defaults.py | 39 + ...st_organizationsettings_password_policy.py | 39 + .../test_organizationsettings_user_portal.py | 39 + jcapiv1/test/test_organizationsettingsput.py | 39 + ...tingsput_new_system_user_state_defaults.py | 39 + ...organizationsettingsput_password_policy.py | 39 + jcapiv1/test/test_organizationslist.py | 7 +- .../test/test_organizationslist_results.py | 7 +- jcapiv1/test/test_radius_servers_api.py | 23 +- jcapiv1/test/test_radiusserver.py | 7 +- jcapiv1/test/test_radiusserverpost.py | 7 +- jcapiv1/test/test_radiusserverput.py | 7 +- jcapiv1/test/test_radiusservers_id_body.py | 39 + jcapiv1/test/test_radiusserverslist.py | 7 +- jcapiv1/test/test_search.py | 7 +- jcapiv1/test/test_search_api.py | 23 +- jcapiv1/test/test_sshkeylist.py | 7 +- jcapiv1/test/test_sshkeypost.py | 7 +- jcapiv1/test/test_sso.py | 39 + jcapiv1/test/test_state_activate_body.py | 39 + jcapiv1/test/test_system.py | 7 +- jcapiv1/test/test_system_built_in_commands.py | 39 + jcapiv1/test/test_system_domain_info.py | 39 + jcapiv1/test/test_system_mdm.py | 39 + jcapiv1/test/test_system_mdm_internal.py | 39 + .../test/test_system_network_interfaces.py | 7 +- jcapiv1/test/test_system_os_version_detail.py | 39 + .../test/test_system_provision_metadata.py | 39 + ...t_system_provision_metadata_provisioner.py | 39 + .../test/test_system_service_account_state.py | 39 + jcapiv1/test/test_system_sshd_params.py | 7 +- jcapiv1/test/test_system_system_insights.py | 7 +- jcapiv1/test/test_system_user_metrics.py | 39 + jcapiv1/test/test_systemput.py | 7 +- .../test_systemput_agent_bound_messages.py | 7 +- jcapiv1/test/test_systems_api.py | 51 +- jcapiv1/test/test_systemslist.py | 7 +- jcapiv1/test/test_systemuser.py | 40 - jcapiv1/test/test_systemuserbinding.py | 40 - jcapiv1/test/test_systemuserbindingsput.py | 40 - jcapiv1/test/test_systemuserput.py | 7 +- jcapiv1/test/test_systemuserput_addresses.py | 7 +- jcapiv1/test/test_systemuserput_attributes.py | 39 + .../test/test_systemuserput_phone_numbers.py | 7 +- .../test/test_systemuserput_relationships.py | 39 + jcapiv1/test/test_systemuserputpost.py | 7 +- .../test/test_systemuserputpost_addresses.py | 7 +- .../test_systemuserputpost_phone_numbers.py | 7 +- .../test_systemuserputpost_recovery_email.py | 39 + jcapiv1/test/test_systemuserreturn.py | 7 +- .../test/test_systemuserreturn_addresses.py | 7 +- .../test_systemuserreturn_phone_numbers.py | 7 +- .../test_systemuserreturn_recovery_email.py | 39 + jcapiv1/test/test_systemusers_api.py | 36 +- jcapiv1/test/test_systemuserslist.py | 7 +- jcapiv1/test/test_tag.py | 40 - jcapiv1/test/test_tagpost.py | 40 - jcapiv1/test/test_tagput.py | 40 - jcapiv1/test/test_tags_api.py | 69 - jcapiv1/test/test_tagslist.py | 40 - jcapiv1/test/test_triggerreturn.py | 39 + jcapiv1/test/test_trustedapp_config_get.py | 39 + ...test_trustedapp_config_get_trusted_apps.py | 39 + jcapiv1/test/test_trustedapp_config_put.py | 39 + jcapiv1/test/test_userput.py | 39 + jcapiv1/test/test_userreturn.py | 39 + jcapiv1/test/test_userreturn_growth_data.py | 39 + jcapiv1/test/test_users_api.py | 54 + jcapiv1/test/test_usersystembinding.py | 40 - jcapiv1/test/test_usersystembindingsput.py | 40 - jcapiv1/tox.ini | 2 +- jcapiv2/.swagger-codegen/VERSION | 2 +- jcapiv2/.travis.yml | 1 - jcapiv2/README.md | 794 ++- jcapiv2/docs/ADE.md | 12 + jcapiv2/docs/ADES.md | 10 + jcapiv2/docs/ActiveDirectoryAgentGetOutput.md | 6 +- jcapiv2/docs/ActiveDirectoryAgentInput.md | 1 - .../docs/ActiveDirectoryAgentListOutput.md | 5 +- jcapiv2/docs/ActiveDirectoryApi.md | 275 +- jcapiv2/docs/ActiveDirectoryInput.md | 1 - jcapiv2/docs/ActiveDirectoryOutput.md | 2 - ...stemuserputpostAddresses.md => Address.md} | 4 +- jcapiv2/docs/Administrator.md | 5 +- jcapiv2/docs/AdministratorOrganizationLink.md | 10 + .../docs/AdministratorOrganizationLinkReq.md | 9 + jcapiv2/docs/AdministratorsApi.md | 238 + ...etingAlertConfigurationListRecordsItems.md | 20 + ...etingAlertConfigurationListRecordsItems.md | 16 + .../docs/AnyValue.md | 3 +- jcapiv2/docs/AppleMDM.md | 9 +- jcapiv2/docs/AppleMDMApi.md | 815 ++- jcapiv2/docs/AppleMdmDevice.md | 18 + jcapiv2/docs/AppleMdmDeviceInfo.md | 22 + jcapiv2/docs/AppleMdmDeviceSecurityInfo.md | 13 + jcapiv2/docs/AppleMdmPatchInput.md | 7 +- ...hCodeInput.md => AppleMdmPublicKeyCert.md} | 4 +- jcapiv2/docs/AppleMdmSignedCsrPlist.md | 8 + jcapiv2/docs/ApplicationIdLogoBody.md | 9 + jcapiv2/docs/ApplicationsApi.md | 312 +- jcapiv2/docs/AuthInfo.md | 1 - jcapiv2/docs/AuthInput.md | 1 - jcapiv2/docs/AuthInputObject.md | 1 - jcapiv2/docs/AuthenticationPoliciesApi.md | 302 + jcapiv2/docs/AuthinputBasic.md | 1 - jcapiv2/docs/AuthinputOauth.md | 1 - jcapiv2/docs/AuthnPolicy.md | 16 + jcapiv2/docs/AuthnPolicyEffect.md | 10 + jcapiv2/docs/AuthnPolicyInput.md | 15 + ...plication.md => AuthnPolicyObligations.md} | 8 +- jcapiv2/docs/AuthnPolicyObligationsMfa.md | 9 + ...AuthnPolicyObligationsUserVerification.md} | 5 +- jcapiv2/docs/AuthnPolicyResourceTarget.md | 10 + jcapiv2/docs/AuthnPolicyTargets.md | 12 + .../docs/AuthnPolicyType.md | 3 +- .../docs/AuthnPolicyUserAttributeFilter.md | 11 + .../docs/AuthnPolicyUserAttributeTarget.md | 10 + jcapiv2/docs/AuthnPolicyUserGroupTarget.md | 10 + jcapiv2/docs/AuthnPolicyUserTarget.md | 9 + jcapiv2/docs/AutotaskCompany.md | 10 + jcapiv2/docs/AutotaskCompanyResp.md | 10 + jcapiv2/docs/AutotaskCompanyTypeResp.md | 10 + jcapiv2/docs/AutotaskContract.md | 11 + jcapiv2/docs/AutotaskContractField.md | 10 + .../docs/AutotaskContractFieldValues.md | 7 +- jcapiv2/docs/AutotaskIntegration.md | 11 + jcapiv2/docs/AutotaskIntegrationPatchReq.md | 10 + jcapiv2/docs/AutotaskIntegrationReq.md | 10 + jcapiv2/docs/AutotaskMappingRequest.md | 9 + jcapiv2/docs/AutotaskMappingRequestCompany.md | 10 + .../docs/AutotaskMappingRequestContract.md | 8 + jcapiv2/docs/AutotaskMappingRequestData.md | 13 + .../AutotaskMappingRequestOrganization.md | 10 + jcapiv2/docs/AutotaskMappingRequestService.md | 8 + jcapiv2/docs/AutotaskMappingResponse.md | 14 + ...e.md => AutotaskMappingResponseCompany.md} | 5 +- .../docs/AutotaskMappingResponseContract.md | 10 + .../AutotaskMappingResponseOrganization.md | 10 + .../docs/AutotaskMappingResponseService.md | 11 + jcapiv2/docs/AutotaskService.md | 11 + jcapiv2/docs/AutotaskSettings.md | 10 + jcapiv2/docs/AutotaskSettingsPatchReq.md | 10 + .../AutotaskTicketingAlertConfiguration.md | 20 + ...AutotaskTicketingAlertConfigurationList.md | 9 + ...totaskTicketingAlertConfigurationOption.md | 10 + ...TicketingAlertConfigurationOptionValues.md | 10 + ...otaskTicketingAlertConfigurationOptions.md | 10 + ...askTicketingAlertConfigurationPriority.md} | 3 +- ...otaskTicketingAlertConfigurationRequest.md | 16 + ...taskTicketingAlertConfigurationResource.md | 11 + jcapiv2/docs/BillingIntegrationCompanyType.md | 10 + jcapiv2/docs/BulkJobRequestsApi.md | 266 +- .../docs/BulkScheduledStatechangeCreate.md | 13 + jcapiv2/docs/BulkUserCreate.md | 1 - jcapiv2/docs/BulkUserUpdate.md | 1 - jcapiv2/docs/CommandResultList.md | 10 + jcapiv2/docs/CommandResultListResults.md | 13 + jcapiv2/docs/CommandResultsApi.md | 68 + jcapiv2/docs/CommandsApi.md | 190 +- jcapiv2/docs/ConnectWiseMappingRequest.md | 9 + .../docs/ConnectWiseMappingRequestCompany.md | 10 + jcapiv2/docs/ConnectWiseMappingRequestData.md | 13 + .../ConnectWiseMappingRequestOrganization.md | 10 + jcapiv2/docs/ConnectWiseMappingResponse.md | 14 + .../ConnectWiseMappingResponseAddition.md | 10 + jcapiv2/docs/ConnectWiseSettings.md | 10 + jcapiv2/docs/ConnectWiseSettingsPatchReq.md | 10 + .../ConnectWiseTicketingAlertConfiguration.md | 16 + ...nectWiseTicketingAlertConfigurationList.md | 9 + ...ctWiseTicketingAlertConfigurationOption.md | 10 + ...tWiseTicketingAlertConfigurationOptions.md | 9 + ...tWiseTicketingAlertConfigurationRequest.md | 12 + jcapiv2/docs/ConnectwiseAddition.md | 10 + .../docs/ConnectwiseAgreement.md | 8 +- jcapiv2/docs/ConnectwiseCompany.md | 10 + jcapiv2/docs/ConnectwiseCompanyResp.md | 10 + jcapiv2/docs/ConnectwiseCompanyTypeResp.md | 10 + jcapiv2/docs/ConnectwiseIntegration.md | 12 + .../docs/ConnectwiseIntegrationPatchReq.md | 12 + jcapiv2/docs/ConnectwiseIntegrationReq.md | 12 + jcapiv2/docs/CustomEmail.md | 16 + jcapiv2/docs/CustomEmailTemplate.md | 12 + jcapiv2/docs/CustomEmailTemplateField.md | 12 + jcapiv2/docs/CustomEmailType.md | 8 + jcapiv2/docs/CustomEmailsApi.md | 287 + jcapiv2/docs/DEP.md | 11 + jcapiv2/docs/DEPSetupAssistantOption.md | 9 + jcapiv2/docs/DEPWelcomeScreen.md | 11 + jcapiv2/docs/DefaultApi.md | 279 - jcapiv2/docs/DeviceIdEraseBody.md | 9 + jcapiv2/docs/DeviceIdLockBody.md | 9 + jcapiv2/docs/DeviceIdRestartBody.md | 9 + jcapiv2/docs/DirectoriesApi.md | 23 +- jcapiv2/docs/Directory.md | 2 +- jcapiv2/docs/DuoAccount.md | 1 - jcapiv2/docs/DuoApi.md | 129 +- jcapiv2/docs/DuoApplication.md | 1 - jcapiv2/docs/DuoApplicationReq.md | 1 - jcapiv2/docs/DuoApplicationUpdateReq.md | 7 +- jcapiv2/docs/DuoRegistrationApplicationReq.md | 10 - jcapiv2/docs/Error.md | 7 +- jcapiv2/docs/ErrorDetails.md | 9 + jcapiv2/docs/Errorresponse.md | 10 - jcapiv2/docs/FdeApi.md | 7 +- jcapiv2/docs/Feature.md | 9 + jcapiv2/docs/Filter.md | 11 + jcapiv2/docs/FilterQuery.md | 9 + jcapiv2/docs/GSuiteApi.md | 291 +- jcapiv2/docs/GSuiteBuiltinTranslation.md | 1 - jcapiv2/docs/GSuiteDirectionTranslation.md | 8 + jcapiv2/docs/GSuiteImportApi.md | 139 + jcapiv2/docs/GSuiteTranslationRule.md | 2 +- jcapiv2/docs/GSuiteTranslationRuleRequest.md | 2 +- jcapiv2/docs/GraphApi.md | 2464 +++++--- jcapiv2/docs/GraphAttributeLdapGroups.md | 9 + jcapiv2/docs/GraphAttributePosixGroups.md | 9 + .../GraphAttributePosixGroupsPosixGroups.md | 10 + jcapiv2/docs/GraphAttributeRadius.md | 9 + jcapiv2/docs/GraphAttributeRadiusRadius.md | 9 + .../docs/GraphAttributeRadiusRadiusReply.md | 10 + jcapiv2/docs/GraphAttributeSambaEnabled.md | 9 + jcapiv2/docs/GraphAttributeSudo.md | 9 + jcapiv2/docs/GraphAttributeSudoSudo.md | 10 + jcapiv2/docs/GraphAttributes.md | 8 + jcapiv2/docs/GraphConnection.md | 2 +- jcapiv2/docs/GraphManagementReq.md | 12 - jcapiv2/docs/GraphObject.md | 2 +- jcapiv2/docs/GraphObjectWithPaths.md | 2 +- ...raphManagementReq.md => GraphOperation.md} | 4 +- jcapiv2/docs/GraphOperationActiveDirectory.md | 10 + jcapiv2/docs/GraphOperationApplication.md | 10 + jcapiv2/docs/GraphOperationCommand.md | 10 + jcapiv2/docs/GraphOperationGSuite.md | 10 + jcapiv2/docs/GraphOperationLdapServer.md | 10 + jcapiv2/docs/GraphOperationOffice365.md | 10 + jcapiv2/docs/GraphOperationPolicy.md | 10 + jcapiv2/docs/GraphOperationPolicyGroup.md | 10 + ....md => GraphOperationPolicyGroupMember.md} | 6 +- jcapiv2/docs/GraphOperationRadiusServer.md | 10 + jcapiv2/docs/GraphOperationSoftwareApp.md | 10 + jcapiv2/docs/GraphOperationSystem.md | 10 + jcapiv2/docs/GraphOperationSystemGroup.md | 10 + ....md => GraphOperationSystemGroupMember.md} | 6 +- jcapiv2/docs/GraphOperationUser.md | 10 + jcapiv2/docs/GraphOperationUserGroup.md | 10 + jcapiv2/docs/GraphOperationUserGroupMember.md | 10 + jcapiv2/docs/GraphType.md | 1 - jcapiv2/docs/Group.md | 4 +- jcapiv2/docs/GroupAttributesUserGroup.md | 13 + jcapiv2/docs/GroupIdSuggestionsBody.md | 9 + jcapiv2/docs/GroupType.md | 1 - jcapiv2/docs/GroupsApi.md | 29 +- jcapiv2/docs/GsuiteOutput.md | 3 +- jcapiv2/docs/GsuitePatchInput.md | 3 +- jcapiv2/docs/IPList.md | 12 + jcapiv2/docs/IPListRequest.md | 11 + jcapiv2/docs/IPListsApi.md | 361 ++ jcapiv2/docs/ImageApi.md | 63 + jcapiv2/docs/ImportUser.md | 25 + jcapiv2/docs/ImportUserAddress.md | 14 + jcapiv2/docs/ImportUserPhoneNumber.md | 10 + jcapiv2/docs/ImportUsersResponse.md | 10 + jcapiv2/docs/InlineResponse200.md | 7 +- jcapiv2/docs/InlineResponse2001.md | 5 +- jcapiv2/docs/InlineResponse20010.md | 12 + jcapiv2/docs/InlineResponse20011.md | 11 + jcapiv2/docs/InlineResponse20011Users.md | 12 + jcapiv2/docs/InlineResponse20012.md | 10 + jcapiv2/docs/InlineResponse20013.md | 10 + jcapiv2/docs/InlineResponse2002.md | 10 + jcapiv2/docs/InlineResponse2002Users.md | 13 + jcapiv2/docs/InlineResponse2003.md | 10 + jcapiv2/docs/InlineResponse2004.md | 10 + jcapiv2/docs/InlineResponse2005.md | 10 + jcapiv2/docs/InlineResponse2006.md | 10 + jcapiv2/docs/InlineResponse2007.md | 10 + jcapiv2/docs/InlineResponse2008.md | 10 + jcapiv2/docs/InlineResponse2009.md | 10 + jcapiv2/docs/InlineResponse201.md | 4 +- jcapiv2/docs/InlineResponse400.md | 1 - jcapiv2/docs/Integration.md | 10 + jcapiv2/docs/IntegrationSyncError.md | 12 + jcapiv2/docs/IntegrationSyncErrorResp.md | 10 + jcapiv2/docs/IntegrationType.md | 8 + jcapiv2/docs/IntegrationsResponse.md | 10 + jcapiv2/docs/JobId.md | 1 - jcapiv2/docs/JobWorkresult.md | 7 +- jcapiv2/docs/KnowledgeApi.md | 71 - jcapiv2/docs/LDAPServersApi.md | 135 +- .../docs/{ProviderContact.md => LdapGroup.md} | 4 +- jcapiv2/docs/LdapServerAction.md | 1 - jcapiv2/docs/LdapServerInput.md | 5 +- jcapiv2/docs/LdapServerOutput.md | 6 +- .../docs/{Body3.md => LdapserversIdBody.md} | 3 +- jcapiv2/docs/LogosApi.md | 56 + jcapiv2/docs/ManagedServiceProviderApi.md | 659 ++ jcapiv2/docs/MemberSuggestion.md | 10 + jcapiv2/docs/MemberSuggestionsPostResult.md | 10 + jcapiv2/docs/Mobileconfig.md | 1 - jcapiv2/docs/OSRestriction.md | 13 + .../docs/OSRestrictionAppleRestrictions.md | 10 + jcapiv2/docs/Office365Api.md | 318 +- jcapiv2/docs/Office365BuiltinTranslation.md | 1 - jcapiv2/docs/Office365DirectionTranslation.md | 8 + jcapiv2/docs/Office365ImportApi.md | 76 + jcapiv2/docs/Office365Output.md | 13 + .../docs/Office365PatchInput.md | 9 +- jcapiv2/docs/Office365TranslationRule.md | 2 +- .../docs/Office365TranslationRuleRequest.md | 2 +- jcapiv2/docs/OrgCryptoSettings.md | 10 - ...JcEnrollmentProfile.md => Organization.md} | 7 +- jcapiv2/docs/OrganizationCase.md | 16 + .../docs/OrganizationCasesResponse.md | 7 +- jcapiv2/docs/OrganizationsApi.md | 241 +- jcapiv2/docs/OrgcryptosettingsSshKeys.md | 12 - ...rputpostPhoneNumbers.md => PhoneNumber.md} | 4 +- jcapiv2/docs/PoliciesApi.md | 400 +- jcapiv2/docs/Policy.md | 1 - jcapiv2/docs/PolicyGroup.md | 14 + jcapiv2/docs/PolicyGroupAssociationsApi.md | 254 + jcapiv2/docs/PolicyGroupData.md | 9 + .../docs/PolicyGroupMembersMembershipApi.md | 191 + jcapiv2/docs/PolicyGroupsApi.md | 733 +++ jcapiv2/docs/PolicyRequest.md | 1 - jcapiv2/docs/PolicyRequestTemplate.md | 1 - jcapiv2/docs/PolicyResult.md | 1 - jcapiv2/docs/PolicyTemplate.md | 5 +- jcapiv2/docs/PolicyTemplateConfigField.md | 4 +- .../docs/PolicyTemplateConfigFieldTooltip.md | 1 - ...licyTemplateConfigFieldTooltipVariables.md | 1 - jcapiv2/docs/PolicyTemplateWithDetails.md | 2 +- jcapiv2/docs/PolicyValue.md | 3 +- jcapiv2/docs/PolicyWithDetails.md | 1 - jcapiv2/docs/PolicytemplatesApi.md | 43 +- jcapiv2/docs/Provider.md | 5 +- jcapiv2/docs/ProviderAdminReq.md | 4 +- jcapiv2/docs/ProviderInvoice.md | 15 + jcapiv2/docs/ProviderInvoiceResponse.md | 10 + jcapiv2/docs/ProvidersApi.md | 2374 ++++++- jcapiv2/docs/PushEndpointResponse.md | 14 + jcapiv2/docs/PushEndpointResponseDevice.md | 14 + .../docs/PushendpointsPushEndpointIdBody.md | 10 + jcapiv2/docs/PwmAllUsers.md | 10 + jcapiv2/docs/PwmAllUsersGroups.md | 10 + jcapiv2/docs/PwmAllUsersResults.md | 13 + jcapiv2/docs/PwmOverviewAppVersions.md | 10 + jcapiv2/docs/PwmOverviewAppVersionsResults.md | 10 + jcapiv2/docs/PwmOverviewMain.md | 12 + .../{Body1.md => PwmOverviewMainDevices.md} | 7 +- jcapiv2/docs/Query.md | 9 + jcapiv2/docs/QueuedCommandList.md | 10 + jcapiv2/docs/QueuedCommandListResults.md | 12 + jcapiv2/docs/RADIUSServersApi.md | 73 +- jcapiv2/docs/SCIMImportApi.md | 76 + jcapiv2/docs/SambaDomainInput.md | 3 +- jcapiv2/docs/SambaDomainOutput.md | 4 +- jcapiv2/docs/SambaDomainsApi.md | 81 +- jcapiv2/docs/ScheduledUserstateResult.md | 12 + jcapiv2/docs/SetupAssistantOption.md | 8 + jcapiv2/docs/SharedFolderAccessLevels.md | 9 + .../docs/SharedFolderAccessLevelsResults.md | 11 + jcapiv2/docs/SharedFolderDetails.md | 13 + jcapiv2/docs/SharedFolderUsers.md | 10 + jcapiv2/docs/SharedFolderUsersResults.md | 14 + jcapiv2/docs/SharedFoldersList.md | 10 + jcapiv2/docs/SharedFoldersListResults.md | 13 + ...ledgelistoutputInner.md => SoftwareApp.md} | 5 +- jcapiv2/docs/SoftwareAppAppleVpp.md | 15 + jcapiv2/docs/SoftwareAppReclaimLicenses.md | 12 + jcapiv2/docs/SoftwareAppSettings.md | 23 + jcapiv2/docs/SoftwareAppStatus.md | 16 + jcapiv2/docs/SoftwareAppWithStatus.md | 10 + jcapiv2/docs/SoftwareAppsApi.md | 722 +++ .../SoftwareAppsRetryInstallationRequest.md | 9 + jcapiv2/docs/Sshkeylist.md | 13 - jcapiv2/docs/Subscription.md | 13 + jcapiv2/docs/SubscriptionsApi.md | 52 + jcapiv2/docs/SuggestionCounts.md | 11 + jcapiv2/docs/SystemGraphManagementReq.md | 13 - .../SystemGraphManagementReqAttributes.md | 10 - jcapiv2/docs/SystemGroup.md | 6 +- jcapiv2/docs/SystemGroupAssociationsApi.md | 174 +- jcapiv2/docs/SystemGroupData.md | 1 - .../docs/SystemGroupMembersMembershipApi.md | 128 +- jcapiv2/docs/SystemGroupsApi.md | 393 +- jcapiv2/docs/SystemInsightsAlf.md | 17 + jcapiv2/docs/SystemInsightsAlfExceptions.md | 12 + .../docs/SystemInsightsAlfExplicitAuths.md | 11 + jcapiv2/docs/SystemInsightsApi.md | 2479 +++++--- jcapiv2/docs/SystemInsightsAppcompatShims.md | 16 + jcapiv2/docs/SystemInsightsApps.md | 1 - jcapiv2/docs/SystemInsightsAuthorizedKeys.md | 14 + .../SystemInsightsAzureInstanceMetadata.md | 26 + .../docs/SystemInsightsAzureInstanceTags.md | 13 + jcapiv2/docs/SystemInsightsBattery.md | 3 +- jcapiv2/docs/SystemInsightsBitlockerInfo.md | 1 - jcapiv2/docs/SystemInsightsBrowserPlugins.md | 1 - jcapiv2/docs/SystemInsightsCertificates.md | 30 + jcapiv2/docs/SystemInsightsChassisInfo.md | 23 + .../docs/SystemInsightsChromeExtensions.md | 1 - jcapiv2/docs/SystemInsightsConnectivity.md | 19 + jcapiv2/docs/SystemInsightsCrashes.md | 3 +- .../docs/SystemInsightsCupsDestinations.md | 12 + jcapiv2/docs/SystemInsightsDiskEncryption.md | 1 - jcapiv2/docs/SystemInsightsDiskInfo.md | 1 - jcapiv2/docs/SystemInsightsDnsResolvers.md | 15 + jcapiv2/docs/SystemInsightsEtcHosts.md | 1 - jcapiv2/docs/SystemInsightsFirefoxAddons.md | 1 - jcapiv2/docs/SystemInsightsGroups.md | 1 - jcapiv2/docs/SystemInsightsIeExtensions.md | 1 - .../docs/SystemInsightsInterfaceAddresses.md | 1 - .../docs/SystemInsightsInterfaceDetails.md | 44 + jcapiv2/docs/SystemInsightsKernelInfo.md | 1 - jcapiv2/docs/SystemInsightsLaunchd.md | 1 - jcapiv2/docs/SystemInsightsLinuxPackages.md | 20 + jcapiv2/docs/SystemInsightsLoggedInUsers.md | 1 - ...vies.md => SystemInsightsLogicalDrives.md} | 3 +- jcapiv2/docs/SystemInsightsManagedPolicies.md | 16 + jcapiv2/docs/SystemInsightsMounts.md | 1 - jcapiv2/docs/SystemInsightsOsVersion.md | 1 - jcapiv2/docs/SystemInsightsPatches.md | 1 - jcapiv2/docs/SystemInsightsPrograms.md | 1 - jcapiv2/docs/SystemInsightsPythonPackages.md | 16 + .../docs/SystemInsightsSafariExtensions.md | 1 - jcapiv2/docs/SystemInsightsScheduledTasks.md | 19 + jcapiv2/docs/SystemInsightsSecureboot.md | 12 + jcapiv2/docs/SystemInsightsServices.md | 21 + jcapiv2/docs/SystemInsightsShadow.md | 20 + jcapiv2/docs/SystemInsightsSharedFolders.md | 12 + jcapiv2/docs/SystemInsightsSharedResources.md | 18 + .../docs/SystemInsightsSharingPreferences.md | 20 + jcapiv2/docs/SystemInsightsSipConfig.md | 13 + ...tails.md => SystemInsightsStartupItems.md} | 15 +- jcapiv2/docs/SystemInsightsSystemControls.md | 1 - jcapiv2/docs/SystemInsightsSystemInfo.md | 1 - jcapiv2/docs/SystemInsightsTpmInfo.md | 19 + jcapiv2/docs/SystemInsightsUptime.md | 1 - jcapiv2/docs/SystemInsightsUsbDevices.md | 1 - jcapiv2/docs/SystemInsightsUserGroups.md | 1 - jcapiv2/docs/SystemInsightsUserSshKeys.md | 13 + jcapiv2/docs/SystemInsightsUserassist.md | 14 + jcapiv2/docs/SystemInsightsUsers.md | 7 +- jcapiv2/docs/SystemInsightsWifiNetworks.md | 22 + jcapiv2/docs/SystemInsightsWifiStatus.md | 23 + jcapiv2/docs/SystemInsightsWindowsCrashes.md | 30 - .../SystemInsightsWindowsSecurityCenter.md | 17 + .../SystemInsightsWindowsSecurityProducts.md | 16 + jcapiv2/docs/Systemfdekey.md | 1 - jcapiv2/docs/SystemsApi.md | 271 +- jcapiv2/docs/Systemuser.md | 50 - jcapiv2/docs/Systemuserputpost.md | 47 - jcapiv2/docs/TicketingIntegrationAlert.md | 12 + .../docs/TicketingIntegrationAlertsResp.md | 9 + jcapiv2/docs/User.md | 21 + jcapiv2/docs/UserGraphManagementReq.md | 13 - jcapiv2/docs/UserGroup.md | 10 +- jcapiv2/docs/UserGroupAssociationsApi.md | 201 +- jcapiv2/docs/UserGroupAttributes.md | 11 - jcapiv2/docs/UserGroupGraphManagementReq.md | 12 - jcapiv2/docs/UserGroupMembersMembershipApi.md | 128 +- jcapiv2/docs/UserGroupPost.md | 9 +- jcapiv2/docs/UserGroupPut.md | 9 +- jcapiv2/docs/UserGroupsApi.md | 552 +- jcapiv2/docs/UsersApi.md | 480 +- jcapiv2/docs/WorkdayFields.md | 1 - jcapiv2/docs/WorkdayImportApi.md | 265 +- jcapiv2/docs/WorkdayInput.md | 1 - jcapiv2/docs/WorkdayOutput.md | 1 - jcapiv2/docs/WorkdayWorker.md | 1 - jcapiv2/docs/WorkdayoutputAuth.md | 1 - jcapiv2/jcapiv2/__init__.py | 306 +- jcapiv2/jcapiv2/api/__init__.py | 18 +- jcapiv2/jcapiv2/api/active_directory_api.py | 593 +- jcapiv2/jcapiv2/api/administrators_api.py | 445 ++ jcapiv2/jcapiv2/api/apple_mdm_api.py | 1576 ++++- jcapiv2/jcapiv2/api/applications_api.py | 619 +- .../api/authentication_policies_api.py | 550 ++ jcapiv2/jcapiv2/api/bulk_job_requests_api.py | 547 +- jcapiv2/jcapiv2/api/command_results_api.py | 137 + jcapiv2/jcapiv2/api/commands_api.py | 394 +- jcapiv2/jcapiv2/api/custom_emails_api.py | 524 ++ jcapiv2/jcapiv2/api/default_api.py | 529 -- jcapiv2/jcapiv2/api/directories_api.py | 49 +- jcapiv2/jcapiv2/api/duo_api.py | 345 +- jcapiv2/jcapiv2/api/fde_api.py | 15 +- jcapiv2/jcapiv2/api/g_suite_api.py | 621 +- jcapiv2/jcapiv2/api/g_suite_import_api.py | 267 + jcapiv2/jcapiv2/api/graph_api.py | 5531 ++++++++--------- jcapiv2/jcapiv2/api/groups_api.py | 57 +- jcapiv2/jcapiv2/api/image_api.py | 132 + jcapiv2/jcapiv2/api/ip_lists_api.py | 657 ++ jcapiv2/jcapiv2/api/knowledge_api.py | 150 - jcapiv2/jcapiv2/api/ldap_servers_api.py | 323 +- jcapiv2/jcapiv2/api/logos_api.py | 128 + .../api/managed_service_provider_api.py | 1206 ++++ jcapiv2/jcapiv2/api/office_365_api.py | 676 +- jcapiv2/jcapiv2/api/office_365_import_api.py | 156 + jcapiv2/jcapiv2/api/organizations_api.py | 471 +- jcapiv2/jcapiv2/api/policies_api.py | 818 +-- .../api/policy_group_associations_api.py | 476 ++ .../policy_group_members__membership_api.py | 360 ++ jcapiv2/jcapiv2/api/policy_groups_api.py | 1321 ++++ jcapiv2/jcapiv2/api/policytemplates_api.py | 95 +- jcapiv2/jcapiv2/api/providers_api.py | 4354 ++++++++++++- jcapiv2/jcapiv2/api/radius_servers_api.py | 187 +- jcapiv2/jcapiv2/api/samba_domains_api.py | 103 +- jcapiv2/jcapiv2/api/scim_import_api.py | 156 + jcapiv2/jcapiv2/api/software_apps_api.py | 1308 ++++ jcapiv2/jcapiv2/api/subscriptions_api.py | 120 + .../api/system_group_associations_api.py | 397 +- .../system_group_members__membership_api.py | 280 +- jcapiv2/jcapiv2/api/system_groups_api.py | 889 +-- jcapiv2/jcapiv2/api/system_insights_api.py | 5329 ++++++++-------- jcapiv2/jcapiv2/api/systems_api.py | 576 +- .../api/user_group_associations_api.py | 517 +- .../api/user_group_members__membership_api.py | 280 +- jcapiv2/jcapiv2/api/user_groups_api.py | 1281 ++-- jcapiv2/jcapiv2/api/users_api.py | 1010 +-- jcapiv2/jcapiv2/api/workday_import_api.py | 601 +- jcapiv2/jcapiv2/api_client.py | 26 +- jcapiv2/jcapiv2/configuration.py | 55 +- jcapiv2/jcapiv2/models/__init__.py | 287 +- .../active_directory_agent_get_output.py | 153 +- .../models/active_directory_agent_input.py | 9 +- .../active_directory_agent_list_output.py | 121 +- .../jcapiv2/models/active_directory_input.py | 11 +- .../jcapiv2/models/active_directory_output.py | 48 +- jcapiv2/jcapiv2/models/address.py | 318 + jcapiv2/jcapiv2/models/ade.py | 192 + jcapiv2/jcapiv2/models/ades.py | 136 + jcapiv2/jcapiv2/models/administrator.py | 121 +- .../models/administrator_organization_link.py | 140 + .../administrator_organization_link_req.py | 112 + ..._alert_configuration_list_records_items.py | 402 ++ ..._alert_configuration_list_records_items.py | 293 + jcapiv2/jcapiv2/models/any_value.py | 84 + jcapiv2/jcapiv2/models/apple_mdm.py | 241 +- jcapiv2/jcapiv2/models/apple_mdm_device.py | 344 + .../jcapiv2/models/apple_mdm_device_info.py | 448 ++ .../models/apple_mdm_device_security_info.py | 214 + .../jcapiv2/models/apple_mdm_patch_input.py | 179 +- .../models/apple_mdm_public_key_cert.py | 84 + .../models/apple_mdm_signed_csr_plist.py | 84 + .../models/application_id_logo_body.py | 112 + jcapiv2/jcapiv2/models/auth_info.py | 11 +- jcapiv2/jcapiv2/models/auth_input.py | 14 +- jcapiv2/jcapiv2/models/auth_input_object.py | 13 +- jcapiv2/jcapiv2/models/authinput_basic.py | 11 +- jcapiv2/jcapiv2/models/authinput_oauth.py | 11 +- jcapiv2/jcapiv2/models/authn_policy.py | 292 + jcapiv2/jcapiv2/models/authn_policy_effect.py | 143 + jcapiv2/jcapiv2/models/authn_policy_input.py | 266 + .../models/authn_policy_obligations.py | 136 + .../models/authn_policy_obligations_mfa.py | 110 + ...hn_policy_obligations_user_verification.py | 116 + .../models/authn_policy_resource_target.py | 145 + .../jcapiv2/models/authn_policy_targets.py | 188 + jcapiv2/jcapiv2/models/authn_policy_type.py | 91 + .../authn_policy_user_attribute_filter.py | 170 + .../authn_policy_user_attribute_target.py | 136 + .../models/authn_policy_user_group_target.py | 136 + .../models/authn_policy_user_target.py | 110 + jcapiv2/jcapiv2/models/autotask_company.py | 142 + .../jcapiv2/models/autotask_company_resp.py | 138 + .../models/autotask_company_type_resp.py | 138 + jcapiv2/jcapiv2/models/autotask_contract.py | 171 + .../jcapiv2/models/autotask_contract_field.py | 140 + .../models/autotask_contract_field_values.py | 136 + .../jcapiv2/models/autotask_integration.py | 170 + .../models/autotask_integration_patch_req.py | 140 + .../models/autotask_integration_req.py | 142 + .../models/autotask_mapping_request.py | 110 + .../autotask_mapping_request_company.py | 138 + .../autotask_mapping_request_contract.py | 84 + .../models/autotask_mapping_request_data.py | 218 + .../autotask_mapping_request_organization.py | 138 + .../autotask_mapping_request_service.py | 84 + .../models/autotask_mapping_response.py | 240 + .../autotask_mapping_response_company.py | 136 + .../autotask_mapping_response_contract.py | 136 + .../autotask_mapping_response_organization.py | 136 + .../autotask_mapping_response_service.py | 162 + jcapiv2/jcapiv2/models/autotask_service.py | 171 + jcapiv2/jcapiv2/models/autotask_settings.py | 140 + .../models/autotask_settings_patch_req.py | 140 + .../autotask_ticketing_alert_configuration.py | 402 ++ ...task_ticketing_alert_configuration_list.py | 111 + ...sk_ticketing_alert_configuration_option.py | 136 + ...eting_alert_configuration_option_values.py | 136 + ...k_ticketing_alert_configuration_options.py | 136 + ..._ticketing_alert_configuration_priority.py | 136 + ...k_ticketing_alert_configuration_request.py | 303 + ..._ticketing_alert_configuration_resource.py | 162 + .../billing_integration_company_type.py | 142 + jcapiv2/jcapiv2/models/body.py | 119 - jcapiv2/jcapiv2/models/body1.py | 167 - jcapiv2/jcapiv2/models/body2.py | 167 - jcapiv2/jcapiv2/models/body3.py | 169 - .../bulk_scheduled_statechange_create.py | 233 + jcapiv2/jcapiv2/models/bulk_user_create.py | 11 +- jcapiv2/jcapiv2/models/bulk_user_update.py | 11 +- jcapiv2/jcapiv2/models/command_result_list.py | 138 + .../models/command_result_list_results.py | 224 + .../models/connect_wise_mapping_request.py | 110 + .../connect_wise_mapping_request_company.py | 138 + .../connect_wise_mapping_request_data.py | 218 + ...nnect_wise_mapping_request_organization.py | 138 + .../models/connect_wise_mapping_response.py | 240 + .../connect_wise_mapping_response_addition.py | 136 + .../jcapiv2/models/connect_wise_settings.py | 140 + .../models/connect_wise_settings_patch_req.py | 140 + ...nect_wise_ticketing_alert_configuration.py | 293 + ...wise_ticketing_alert_configuration_list.py | 111 + ...se_ticketing_alert_configuration_option.py | 136 + ...e_ticketing_alert_configuration_options.py | 111 + ...e_ticketing_alert_configuration_request.py | 189 + .../jcapiv2/models/connectwise_addition.py | 142 + .../jcapiv2/models/connectwise_agreement.py | 171 + jcapiv2/jcapiv2/models/connectwise_company.py | 142 + .../models/connectwise_company_resp.py | 138 + .../models/connectwise_company_type_resp.py | 138 + .../jcapiv2/models/connectwise_integration.py | 199 + .../connectwise_integration_patch_req.py | 196 + .../models/connectwise_integration_req.py | 200 + jcapiv2/jcapiv2/models/custom_email.py | 294 + .../jcapiv2/models/custom_email_template.py | 188 + .../models/custom_email_template_field.py | 188 + jcapiv2/jcapiv2/models/custom_email_type.py | 96 + jcapiv2/jcapiv2/models/dep.py | 164 + .../models/dep_setup_assistant_option.py | 110 + jcapiv2/jcapiv2/models/dep_welcome_screen.py | 168 + .../jcapiv2/models/device_id_erase_body.py | 112 + jcapiv2/jcapiv2/models/device_id_lock_body.py | 112 + .../jcapiv2/models/device_id_restart_body.py | 112 + jcapiv2/jcapiv2/models/directory.py | 41 +- jcapiv2/jcapiv2/models/duo_account.py | 11 +- jcapiv2/jcapiv2/models/duo_application.py | 11 +- jcapiv2/jcapiv2/models/duo_application_req.py | 11 +- .../models/duo_application_update_req.py | 26 +- .../models/duo_registration_application.py | 176 - .../duo_registration_application_req.py | 118 - jcapiv2/jcapiv2/models/emailrequest.py | 121 - jcapiv2/jcapiv2/models/enrollment_profile.py | 141 - jcapiv2/jcapiv2/models/error.py | 69 +- jcapiv2/jcapiv2/models/error_details.py | 118 + jcapiv2/jcapiv2/models/errorresponse.py | 115 - jcapiv2/jcapiv2/models/feature.py | 118 + jcapiv2/jcapiv2/models/filter.py | 177 + jcapiv2/jcapiv2/models/filter_query.py | 116 + .../models/g_suite_builtin_translation.py | 11 +- .../models/g_suite_direction_translation.py | 90 + .../models/g_suite_translation_rule.py | 41 +- .../g_suite_translation_rule_request.py | 45 +- .../models/graph_attribute_ldap_groups.py | 110 + .../models/graph_attribute_posix_groups.py | 110 + ...aph_attribute_posix_groups_posix_groups.py | 138 + .../jcapiv2/models/graph_attribute_radius.py | 110 + .../models/graph_attribute_radius_radius.py | 110 + .../graph_attribute_radius_radius_reply.py | 138 + .../models/graph_attribute_samba_enabled.py | 110 + .../jcapiv2/models/graph_attribute_sudo.py | 110 + .../models/graph_attribute_sudo_sudo.py | 142 + jcapiv2/jcapiv2/models/graph_attributes.py | 84 + jcapiv2/jcapiv2/models/graph_connection.py | 41 +- .../jcapiv2/models/graph_management_req.py | 182 - jcapiv2/jcapiv2/models/graph_object.py | 39 +- .../jcapiv2/models/graph_object_with_paths.py | 42 +- jcapiv2/jcapiv2/models/graph_operation.py | 148 + .../graph_operation_active_directory.py | 151 + .../models/graph_operation_application.py | 151 + .../jcapiv2/models/graph_operation_command.py | 151 + .../jcapiv2/models/graph_operation_g_suite.py | 151 + .../models/graph_operation_ldap_server.py | 151 + .../models/graph_operation_office365.py | 151 + .../jcapiv2/models/graph_operation_policy.py | 151 + .../models/graph_operation_policy_group.py | 151 + .../graph_operation_policy_group_member.py | 151 + .../models/graph_operation_radius_server.py | 151 + .../models/graph_operation_software_app.py | 151 + .../jcapiv2/models/graph_operation_system.py | 151 + .../models/graph_operation_system_group.py | 151 + .../graph_operation_system_group_member.py | 151 + .../jcapiv2/models/graph_operation_user.py | 151 + .../models/graph_operation_user_group.py | 151 + .../graph_operation_user_group_member.py | 151 + jcapiv2/jcapiv2/models/graph_type.py | 10 +- jcapiv2/jcapiv2/models/group.py | 97 +- .../models/group_attributes_user_group.py | 220 + .../models/group_id_suggestions_body.py | 110 + jcapiv2/jcapiv2/models/group_type.py | 10 +- jcapiv2/jcapiv2/models/gsuite_output.py | 67 +- jcapiv2/jcapiv2/models/gsuite_patch_input.py | 67 +- jcapiv2/jcapiv2/models/import_user.py | 526 ++ jcapiv2/jcapiv2/models/import_user_address.py | 240 + .../models/import_user_phone_number.py | 136 + .../jcapiv2/models/import_users_response.py | 136 + jcapiv2/jcapiv2/models/inline_response200.py | 131 +- jcapiv2/jcapiv2/models/inline_response2001.py | 79 +- .../jcapiv2/models/inline_response20010.py | 188 + .../jcapiv2/models/inline_response20011.py | 162 + .../models/inline_response20011_users.py | 188 + .../jcapiv2/models/inline_response20012.py | 136 + .../jcapiv2/models/inline_response20013.py | 136 + jcapiv2/jcapiv2/models/inline_response2002.py | 136 + .../models/inline_response2002_users.py | 214 + jcapiv2/jcapiv2/models/inline_response2003.py | 136 + jcapiv2/jcapiv2/models/inline_response2004.py | 136 + jcapiv2/jcapiv2/models/inline_response2005.py | 136 + jcapiv2/jcapiv2/models/inline_response2006.py | 136 + jcapiv2/jcapiv2/models/inline_response2007.py | 136 + jcapiv2/jcapiv2/models/inline_response2008.py | 136 + jcapiv2/jcapiv2/models/inline_response2009.py | 136 + jcapiv2/jcapiv2/models/inline_response201.py | 72 +- jcapiv2/jcapiv2/models/inline_response400.py | 11 +- jcapiv2/jcapiv2/models/integration.py | 138 + .../jcapiv2/models/integration_sync_error.py | 192 + .../models/integration_sync_error_resp.py | 138 + jcapiv2/jcapiv2/models/integration_type.py | 90 + .../jcapiv2/models/integrations_response.py | 136 + jcapiv2/jcapiv2/models/ip_list.py | 188 + jcapiv2/jcapiv2/models/ip_list_request.py | 162 + .../jcapiv2/models/jc_enrollment_profile.py | 219 - jcapiv2/jcapiv2/models/job_details.py | 297 - jcapiv2/jcapiv2/models/job_id.py | 11 +- jcapiv2/jcapiv2/models/job_workresult.py | 173 +- jcapiv2/jcapiv2/models/ldap_group.py | 110 + jcapiv2/jcapiv2/models/ldap_server_action.py | 9 +- jcapiv2/jcapiv2/models/ldap_server_input.py | 11 +- jcapiv2/jcapiv2/models/ldap_server_output.py | 48 +- jcapiv2/jcapiv2/models/ldapservers_id_body.py | 162 + jcapiv2/jcapiv2/models/member_suggestion.py | 144 + .../models/member_suggestions_post_result.py | 136 + jcapiv2/jcapiv2/models/mfa.py | 167 - jcapiv2/jcapiv2/models/mobileconfig.py | 9 +- jcapiv2/jcapiv2/models/oauth_code_input.py | 115 - .../models/office365_builtin_translation.py | 22 +- .../models/office365_direction_translation.py | 89 + jcapiv2/jcapiv2/models/office365_output.py | 229 + .../jcapiv2/models/office365_patch_input.py | 200 + .../models/office365_translation_rule.py | 41 +- .../office365_translation_rule_request.py | 45 +- jcapiv2/jcapiv2/models/org_crypto_settings.py | 117 - jcapiv2/jcapiv2/models/organization.py | 164 + jcapiv2/jcapiv2/models/organization_case.py | 292 + .../models/organization_cases_response.py | 136 + .../models/orgcryptosettings_ssh_keys.py | 167 - jcapiv2/jcapiv2/models/os_restriction.py | 229 + .../os_restriction_apple_restrictions.py | 147 + jcapiv2/jcapiv2/models/phone_number.py | 162 + jcapiv2/jcapiv2/models/policy.py | 13 +- jcapiv2/jcapiv2/models/policy_group.py | 256 + jcapiv2/jcapiv2/models/policy_group_data.py | 113 + jcapiv2/jcapiv2/models/policy_request.py | 14 +- .../jcapiv2/models/policy_request_template.py | 11 +- jcapiv2/jcapiv2/models/policy_result.py | 11 +- jcapiv2/jcapiv2/models/policy_template.py | 132 +- .../models/policy_template_config_field.py | 101 +- .../policy_template_config_field_tooltip.py | 13 +- ...template_config_field_tooltip_variables.py | 11 +- .../models/policy_template_with_details.py | 47 +- jcapiv2/jcapiv2/models/policy_value.py | 73 +- jcapiv2/jcapiv2/models/policy_with_details.py | 15 +- jcapiv2/jcapiv2/models/provider.py | 75 +- jcapiv2/jcapiv2/models/provider_admin_req.py | 95 +- jcapiv2/jcapiv2/models/provider_contact.py | 141 - jcapiv2/jcapiv2/models/provider_invoice.py | 266 + .../models/provider_invoice_response.py | 136 + .../jcapiv2/models/push_endpoint_response.py | 240 + .../models/push_endpoint_response_device.py | 240 + .../pushendpoints_push_endpoint_id_body.py | 142 + jcapiv2/jcapiv2/models/pwm_all_users.py | 138 + .../jcapiv2/models/pwm_all_users_groups.py | 138 + .../jcapiv2/models/pwm_all_users_results.py | 218 + .../models/pwm_overview_app_versions.py | 138 + .../pwm_overview_app_versions_results.py | 136 + jcapiv2/jcapiv2/models/pwm_overview_main.py | 192 + .../models/pwm_overview_main_devices.py | 162 + jcapiv2/jcapiv2/models/query.py | 125 + jcapiv2/jcapiv2/models/queued_command_list.py | 138 + .../models/queued_command_list_results.py | 196 + .../salesforce_knowledge_list_output.py | 89 - .../salesforceknowledgelistoutput_inner.py | 115 - jcapiv2/jcapiv2/models/samba_domain_input.py | 11 +- jcapiv2/jcapiv2/models/samba_domain_output.py | 48 +- .../models/scheduled_userstate_result.py | 188 + .../jcapiv2/models/setup_assistant_option.py | 119 + .../models/shared_folder_access_levels.py | 111 + .../shared_folder_access_levels_results.py | 164 + .../jcapiv2/models/shared_folder_details.py | 219 + jcapiv2/jcapiv2/models/shared_folder_users.py | 138 + .../models/shared_folder_users_results.py | 246 + jcapiv2/jcapiv2/models/shared_folders_list.py | 138 + .../models/shared_folders_list_results.py | 219 + jcapiv2/jcapiv2/models/software_app.py | 162 + .../jcapiv2/models/software_app_apple_vpp.py | 281 + .../models/software_app_reclaim_licenses.py | 188 + .../jcapiv2/models/software_app_settings.py | 496 ++ jcapiv2/jcapiv2/models/software_app_status.py | 292 + .../models/software_app_with_status.py | 136 + ...oftware_apps_retry_installation_request.py | 112 + jcapiv2/jcapiv2/models/sshkeylist.py | 201 - jcapiv2/jcapiv2/models/subscription.py | 229 + jcapiv2/jcapiv2/models/suggestion_counts.py | 162 + .../models/system_graph_management_req.py | 214 - .../system_graph_management_req_attributes.py | 117 - ...em_graph_management_req_attributes_sudo.py | 141 - jcapiv2/jcapiv2/models/system_group.py | 95 +- jcapiv2/jcapiv2/models/system_group_data.py | 11 +- .../system_group_graph_management_req.py | 186 - .../models/system_group_members_req.py | 188 - jcapiv2/jcapiv2/models/system_insights_alf.py | 318 + .../models/system_insights_alf_exceptions.py | 188 + .../system_insights_alf_explicit_auths.py | 162 + .../models/system_insights_appcompat_shims.py | 292 + .../jcapiv2/models/system_insights_apps.py | 11 +- .../models/system_insights_authorized_keys.py | 240 + ...system_insights_azure_instance_metadata.py | 552 ++ .../system_insights_azure_instance_tags.py | 214 + .../jcapiv2/models/system_insights_battery.py | 41 +- .../models/system_insights_bitlocker_info.py | 11 +- .../models/system_insights_browser_plugins.py | 11 +- .../models/system_insights_certificates.py | 656 ++ .../models/system_insights_chassis_info.py | 474 ++ .../system_insights_chrome_extensions.py | 11 +- .../models/system_insights_connectivity.py | 370 ++ .../jcapiv2/models/system_insights_crashes.py | 65 +- .../system_insights_cups_destinations.py | 188 + .../models/system_insights_disk_encryption.py | 11 +- .../models/system_insights_disk_info.py | 11 +- .../models/system_insights_dns_resolvers.py | 266 + .../models/system_insights_etc_hosts.py | 11 +- .../models/system_insights_firefox_addons.py | 11 +- .../jcapiv2/models/system_insights_groups.py | 11 +- .../models/system_insights_ie_extensions.py | 11 +- .../system_insights_interface_addresses.py | 11 +- .../system_insights_interface_details.py | 1020 +++ .../models/system_insights_kernel_info.py | 11 +- .../jcapiv2/models/system_insights_launchd.py | 11 +- .../models/system_insights_linux_packages.py | 396 ++ .../models/system_insights_logged_in_users.py | 11 +- .../models/system_insights_logical_drives.py | 292 + .../models/system_insights_logical_drvies.py | 297 - .../system_insights_managed_policies.py | 292 + .../jcapiv2/models/system_insights_mounts.py | 11 +- .../models/system_insights_os_version.py | 11 +- .../jcapiv2/models/system_insights_patches.py | 11 +- .../models/system_insights_programs.py | 11 +- .../models/system_insights_python_packages.py | 292 + .../system_insights_safari_extensions.py | 11 +- .../models/system_insights_scheduled_tasks.py | 370 ++ .../models/system_insights_secureboot.py | 188 + .../models/system_insights_services.py | 422 ++ .../jcapiv2/models/system_insights_shadow.py | 396 ++ .../models/system_insights_shared_folders.py | 188 + .../system_insights_shared_resources.py | 344 + .../system_insights_sharing_preferences.py | 396 ++ .../models/system_insights_sip_config.py | 214 + .../models/system_insights_startup_items.py | 292 + .../models/system_insights_system_controls.py | 11 +- .../models/system_insights_system_info.py | 11 +- .../models/system_insights_tpm_info.py | 370 ++ .../jcapiv2/models/system_insights_uptime.py | 11 +- .../models/system_insights_usb_devices.py | 11 +- .../models/system_insights_user_groups.py | 11 +- .../models/system_insights_user_ssh_keys.py | 214 + .../models/system_insights_userassist.py | 240 + .../jcapiv2/models/system_insights_users.py | 181 +- .../models/system_insights_wifi_networks.py | 448 ++ .../models/system_insights_wifi_status.py | 474 ++ .../models/system_insights_windows_crashes.py | 635 -- ...system_insights_windows_security_center.py | 318 + ...stem_insights_windows_security_products.py | 292 + jcapiv2/jcapiv2/models/systemfdekey.py | 11 +- jcapiv2/jcapiv2/models/systemuser.py | 1194 ---- jcapiv2/jcapiv2/models/systemuserputpost.py | 1095 ---- .../models/systemuserputpost_addresses.py | 297 - .../models/systemuserputpost_phone_numbers.py | 141 - .../models/ticketing_integration_alert.py | 188 + .../ticketing_integration_alerts_resp.py | 111 + jcapiv2/jcapiv2/models/user.py | 424 ++ .../models/user_graph_management_req.py | 214 - jcapiv2/jcapiv2/models/user_group.py | 213 +- .../jcapiv2/models/user_group_attributes.py | 143 - .../user_group_attributes_posix_groups.py | 141 - .../models/user_group_graph_management_req.py | 188 - .../jcapiv2/models/user_group_members_req.py | 188 - jcapiv2/jcapiv2/models/user_group_post.py | 187 +- jcapiv2/jcapiv2/models/user_group_put.py | 187 +- jcapiv2/jcapiv2/models/workday_fields.py | 11 +- jcapiv2/jcapiv2/models/workday_input.py | 13 +- jcapiv2/jcapiv2/models/workday_output.py | 13 +- jcapiv2/jcapiv2/models/workday_request.py | 141 - jcapiv2/jcapiv2/models/workday_worker.py | 11 +- jcapiv2/jcapiv2/models/workdayoutput_auth.py | 13 +- jcapiv2/jcapiv2/rest.py | 14 +- jcapiv2/setup.py | 17 +- .../test_active_directory_agent_get_output.py | 7 +- .../test/test_active_directory_agent_input.py | 7 +- ...test_active_directory_agent_list_output.py | 7 +- jcapiv2/test/test_active_directory_api.py | 16 +- jcapiv2/test/test_active_directory_input.py | 7 +- jcapiv2/test/test_active_directory_output.py | 7 +- jcapiv2/test/test_address.py | 39 + jcapiv2/test/test_ade.py | 39 + jcapiv2/test/test_ades.py | 39 + jcapiv2/test/test_administrator.py | 7 +- .../test_administrator_organization_link.py | 39 + ...est_administrator_organization_link_req.py | 39 + jcapiv2/test/test_administrators_api.py | 61 + ..._alert_configuration_list_records_items.py | 39 + ..._alert_configuration_list_records_items.py | 39 + jcapiv2/test/test_any_value.py | 39 + jcapiv2/test/test_apple_mdm.py | 7 +- jcapiv2/test/test_apple_mdm_api.py | 112 +- jcapiv2/test/test_apple_mdm_device.py | 39 + jcapiv2/test/test_apple_mdm_device_info.py | 39 + .../test_apple_mdm_device_security_info.py | 39 + jcapiv2/test/test_apple_mdm_patch_input.py | 7 +- .../test/test_apple_mdm_public_key_cert.py | 39 + .../test/test_apple_mdm_signed_csr_plist.py | 39 + jcapiv2/test/test_application_id_logo_body.py | 39 + jcapiv2/test/test_applications_api.py | 36 +- jcapiv2/test/test_auth_info.py | 7 +- jcapiv2/test/test_auth_input.py | 7 +- jcapiv2/test/test_auth_input_object.py | 7 +- .../test/test_authentication_policies_api.py | 68 + jcapiv2/test/test_authinput_basic.py | 7 +- jcapiv2/test/test_authinput_oauth.py | 7 +- jcapiv2/test/test_authn_policy.py | 39 + jcapiv2/test/test_authn_policy_effect.py | 39 + jcapiv2/test/test_authn_policy_input.py | 39 + jcapiv2/test/test_authn_policy_obligations.py | 39 + .../test/test_authn_policy_obligations_mfa.py | 39 + ...hn_policy_obligations_user_verification.py | 39 + .../test/test_authn_policy_resource_target.py | 39 + jcapiv2/test/test_authn_policy_targets.py | 39 + jcapiv2/test/test_authn_policy_type.py | 39 + ...test_authn_policy_user_attribute_filter.py | 39 + ...test_authn_policy_user_attribute_target.py | 39 + .../test_authn_policy_user_group_target.py | 39 + jcapiv2/test/test_authn_policy_user_target.py | 39 + jcapiv2/test/test_autotask_company.py | 39 + jcapiv2/test/test_autotask_company_resp.py | 39 + .../test/test_autotask_company_type_resp.py | 39 + jcapiv2/test/test_autotask_contract.py | 39 + jcapiv2/test/test_autotask_contract_field.py | 39 + .../test_autotask_contract_field_values.py | 39 + jcapiv2/test/test_autotask_integration.py | 39 + .../test_autotask_integration_patch_req.py | 39 + jcapiv2/test/test_autotask_integration_req.py | 39 + jcapiv2/test/test_autotask_mapping_request.py | 39 + .../test_autotask_mapping_request_company.py | 39 + .../test_autotask_mapping_request_contract.py | 39 + .../test_autotask_mapping_request_data.py | 39 + ...t_autotask_mapping_request_organization.py | 39 + .../test_autotask_mapping_request_service.py | 39 + .../test/test_autotask_mapping_response.py | 39 + .../test_autotask_mapping_response_company.py | 39 + ...test_autotask_mapping_response_contract.py | 39 + ..._autotask_mapping_response_organization.py | 39 + .../test_autotask_mapping_response_service.py | 39 + jcapiv2/test/test_autotask_service.py | 39 + jcapiv2/test/test_autotask_settings.py | 39 + .../test/test_autotask_settings_patch_req.py | 39 + ..._autotask_ticketing_alert_configuration.py | 39 + ...task_ticketing_alert_configuration_list.py | 39 + ...sk_ticketing_alert_configuration_option.py | 39 + ...eting_alert_configuration_option_values.py | 39 + ...k_ticketing_alert_configuration_options.py | 39 + ..._ticketing_alert_configuration_priority.py | 39 + ...k_ticketing_alert_configuration_request.py | 39 + ..._ticketing_alert_configuration_resource.py | 39 + .../test_billing_integration_company_type.py | 39 + jcapiv2/test/test_body.py | 40 - jcapiv2/test/test_body1.py | 40 - jcapiv2/test/test_body2.py | 40 - jcapiv2/test/test_body3.py | 40 - jcapiv2/test/test_bulk_job_requests_api.py | 51 +- .../test_bulk_scheduled_statechange_create.py | 39 + jcapiv2/test/test_bulk_user_create.py | 7 +- jcapiv2/test/test_bulk_user_update.py | 7 +- jcapiv2/test/test_command_result_list.py | 39 + .../test/test_command_result_list_results.py | 39 + jcapiv2/test/test_command_results_api.py | 40 + jcapiv2/test/test_commands_api.py | 23 +- .../test/test_connect_wise_mapping_request.py | 39 + ...st_connect_wise_mapping_request_company.py | 39 + .../test_connect_wise_mapping_request_data.py | 39 + ...nnect_wise_mapping_request_organization.py | 39 + .../test_connect_wise_mapping_response.py | 39 + ..._connect_wise_mapping_response_addition.py | 39 + jcapiv2/test/test_connect_wise_settings.py | 39 + .../test_connect_wise_settings_patch_req.py | 39 + ...nect_wise_ticketing_alert_configuration.py | 39 + ...wise_ticketing_alert_configuration_list.py | 39 + ...se_ticketing_alert_configuration_option.py | 39 + ...e_ticketing_alert_configuration_options.py | 39 + ...e_ticketing_alert_configuration_request.py | 39 + jcapiv2/test/test_connectwise_addition.py | 39 + jcapiv2/test/test_connectwise_agreement.py | 39 + jcapiv2/test/test_connectwise_company.py | 39 + jcapiv2/test/test_connectwise_company_resp.py | 39 + .../test_connectwise_company_type_resp.py | 39 + jcapiv2/test/test_connectwise_integration.py | 39 + .../test_connectwise_integration_patch_req.py | 39 + .../test/test_connectwise_integration_req.py | 39 + jcapiv2/test/test_custom_email.py | 39 + jcapiv2/test/test_custom_email_template.py | 39 + .../test/test_custom_email_template_field.py | 39 + jcapiv2/test/test_custom_email_type.py | 39 + jcapiv2/test/test_custom_emails_api.py | 68 + jcapiv2/test/test_default_api.py | 69 - jcapiv2/test/test_dep.py | 39 + .../test/test_dep_setup_assistant_option.py | 39 + jcapiv2/test/test_dep_welcome_screen.py | 39 + jcapiv2/test/test_device_id_erase_body.py | 39 + jcapiv2/test/test_device_id_lock_body.py | 39 + jcapiv2/test/test_device_id_restart_body.py | 39 + jcapiv2/test/test_directories_api.py | 9 +- jcapiv2/test/test_directory.py | 7 +- jcapiv2/test/test_duo_account.py | 7 +- jcapiv2/test/test_duo_api.py | 11 +- jcapiv2/test/test_duo_application.py | 7 +- jcapiv2/test/test_duo_application_req.py | 7 +- .../test/test_duo_application_update_req.py | 7 +- .../test/test_duo_registration_application.py | 40 - .../test_duo_registration_application_req.py | 40 - jcapiv2/test/test_emailrequest.py | 40 - jcapiv2/test/test_enrollment_profile.py | 40 - jcapiv2/test/test_error.py | 7 +- jcapiv2/test/test_error_details.py | 39 + jcapiv2/test/test_errorresponse.py | 40 - jcapiv2/test/test_fde_api.py | 9 +- jcapiv2/test/test_feature.py | 39 + jcapiv2/test/test_filter.py | 39 + jcapiv2/test/test_filter_query.py | 39 + jcapiv2/test/test_g_suite_api.py | 23 +- .../test/test_g_suite_builtin_translation.py | 7 +- .../test_g_suite_direction_translation.py | 39 + jcapiv2/test/test_g_suite_import_api.py | 47 + jcapiv2/test/test_g_suite_translation_rule.py | 7 +- .../test_g_suite_translation_rule_request.py | 7 +- jcapiv2/test/test_graph_api.py | 125 +- .../test/test_graph_attribute_ldap_groups.py | 39 + .../test/test_graph_attribute_posix_groups.py | 39 + ...aph_attribute_posix_groups_posix_groups.py | 39 + jcapiv2/test/test_graph_attribute_radius.py | 39 + .../test_graph_attribute_radius_radius.py | 39 + ...est_graph_attribute_radius_radius_reply.py | 39 + .../test_graph_attribute_samba_enabled.py | 39 + jcapiv2/test/test_graph_attribute_sudo.py | 39 + .../test/test_graph_attribute_sudo_sudo.py | 39 + jcapiv2/test/test_graph_attributes.py | 39 + jcapiv2/test/test_graph_connection.py | 7 +- jcapiv2/test/test_graph_management_req.py | 40 - jcapiv2/test/test_graph_object.py | 7 +- jcapiv2/test/test_graph_object_with_paths.py | 7 +- jcapiv2/test/test_graph_operation.py | 39 + .../test_graph_operation_active_directory.py | 39 + .../test/test_graph_operation_application.py | 39 + jcapiv2/test/test_graph_operation_command.py | 39 + jcapiv2/test/test_graph_operation_g_suite.py | 39 + .../test/test_graph_operation_ldap_server.py | 39 + .../test/test_graph_operation_office365.py | 39 + jcapiv2/test/test_graph_operation_policy.py | 39 + .../test/test_graph_operation_policy_group.py | 39 + ...est_graph_operation_policy_group_member.py | 39 + .../test_graph_operation_radius_server.py | 39 + .../test/test_graph_operation_software_app.py | 39 + jcapiv2/test/test_graph_operation_system.py | 39 + .../test/test_graph_operation_system_group.py | 39 + ...est_graph_operation_system_group_member.py | 39 + jcapiv2/test/test_graph_operation_user.py | 39 + .../test/test_graph_operation_user_group.py | 39 + .../test_graph_operation_user_group_member.py | 39 + jcapiv2/test/test_graph_type.py | 7 +- jcapiv2/test/test_group.py | 7 +- .../test/test_group_attributes_user_group.py | 39 + .../test/test_group_id_suggestions_body.py | 39 + jcapiv2/test/test_group_type.py | 7 +- jcapiv2/test/test_groups_api.py | 9 +- jcapiv2/test/test_gsuite_output.py | 7 +- jcapiv2/test/test_gsuite_patch_input.py | 7 +- jcapiv2/test/test_image_api.py | 40 + jcapiv2/test/test_import_user.py | 39 + jcapiv2/test/test_import_user_address.py | 39 + jcapiv2/test/test_import_user_phone_number.py | 39 + jcapiv2/test/test_import_users_response.py | 39 + jcapiv2/test/test_inline_response200.py | 7 +- jcapiv2/test/test_inline_response2001.py | 7 +- jcapiv2/test/test_inline_response20010.py | 39 + jcapiv2/test/test_inline_response20011.py | 39 + .../test/test_inline_response20011_users.py | 39 + jcapiv2/test/test_inline_response20012.py | 39 + jcapiv2/test/test_inline_response20013.py | 39 + jcapiv2/test/test_inline_response2002.py | 39 + .../test/test_inline_response2002_users.py | 39 + jcapiv2/test/test_inline_response2003.py | 39 + jcapiv2/test/test_inline_response2004.py | 39 + jcapiv2/test/test_inline_response2005.py | 39 + jcapiv2/test/test_inline_response2006.py | 39 + jcapiv2/test/test_inline_response2007.py | 39 + jcapiv2/test/test_inline_response2008.py | 39 + jcapiv2/test/test_inline_response2009.py | 39 + jcapiv2/test/test_inline_response201.py | 7 +- jcapiv2/test/test_inline_response400.py | 7 +- jcapiv2/test/test_integration.py | 39 + jcapiv2/test/test_integration_sync_error.py | 39 + .../test/test_integration_sync_error_resp.py | 39 + jcapiv2/test/test_integration_type.py | 39 + jcapiv2/test/test_integrations_response.py | 39 + jcapiv2/test/test_ip_list.py | 39 + jcapiv2/test/test_ip_list_request.py | 39 + jcapiv2/test/test_ip_lists_api.py | 75 + jcapiv2/test/test_jc_enrollment_profile.py | 40 - jcapiv2/test/test_job_details.py | 40 - jcapiv2/test/test_job_id.py | 7 +- jcapiv2/test/test_job_workresult.py | 7 +- jcapiv2/test/test_knowledge_api.py | 41 - jcapiv2/test/test_ldap_group.py | 39 + jcapiv2/test/test_ldap_server_action.py | 7 +- jcapiv2/test/test_ldap_server_input.py | 7 +- jcapiv2/test/test_ldap_server_output.py | 7 +- jcapiv2/test/test_ldap_servers_api.py | 9 +- jcapiv2/test/test_ldapservers_id_body.py | 39 + jcapiv2/test/test_logos_api.py | 40 + .../test/test_managed_service_provider_api.py | 110 + jcapiv2/test/test_member_suggestion.py | 39 + .../test_member_suggestions_post_result.py | 39 + jcapiv2/test/test_mfa.py | 40 - jcapiv2/test/test_mobileconfig.py | 7 +- jcapiv2/test/test_oauth_code_input.py | 40 - .../test_office365_builtin_translation.py | 7 +- .../test_office365_direction_translation.py | 39 + jcapiv2/test/test_office365_output.py | 39 + jcapiv2/test/test_office365_patch_input.py | 39 + .../test/test_office365_translation_rule.py | 7 +- ...test_office365_translation_rule_request.py | 7 +- jcapiv2/test/test_office_365_api.py | 30 +- jcapiv2/test/test_office_365_import_api.py | 40 + jcapiv2/test/test_org_crypto_settings.py | 40 - jcapiv2/test/test_organization.py | 39 + jcapiv2/test/test_organization_case.py | 39 + .../test/test_organization_cases_response.py | 39 + jcapiv2/test/test_organizations_api.py | 42 +- .../test/test_orgcryptosettings_ssh_keys.py | 40 - jcapiv2/test/test_os_restriction.py | 39 + .../test_os_restriction_apple_restrictions.py | 39 + jcapiv2/test/test_phone_number.py | 39 + jcapiv2/test/test_policies_api.py | 26 +- jcapiv2/test/test_policy.py | 7 +- jcapiv2/test/test_policy_group.py | 39 + .../test_policy_group_associations_api.py | 61 + jcapiv2/test/test_policy_group_data.py | 39 + ...st_policy_group_members__membership_api.py | 54 + jcapiv2/test/test_policy_groups_api.py | 117 + jcapiv2/test/test_policy_request.py | 7 +- jcapiv2/test/test_policy_request_template.py | 7 +- jcapiv2/test/test_policy_result.py | 7 +- jcapiv2/test/test_policy_template.py | 7 +- .../test/test_policy_template_config_field.py | 7 +- ...st_policy_template_config_field_tooltip.py | 7 +- ...template_config_field_tooltip_variables.py | 7 +- .../test/test_policy_template_with_details.py | 7 +- jcapiv2/test/test_policy_value.py | 7 +- jcapiv2/test/test_policy_with_details.py | 7 +- jcapiv2/test/test_policytemplates_api.py | 9 +- jcapiv2/test/test_provider.py | 7 +- jcapiv2/test/test_provider_admin_req.py | 7 +- jcapiv2/test/test_provider_contact.py | 40 - jcapiv2/test/test_provider_invoice.py | 39 + .../test/test_provider_invoice_response.py | 39 + jcapiv2/test/test_providers_api.py | 289 +- jcapiv2/test/test_push_endpoint_response.py | 39 + .../test_push_endpoint_response_device.py | 39 + ...est_pushendpoints_push_endpoint_id_body.py | 39 + jcapiv2/test/test_pwm_all_users.py | 39 + jcapiv2/test/test_pwm_all_users_groups.py | 39 + jcapiv2/test/test_pwm_all_users_results.py | 39 + .../test/test_pwm_overview_app_versions.py | 39 + .../test_pwm_overview_app_versions_results.py | 39 + jcapiv2/test/test_pwm_overview_main.py | 39 + .../test/test_pwm_overview_main_devices.py | 39 + jcapiv2/test/test_query.py | 39 + jcapiv2/test/test_queued_command_list.py | 39 + .../test/test_queued_command_list_results.py | 39 + jcapiv2/test/test_radius_servers_api.py | 9 +- .../test_salesforce_knowledge_list_output.py | 40 - ...est_salesforceknowledgelistoutput_inner.py | 40 - jcapiv2/test/test_samba_domain_input.py | 7 +- jcapiv2/test/test_samba_domain_output.py | 7 +- jcapiv2/test/test_samba_domains_api.py | 9 +- .../test/test_scheduled_userstate_result.py | 39 + jcapiv2/test/test_scim_import_api.py | 40 + jcapiv2/test/test_setup_assistant_option.py | 39 + .../test/test_shared_folder_access_levels.py | 39 + ...est_shared_folder_access_levels_results.py | 39 + jcapiv2/test/test_shared_folder_details.py | 39 + jcapiv2/test/test_shared_folder_users.py | 39 + .../test/test_shared_folder_users_results.py | 39 + jcapiv2/test/test_shared_folders_list.py | 39 + .../test/test_shared_folders_list_results.py | 39 + jcapiv2/test/test_software_app.py | 39 + jcapiv2/test/test_software_app_apple_vpp.py | 39 + .../test_software_app_reclaim_licenses.py | 39 + jcapiv2/test/test_software_app_settings.py | 39 + jcapiv2/test/test_software_app_status.py | 39 + jcapiv2/test/test_software_app_with_status.py | 39 + jcapiv2/test/test_software_apps_api.py | 117 + ...oftware_apps_retry_installation_request.py | 39 + jcapiv2/test/test_sshkeylist.py | 40 - jcapiv2/test/test_subscription.py | 39 + jcapiv2/test/test_subscriptions_api.py | 40 + jcapiv2/test/test_suggestion_counts.py | 39 + .../test/test_system_graph_management_req.py | 40 - ..._system_graph_management_req_attributes.py | 40 - ...em_graph_management_req_attributes_sudo.py | 40 - jcapiv2/test/test_system_group.py | 7 +- .../test_system_group_associations_api.py | 16 +- jcapiv2/test/test_system_group_data.py | 7 +- .../test_system_group_graph_management_req.py | 40 - ...st_system_group_members__membership_api.py | 16 +- jcapiv2/test/test_system_group_members_req.py | 40 - jcapiv2/test/test_system_groups_api.py | 30 +- jcapiv2/test/test_system_insights_alf.py | 39 + .../test_system_insights_alf_exceptions.py | 39 + ...test_system_insights_alf_explicit_auths.py | 39 + jcapiv2/test/test_system_insights_api.py | 289 +- .../test_system_insights_appcompat_shims.py | 39 + jcapiv2/test/test_system_insights_apps.py | 7 +- .../test_system_insights_authorized_keys.py | 39 + ...system_insights_azure_instance_metadata.py | 39 + ...est_system_insights_azure_instance_tags.py | 39 + jcapiv2/test/test_system_insights_battery.py | 7 +- .../test_system_insights_bitlocker_info.py | 7 +- .../test_system_insights_browser_plugins.py | 7 +- .../test/test_system_insights_certificates.py | 39 + .../test/test_system_insights_chassis_info.py | 39 + .../test_system_insights_chrome_extensions.py | 7 +- .../test/test_system_insights_connectivity.py | 39 + jcapiv2/test/test_system_insights_crashes.py | 7 +- .../test_system_insights_cups_destinations.py | 39 + .../test_system_insights_disk_encryption.py | 7 +- .../test/test_system_insights_disk_info.py | 7 +- .../test_system_insights_dns_resolvers.py | 39 + .../test/test_system_insights_etc_hosts.py | 7 +- .../test_system_insights_firefox_addons.py | 7 +- jcapiv2/test/test_system_insights_groups.py | 7 +- .../test_system_insights_ie_extensions.py | 7 +- ...est_system_insights_interface_addresses.py | 7 +- .../test_system_insights_interface_details.py | 39 + .../test/test_system_insights_kernel_info.py | 7 +- jcapiv2/test/test_system_insights_launchd.py | 7 +- .../test_system_insights_linux_packages.py | 39 + .../test_system_insights_logged_in_users.py | 7 +- .../test_system_insights_logical_drives.py | 39 + .../test_system_insights_logical_drvies.py | 40 - .../test_system_insights_managed_policies.py | 39 + jcapiv2/test/test_system_insights_mounts.py | 7 +- .../test/test_system_insights_os_version.py | 7 +- jcapiv2/test/test_system_insights_patches.py | 7 +- jcapiv2/test/test_system_insights_programs.py | 7 +- .../test_system_insights_python_packages.py | 39 + .../test_system_insights_safari_extensions.py | 7 +- .../test_system_insights_scheduled_tasks.py | 39 + .../test/test_system_insights_secureboot.py | 39 + jcapiv2/test/test_system_insights_services.py | 39 + jcapiv2/test/test_system_insights_shadow.py | 39 + .../test_system_insights_shared_folders.py | 39 + .../test_system_insights_shared_resources.py | 39 + ...est_system_insights_sharing_preferences.py | 39 + .../test/test_system_insights_sip_config.py | 39 + .../test_system_insights_startup_items.py | 39 + .../test_system_insights_system_controls.py | 7 +- .../test/test_system_insights_system_info.py | 7 +- jcapiv2/test/test_system_insights_tpm_info.py | 39 + jcapiv2/test/test_system_insights_uptime.py | 7 +- .../test/test_system_insights_usb_devices.py | 7 +- .../test/test_system_insights_user_groups.py | 7 +- .../test_system_insights_user_ssh_keys.py | 39 + .../test/test_system_insights_userassist.py | 39 + jcapiv2/test/test_system_insights_users.py | 7 +- .../test_system_insights_wifi_networks.py | 39 + .../test/test_system_insights_wifi_status.py | 39 + .../test_system_insights_windows_crashes.py | 40 - ...system_insights_windows_security_center.py | 39 + ...stem_insights_windows_security_products.py | 39 + jcapiv2/test/test_systemfdekey.py | 7 +- jcapiv2/test/test_systems_api.py | 23 +- jcapiv2/test/test_systemuser.py | 40 - jcapiv2/test/test_systemuserputpost.py | 40 - .../test/test_systemuserputpost_addresses.py | 40 - .../test_systemuserputpost_phone_numbers.py | 40 - .../test/test_ticketing_integration_alert.py | 39 + .../test_ticketing_integration_alerts_resp.py | 39 + jcapiv2/test/test_user.py | 39 + .../test/test_user_graph_management_req.py | 40 - jcapiv2/test/test_user_group.py | 7 +- .../test/test_user_group_associations_api.py | 9 +- jcapiv2/test/test_user_group_attributes.py | 40 - ...test_user_group_attributes_posix_groups.py | 40 - .../test_user_group_graph_management_req.py | 40 - ...test_user_group_members__membership_api.py | 16 +- jcapiv2/test/test_user_group_members_req.py | 40 - jcapiv2/test/test_user_group_post.py | 7 +- jcapiv2/test/test_user_group_put.py | 7 +- jcapiv2/test/test_user_groups_api.py | 37 +- jcapiv2/test/test_users_api.py | 43 +- jcapiv2/test/test_workday_fields.py | 7 +- jcapiv2/test/test_workday_import_api.py | 23 +- jcapiv2/test/test_workday_input.py | 7 +- jcapiv2/test/test_workday_output.py | 7 +- jcapiv2/test/test_workday_request.py | 40 - jcapiv2/test/test_workday_worker.py | 7 +- jcapiv2/test/test_workdayoutput_auth.py | 7 +- jcapiv2/tox.ini | 2 +- 1636 files changed, 123207 insertions(+), 39453 deletions(-) create mode 100644 jcapiv1/docs/ApplicationLogo.md rename jcapiv1/docs/{Errorresponse.md => ApplicationtemplateLogo.md} (81%) create mode 100644 jcapiv1/docs/ApplicationtemplateOidc.md create mode 100644 jcapiv1/docs/ApplicationtemplateProvision.md create mode 100644 jcapiv1/docs/CommandresultslistResults.md create mode 100644 jcapiv1/docs/Error.md create mode 100644 jcapiv1/docs/ErrorDetails.md rename jcapiv2/docs/Mfa.md => jcapiv1/docs/IdResetmfaBody.md (84%) create mode 100644 jcapiv1/docs/ManagedServiceProviderApi.md create mode 100644 jcapiv1/docs/MfaEnrollment.md rename jcapiv2/docs/SalesforceKnowledgeListOutput.md => jcapiv1/docs/MfaEnrollmentStatus.md (89%) create mode 100644 jcapiv1/docs/Organization.md create mode 100644 jcapiv1/docs/Organizationentitlement.md create mode 100644 jcapiv1/docs/OrganizationentitlementEntitlementProducts.md create mode 100644 jcapiv1/docs/OrganizationsIdBody.md create mode 100644 jcapiv1/docs/Organizationsettings.md create mode 100644 jcapiv1/docs/OrganizationsettingsDisplayPreferences.md create mode 100644 jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsights.md create mode 100644 jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md create mode 100644 jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats.md create mode 100644 jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications.md create mode 100644 jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications.md create mode 100644 jcapiv1/docs/OrganizationsettingsFeatures.md rename jcapiv2/docs/SystemGraphManagementReqAttributesSudo.md => jcapiv1/docs/OrganizationsettingsFeaturesDirectoryInsights.md (77%) create mode 100644 jcapiv1/docs/OrganizationsettingsFeaturesDirectoryInsightsPremium.md create mode 100644 jcapiv1/docs/OrganizationsettingsFeaturesSystemInsights.md create mode 100644 jcapiv1/docs/OrganizationsettingsNewSystemUserStateDefaults.md create mode 100644 jcapiv1/docs/OrganizationsettingsPasswordPolicy.md create mode 100644 jcapiv1/docs/OrganizationsettingsUserPortal.md create mode 100644 jcapiv1/docs/Organizationsettingsput.md create mode 100644 jcapiv1/docs/OrganizationsettingsputNewSystemUserStateDefaults.md create mode 100644 jcapiv1/docs/OrganizationsettingsputPasswordPolicy.md create mode 100644 jcapiv1/docs/RadiusserversIdBody.md create mode 100644 jcapiv1/docs/Sso.md rename jcapiv2/docs/Emailrequest.md => jcapiv1/docs/StateActivateBody.md (82%) rename jcapiv2/docs/WorkdayRequest.md => jcapiv1/docs/SystemBuiltInCommands.md (83%) create mode 100644 jcapiv1/docs/SystemDomainInfo.md create mode 100644 jcapiv1/docs/SystemMdm.md create mode 100644 jcapiv1/docs/SystemMdmInternal.md create mode 100644 jcapiv1/docs/SystemOsVersionDetail.md create mode 100644 jcapiv1/docs/SystemProvisionMetadata.md create mode 100644 jcapiv1/docs/SystemProvisionMetadataProvisioner.md create mode 100644 jcapiv1/docs/SystemServiceAccountState.md create mode 100644 jcapiv1/docs/SystemUserMetrics.md delete mode 100644 jcapiv1/docs/Systemuser.md rename jcapiv2/docs/Body2.md => jcapiv1/docs/SystemuserputAttributes.md (76%) create mode 100644 jcapiv1/docs/SystemuserputRelationships.md create mode 100644 jcapiv1/docs/SystemuserputpostRecoveryEmail.md create mode 100644 jcapiv1/docs/SystemuserreturnRecoveryEmail.md delete mode 100644 jcapiv1/docs/Tag.md delete mode 100644 jcapiv1/docs/Tagpost.md delete mode 100644 jcapiv1/docs/Tagput.md delete mode 100644 jcapiv1/docs/TagsApi.md create mode 100644 jcapiv1/docs/Triggerreturn.md create mode 100644 jcapiv1/docs/TrustedappConfigGet.md create mode 100644 jcapiv1/docs/TrustedappConfigGetTrustedApps.md create mode 100644 jcapiv1/docs/TrustedappConfigPut.md create mode 100644 jcapiv1/docs/Userput.md create mode 100644 jcapiv1/docs/Userreturn.md create mode 100644 jcapiv1/docs/UserreturnGrowthData.md create mode 100644 jcapiv1/docs/UsersApi.md delete mode 100644 jcapiv1/docs/Usersystembindingsput.md create mode 100644 jcapiv1/jcapiv1/api/managed_service_provider_api.py delete mode 100644 jcapiv1/jcapiv1/api/tags_api.py create mode 100644 jcapiv1/jcapiv1/api/users_api.py create mode 100644 jcapiv1/jcapiv1/models/application_logo.py create mode 100644 jcapiv1/jcapiv1/models/applicationtemplate_logo.py create mode 100644 jcapiv1/jcapiv1/models/applicationtemplate_oidc.py create mode 100644 jcapiv1/jcapiv1/models/applicationtemplate_provision.py delete mode 100644 jcapiv1/jcapiv1/models/body.py delete mode 100644 jcapiv1/jcapiv1/models/body1.py create mode 100644 jcapiv1/jcapiv1/models/commandresultslist_results.py create mode 100644 jcapiv1/jcapiv1/models/error.py create mode 100644 jcapiv1/jcapiv1/models/error_details.py delete mode 100644 jcapiv1/jcapiv1/models/errorresponse.py create mode 100644 jcapiv1/jcapiv1/models/id_resetmfa_body.py create mode 100644 jcapiv1/jcapiv1/models/mfa_enrollment.py create mode 100644 jcapiv1/jcapiv1/models/mfa_enrollment_status.py create mode 100644 jcapiv1/jcapiv1/models/organization.py create mode 100644 jcapiv1/jcapiv1/models/organizationentitlement.py create mode 100644 jcapiv1/jcapiv1/models/organizationentitlement_entitlement_products.py create mode 100644 jcapiv1/jcapiv1/models/organizations_id_body.py create mode 100644 jcapiv1/jcapiv1/models/organizationsettings.py create mode 100644 jcapiv1/jcapiv1/models/organizationsettings_display_preferences.py create mode 100644 jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights.py create mode 100644 jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights_applications_usage.py create mode 100644 jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights_console_stats.py create mode 100644 jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights_device_notifications.py create mode 100644 jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights_user_notifications.py create mode 100644 jcapiv1/jcapiv1/models/organizationsettings_features.py create mode 100644 jcapiv1/jcapiv1/models/organizationsettings_features_directory_insights.py create mode 100644 jcapiv1/jcapiv1/models/organizationsettings_features_directory_insights_premium.py create mode 100644 jcapiv1/jcapiv1/models/organizationsettings_features_system_insights.py create mode 100644 jcapiv1/jcapiv1/models/organizationsettings_new_system_user_state_defaults.py create mode 100644 jcapiv1/jcapiv1/models/organizationsettings_password_policy.py create mode 100644 jcapiv1/jcapiv1/models/organizationsettings_user_portal.py create mode 100644 jcapiv1/jcapiv1/models/organizationsettingsput.py create mode 100644 jcapiv1/jcapiv1/models/organizationsettingsput_new_system_user_state_defaults.py create mode 100644 jcapiv1/jcapiv1/models/organizationsettingsput_password_policy.py create mode 100644 jcapiv1/jcapiv1/models/radiusservers_id_body.py create mode 100644 jcapiv1/jcapiv1/models/sso.py create mode 100644 jcapiv1/jcapiv1/models/state_activate_body.py create mode 100644 jcapiv1/jcapiv1/models/system_built_in_commands.py create mode 100644 jcapiv1/jcapiv1/models/system_domain_info.py create mode 100644 jcapiv1/jcapiv1/models/system_mdm.py create mode 100644 jcapiv1/jcapiv1/models/system_mdm_internal.py create mode 100644 jcapiv1/jcapiv1/models/system_os_version_detail.py create mode 100644 jcapiv1/jcapiv1/models/system_provision_metadata.py create mode 100644 jcapiv1/jcapiv1/models/system_provision_metadata_provisioner.py create mode 100644 jcapiv1/jcapiv1/models/system_service_account_state.py create mode 100644 jcapiv1/jcapiv1/models/system_user_metrics.py delete mode 100644 jcapiv1/jcapiv1/models/systemuser.py delete mode 100644 jcapiv1/jcapiv1/models/systemuserbinding.py delete mode 100644 jcapiv1/jcapiv1/models/systemuserbindingsput.py create mode 100644 jcapiv1/jcapiv1/models/systemuserput_attributes.py create mode 100644 jcapiv1/jcapiv1/models/systemuserput_relationships.py create mode 100644 jcapiv1/jcapiv1/models/systemuserputpost_recovery_email.py create mode 100644 jcapiv1/jcapiv1/models/systemuserreturn_recovery_email.py delete mode 100644 jcapiv1/jcapiv1/models/tag.py delete mode 100644 jcapiv1/jcapiv1/models/tagpost.py delete mode 100644 jcapiv1/jcapiv1/models/tagput.py delete mode 100644 jcapiv1/jcapiv1/models/tagslist.py create mode 100644 jcapiv1/jcapiv1/models/triggerreturn.py create mode 100644 jcapiv1/jcapiv1/models/trustedapp_config_get.py create mode 100644 jcapiv1/jcapiv1/models/trustedapp_config_get_trusted_apps.py create mode 100644 jcapiv1/jcapiv1/models/trustedapp_config_put.py create mode 100644 jcapiv1/jcapiv1/models/userput.py create mode 100644 jcapiv1/jcapiv1/models/userreturn.py create mode 100644 jcapiv1/jcapiv1/models/userreturn_growth_data.py delete mode 100644 jcapiv1/jcapiv1/models/usersystembinding.py delete mode 100644 jcapiv1/jcapiv1/models/usersystembindingsput.py create mode 100644 jcapiv1/test/test_application_logo.py create mode 100644 jcapiv1/test/test_applicationtemplate_logo.py create mode 100644 jcapiv1/test/test_applicationtemplate_oidc.py create mode 100644 jcapiv1/test/test_applicationtemplate_provision.py delete mode 100644 jcapiv1/test/test_body.py delete mode 100644 jcapiv1/test/test_body1.py create mode 100644 jcapiv1/test/test_commandresultslist_results.py create mode 100644 jcapiv1/test/test_error.py create mode 100644 jcapiv1/test/test_error_details.py delete mode 100644 jcapiv1/test/test_errorresponse.py create mode 100644 jcapiv1/test/test_id_resetmfa_body.py create mode 100644 jcapiv1/test/test_managed_service_provider_api.py create mode 100644 jcapiv1/test/test_mfa_enrollment.py create mode 100644 jcapiv1/test/test_mfa_enrollment_status.py create mode 100644 jcapiv1/test/test_organization.py create mode 100644 jcapiv1/test/test_organizationentitlement.py create mode 100644 jcapiv1/test/test_organizationentitlement_entitlement_products.py create mode 100644 jcapiv1/test/test_organizations_id_body.py create mode 100644 jcapiv1/test/test_organizationsettings.py create mode 100644 jcapiv1/test/test_organizationsettings_display_preferences.py create mode 100644 jcapiv1/test/test_organizationsettings_display_preferences_org_insights.py create mode 100644 jcapiv1/test/test_organizationsettings_display_preferences_org_insights_applications_usage.py create mode 100644 jcapiv1/test/test_organizationsettings_display_preferences_org_insights_console_stats.py create mode 100644 jcapiv1/test/test_organizationsettings_display_preferences_org_insights_device_notifications.py create mode 100644 jcapiv1/test/test_organizationsettings_display_preferences_org_insights_user_notifications.py create mode 100644 jcapiv1/test/test_organizationsettings_features.py create mode 100644 jcapiv1/test/test_organizationsettings_features_directory_insights.py create mode 100644 jcapiv1/test/test_organizationsettings_features_directory_insights_premium.py create mode 100644 jcapiv1/test/test_organizationsettings_features_system_insights.py create mode 100644 jcapiv1/test/test_organizationsettings_new_system_user_state_defaults.py create mode 100644 jcapiv1/test/test_organizationsettings_password_policy.py create mode 100644 jcapiv1/test/test_organizationsettings_user_portal.py create mode 100644 jcapiv1/test/test_organizationsettingsput.py create mode 100644 jcapiv1/test/test_organizationsettingsput_new_system_user_state_defaults.py create mode 100644 jcapiv1/test/test_organizationsettingsput_password_policy.py create mode 100644 jcapiv1/test/test_radiusservers_id_body.py create mode 100644 jcapiv1/test/test_sso.py create mode 100644 jcapiv1/test/test_state_activate_body.py create mode 100644 jcapiv1/test/test_system_built_in_commands.py create mode 100644 jcapiv1/test/test_system_domain_info.py create mode 100644 jcapiv1/test/test_system_mdm.py create mode 100644 jcapiv1/test/test_system_mdm_internal.py create mode 100644 jcapiv1/test/test_system_os_version_detail.py create mode 100644 jcapiv1/test/test_system_provision_metadata.py create mode 100644 jcapiv1/test/test_system_provision_metadata_provisioner.py create mode 100644 jcapiv1/test/test_system_service_account_state.py create mode 100644 jcapiv1/test/test_system_user_metrics.py delete mode 100644 jcapiv1/test/test_systemuser.py delete mode 100644 jcapiv1/test/test_systemuserbinding.py delete mode 100644 jcapiv1/test/test_systemuserbindingsput.py create mode 100644 jcapiv1/test/test_systemuserput_attributes.py create mode 100644 jcapiv1/test/test_systemuserput_relationships.py create mode 100644 jcapiv1/test/test_systemuserputpost_recovery_email.py create mode 100644 jcapiv1/test/test_systemuserreturn_recovery_email.py delete mode 100644 jcapiv1/test/test_tag.py delete mode 100644 jcapiv1/test/test_tagpost.py delete mode 100644 jcapiv1/test/test_tagput.py delete mode 100644 jcapiv1/test/test_tags_api.py delete mode 100644 jcapiv1/test/test_tagslist.py create mode 100644 jcapiv1/test/test_triggerreturn.py create mode 100644 jcapiv1/test/test_trustedapp_config_get.py create mode 100644 jcapiv1/test/test_trustedapp_config_get_trusted_apps.py create mode 100644 jcapiv1/test/test_trustedapp_config_put.py create mode 100644 jcapiv1/test/test_userput.py create mode 100644 jcapiv1/test/test_userreturn.py create mode 100644 jcapiv1/test/test_userreturn_growth_data.py create mode 100644 jcapiv1/test/test_users_api.py delete mode 100644 jcapiv1/test/test_usersystembinding.py delete mode 100644 jcapiv1/test/test_usersystembindingsput.py create mode 100644 jcapiv2/docs/ADE.md create mode 100644 jcapiv2/docs/ADES.md rename jcapiv2/docs/{SystemuserputpostAddresses.md => Address.md} (93%) create mode 100644 jcapiv2/docs/AdministratorOrganizationLink.md create mode 100644 jcapiv2/docs/AdministratorOrganizationLinkReq.md create mode 100644 jcapiv2/docs/AdministratorsApi.md create mode 100644 jcapiv2/docs/AllOfAutotaskTicketingAlertConfigurationListRecordsItems.md create mode 100644 jcapiv2/docs/AllOfConnectWiseTicketingAlertConfigurationListRecordsItems.md rename jcapiv1/docs/Usersystembinding.md => jcapiv2/docs/AnyValue.md (92%) create mode 100644 jcapiv2/docs/AppleMdmDevice.md create mode 100644 jcapiv2/docs/AppleMdmDeviceInfo.md create mode 100644 jcapiv2/docs/AppleMdmDeviceSecurityInfo.md rename jcapiv2/docs/{OauthCodeInput.md => AppleMdmPublicKeyCert.md} (83%) create mode 100644 jcapiv2/docs/AppleMdmSignedCsrPlist.md create mode 100644 jcapiv2/docs/ApplicationIdLogoBody.md create mode 100644 jcapiv2/docs/AuthenticationPoliciesApi.md create mode 100644 jcapiv2/docs/AuthnPolicy.md create mode 100644 jcapiv2/docs/AuthnPolicyEffect.md create mode 100644 jcapiv2/docs/AuthnPolicyInput.md rename jcapiv2/docs/{DuoRegistrationApplication.md => AuthnPolicyObligations.md} (58%) create mode 100644 jcapiv2/docs/AuthnPolicyObligationsMfa.md rename jcapiv2/docs/{Body.md => AuthnPolicyObligationsUserVerification.md} (76%) create mode 100644 jcapiv2/docs/AuthnPolicyResourceTarget.md create mode 100644 jcapiv2/docs/AuthnPolicyTargets.md rename jcapiv1/docs/Systemuserbinding.md => jcapiv2/docs/AuthnPolicyType.md (92%) create mode 100644 jcapiv2/docs/AuthnPolicyUserAttributeFilter.md create mode 100644 jcapiv2/docs/AuthnPolicyUserAttributeTarget.md create mode 100644 jcapiv2/docs/AuthnPolicyUserGroupTarget.md create mode 100644 jcapiv2/docs/AuthnPolicyUserTarget.md create mode 100644 jcapiv2/docs/AutotaskCompany.md create mode 100644 jcapiv2/docs/AutotaskCompanyResp.md create mode 100644 jcapiv2/docs/AutotaskCompanyTypeResp.md create mode 100644 jcapiv2/docs/AutotaskContract.md create mode 100644 jcapiv2/docs/AutotaskContractField.md rename jcapiv1/docs/Body1.md => jcapiv2/docs/AutotaskContractFieldValues.md (72%) create mode 100644 jcapiv2/docs/AutotaskIntegration.md create mode 100644 jcapiv2/docs/AutotaskIntegrationPatchReq.md create mode 100644 jcapiv2/docs/AutotaskIntegrationReq.md create mode 100644 jcapiv2/docs/AutotaskMappingRequest.md create mode 100644 jcapiv2/docs/AutotaskMappingRequestCompany.md create mode 100644 jcapiv2/docs/AutotaskMappingRequestContract.md create mode 100644 jcapiv2/docs/AutotaskMappingRequestData.md create mode 100644 jcapiv2/docs/AutotaskMappingRequestOrganization.md create mode 100644 jcapiv2/docs/AutotaskMappingRequestService.md create mode 100644 jcapiv2/docs/AutotaskMappingResponse.md rename jcapiv2/docs/{EnrollmentProfile.md => AutotaskMappingResponseCompany.md} (81%) create mode 100644 jcapiv2/docs/AutotaskMappingResponseContract.md create mode 100644 jcapiv2/docs/AutotaskMappingResponseOrganization.md create mode 100644 jcapiv2/docs/AutotaskMappingResponseService.md create mode 100644 jcapiv2/docs/AutotaskService.md create mode 100644 jcapiv2/docs/AutotaskSettings.md create mode 100644 jcapiv2/docs/AutotaskSettingsPatchReq.md create mode 100644 jcapiv2/docs/AutotaskTicketingAlertConfiguration.md create mode 100644 jcapiv2/docs/AutotaskTicketingAlertConfigurationList.md create mode 100644 jcapiv2/docs/AutotaskTicketingAlertConfigurationOption.md create mode 100644 jcapiv2/docs/AutotaskTicketingAlertConfigurationOptionValues.md create mode 100644 jcapiv2/docs/AutotaskTicketingAlertConfigurationOptions.md rename jcapiv2/docs/{UserGroupAttributesPosixGroups.md => AutotaskTicketingAlertConfigurationPriority.md} (88%) create mode 100644 jcapiv2/docs/AutotaskTicketingAlertConfigurationRequest.md create mode 100644 jcapiv2/docs/AutotaskTicketingAlertConfigurationResource.md create mode 100644 jcapiv2/docs/BillingIntegrationCompanyType.md create mode 100644 jcapiv2/docs/BulkScheduledStatechangeCreate.md create mode 100644 jcapiv2/docs/CommandResultList.md create mode 100644 jcapiv2/docs/CommandResultListResults.md create mode 100644 jcapiv2/docs/CommandResultsApi.md create mode 100644 jcapiv2/docs/ConnectWiseMappingRequest.md create mode 100644 jcapiv2/docs/ConnectWiseMappingRequestCompany.md create mode 100644 jcapiv2/docs/ConnectWiseMappingRequestData.md create mode 100644 jcapiv2/docs/ConnectWiseMappingRequestOrganization.md create mode 100644 jcapiv2/docs/ConnectWiseMappingResponse.md create mode 100644 jcapiv2/docs/ConnectWiseMappingResponseAddition.md create mode 100644 jcapiv2/docs/ConnectWiseSettings.md create mode 100644 jcapiv2/docs/ConnectWiseSettingsPatchReq.md create mode 100644 jcapiv2/docs/ConnectWiseTicketingAlertConfiguration.md create mode 100644 jcapiv2/docs/ConnectWiseTicketingAlertConfigurationList.md create mode 100644 jcapiv2/docs/ConnectWiseTicketingAlertConfigurationOption.md create mode 100644 jcapiv2/docs/ConnectWiseTicketingAlertConfigurationOptions.md create mode 100644 jcapiv2/docs/ConnectWiseTicketingAlertConfigurationRequest.md create mode 100644 jcapiv2/docs/ConnectwiseAddition.md rename jcapiv1/docs/Systemuserbindingsput.md => jcapiv2/docs/ConnectwiseAgreement.md (57%) create mode 100644 jcapiv2/docs/ConnectwiseCompany.md create mode 100644 jcapiv2/docs/ConnectwiseCompanyResp.md create mode 100644 jcapiv2/docs/ConnectwiseCompanyTypeResp.md create mode 100644 jcapiv2/docs/ConnectwiseIntegration.md create mode 100644 jcapiv2/docs/ConnectwiseIntegrationPatchReq.md create mode 100644 jcapiv2/docs/ConnectwiseIntegrationReq.md create mode 100644 jcapiv2/docs/CustomEmail.md create mode 100644 jcapiv2/docs/CustomEmailTemplate.md create mode 100644 jcapiv2/docs/CustomEmailTemplateField.md create mode 100644 jcapiv2/docs/CustomEmailType.md create mode 100644 jcapiv2/docs/CustomEmailsApi.md create mode 100644 jcapiv2/docs/DEP.md create mode 100644 jcapiv2/docs/DEPSetupAssistantOption.md create mode 100644 jcapiv2/docs/DEPWelcomeScreen.md delete mode 100644 jcapiv2/docs/DefaultApi.md create mode 100644 jcapiv2/docs/DeviceIdEraseBody.md create mode 100644 jcapiv2/docs/DeviceIdLockBody.md create mode 100644 jcapiv2/docs/DeviceIdRestartBody.md delete mode 100644 jcapiv2/docs/DuoRegistrationApplicationReq.md create mode 100644 jcapiv2/docs/ErrorDetails.md delete mode 100644 jcapiv2/docs/Errorresponse.md create mode 100644 jcapiv2/docs/Feature.md create mode 100644 jcapiv2/docs/Filter.md create mode 100644 jcapiv2/docs/FilterQuery.md create mode 100644 jcapiv2/docs/GSuiteDirectionTranslation.md create mode 100644 jcapiv2/docs/GSuiteImportApi.md create mode 100644 jcapiv2/docs/GraphAttributeLdapGroups.md create mode 100644 jcapiv2/docs/GraphAttributePosixGroups.md create mode 100644 jcapiv2/docs/GraphAttributePosixGroupsPosixGroups.md create mode 100644 jcapiv2/docs/GraphAttributeRadius.md create mode 100644 jcapiv2/docs/GraphAttributeRadiusRadius.md create mode 100644 jcapiv2/docs/GraphAttributeRadiusRadiusReply.md create mode 100644 jcapiv2/docs/GraphAttributeSambaEnabled.md create mode 100644 jcapiv2/docs/GraphAttributeSudo.md create mode 100644 jcapiv2/docs/GraphAttributeSudoSudo.md create mode 100644 jcapiv2/docs/GraphAttributes.md delete mode 100644 jcapiv2/docs/GraphManagementReq.md rename jcapiv2/docs/{SystemGroupGraphManagementReq.md => GraphOperation.md} (87%) create mode 100644 jcapiv2/docs/GraphOperationActiveDirectory.md create mode 100644 jcapiv2/docs/GraphOperationApplication.md create mode 100644 jcapiv2/docs/GraphOperationCommand.md create mode 100644 jcapiv2/docs/GraphOperationGSuite.md create mode 100644 jcapiv2/docs/GraphOperationLdapServer.md create mode 100644 jcapiv2/docs/GraphOperationOffice365.md create mode 100644 jcapiv2/docs/GraphOperationPolicy.md create mode 100644 jcapiv2/docs/GraphOperationPolicyGroup.md rename jcapiv2/docs/{UserGroupMembersReq.md => GraphOperationPolicyGroupMember.md} (67%) create mode 100644 jcapiv2/docs/GraphOperationRadiusServer.md create mode 100644 jcapiv2/docs/GraphOperationSoftwareApp.md create mode 100644 jcapiv2/docs/GraphOperationSystem.md create mode 100644 jcapiv2/docs/GraphOperationSystemGroup.md rename jcapiv2/docs/{SystemGroupMembersReq.md => GraphOperationSystemGroupMember.md} (66%) create mode 100644 jcapiv2/docs/GraphOperationUser.md create mode 100644 jcapiv2/docs/GraphOperationUserGroup.md create mode 100644 jcapiv2/docs/GraphOperationUserGroupMember.md create mode 100644 jcapiv2/docs/GroupAttributesUserGroup.md create mode 100644 jcapiv2/docs/GroupIdSuggestionsBody.md create mode 100644 jcapiv2/docs/IPList.md create mode 100644 jcapiv2/docs/IPListRequest.md create mode 100644 jcapiv2/docs/IPListsApi.md create mode 100644 jcapiv2/docs/ImageApi.md create mode 100644 jcapiv2/docs/ImportUser.md create mode 100644 jcapiv2/docs/ImportUserAddress.md create mode 100644 jcapiv2/docs/ImportUserPhoneNumber.md create mode 100644 jcapiv2/docs/ImportUsersResponse.md create mode 100644 jcapiv2/docs/InlineResponse20010.md create mode 100644 jcapiv2/docs/InlineResponse20011.md create mode 100644 jcapiv2/docs/InlineResponse20011Users.md create mode 100644 jcapiv2/docs/InlineResponse20012.md create mode 100644 jcapiv2/docs/InlineResponse20013.md create mode 100644 jcapiv2/docs/InlineResponse2002.md create mode 100644 jcapiv2/docs/InlineResponse2002Users.md create mode 100644 jcapiv2/docs/InlineResponse2003.md create mode 100644 jcapiv2/docs/InlineResponse2004.md create mode 100644 jcapiv2/docs/InlineResponse2005.md create mode 100644 jcapiv2/docs/InlineResponse2006.md create mode 100644 jcapiv2/docs/InlineResponse2007.md create mode 100644 jcapiv2/docs/InlineResponse2008.md create mode 100644 jcapiv2/docs/InlineResponse2009.md create mode 100644 jcapiv2/docs/Integration.md create mode 100644 jcapiv2/docs/IntegrationSyncError.md create mode 100644 jcapiv2/docs/IntegrationSyncErrorResp.md create mode 100644 jcapiv2/docs/IntegrationType.md create mode 100644 jcapiv2/docs/IntegrationsResponse.md delete mode 100644 jcapiv2/docs/KnowledgeApi.md rename jcapiv2/docs/{ProviderContact.md => LdapGroup.md} (84%) rename jcapiv2/docs/{Body3.md => LdapserversIdBody.md} (96%) create mode 100644 jcapiv2/docs/LogosApi.md create mode 100644 jcapiv2/docs/ManagedServiceProviderApi.md create mode 100644 jcapiv2/docs/MemberSuggestion.md create mode 100644 jcapiv2/docs/MemberSuggestionsPostResult.md create mode 100644 jcapiv2/docs/OSRestriction.md create mode 100644 jcapiv2/docs/OSRestrictionAppleRestrictions.md create mode 100644 jcapiv2/docs/Office365DirectionTranslation.md create mode 100644 jcapiv2/docs/Office365ImportApi.md create mode 100644 jcapiv2/docs/Office365Output.md rename jcapiv1/docs/Body.md => jcapiv2/docs/Office365PatchInput.md (72%) delete mode 100644 jcapiv2/docs/OrgCryptoSettings.md rename jcapiv2/docs/{JcEnrollmentProfile.md => Organization.md} (67%) create mode 100644 jcapiv2/docs/OrganizationCase.md rename jcapiv1/docs/Tagslist.md => jcapiv2/docs/OrganizationCasesResponse.md (64%) delete mode 100644 jcapiv2/docs/OrgcryptosettingsSshKeys.md rename jcapiv2/docs/{SystemuserputpostPhoneNumbers.md => PhoneNumber.md} (87%) create mode 100644 jcapiv2/docs/PolicyGroup.md create mode 100644 jcapiv2/docs/PolicyGroupAssociationsApi.md create mode 100644 jcapiv2/docs/PolicyGroupData.md create mode 100644 jcapiv2/docs/PolicyGroupMembersMembershipApi.md create mode 100644 jcapiv2/docs/PolicyGroupsApi.md create mode 100644 jcapiv2/docs/ProviderInvoice.md create mode 100644 jcapiv2/docs/ProviderInvoiceResponse.md create mode 100644 jcapiv2/docs/PushEndpointResponse.md create mode 100644 jcapiv2/docs/PushEndpointResponseDevice.md create mode 100644 jcapiv2/docs/PushendpointsPushEndpointIdBody.md create mode 100644 jcapiv2/docs/PwmAllUsers.md create mode 100644 jcapiv2/docs/PwmAllUsersGroups.md create mode 100644 jcapiv2/docs/PwmAllUsersResults.md create mode 100644 jcapiv2/docs/PwmOverviewAppVersions.md create mode 100644 jcapiv2/docs/PwmOverviewAppVersionsResults.md create mode 100644 jcapiv2/docs/PwmOverviewMain.md rename jcapiv2/docs/{Body1.md => PwmOverviewMainDevices.md} (76%) create mode 100644 jcapiv2/docs/Query.md create mode 100644 jcapiv2/docs/QueuedCommandList.md create mode 100644 jcapiv2/docs/QueuedCommandListResults.md create mode 100644 jcapiv2/docs/SCIMImportApi.md create mode 100644 jcapiv2/docs/ScheduledUserstateResult.md create mode 100644 jcapiv2/docs/SetupAssistantOption.md create mode 100644 jcapiv2/docs/SharedFolderAccessLevels.md create mode 100644 jcapiv2/docs/SharedFolderAccessLevelsResults.md create mode 100644 jcapiv2/docs/SharedFolderDetails.md create mode 100644 jcapiv2/docs/SharedFolderUsers.md create mode 100644 jcapiv2/docs/SharedFolderUsersResults.md create mode 100644 jcapiv2/docs/SharedFoldersList.md create mode 100644 jcapiv2/docs/SharedFoldersListResults.md rename jcapiv2/docs/{SalesforceknowledgelistoutputInner.md => SoftwareApp.md} (67%) create mode 100644 jcapiv2/docs/SoftwareAppAppleVpp.md create mode 100644 jcapiv2/docs/SoftwareAppReclaimLicenses.md create mode 100644 jcapiv2/docs/SoftwareAppSettings.md create mode 100644 jcapiv2/docs/SoftwareAppStatus.md create mode 100644 jcapiv2/docs/SoftwareAppWithStatus.md create mode 100644 jcapiv2/docs/SoftwareAppsApi.md create mode 100644 jcapiv2/docs/SoftwareAppsRetryInstallationRequest.md delete mode 100644 jcapiv2/docs/Sshkeylist.md create mode 100644 jcapiv2/docs/Subscription.md create mode 100644 jcapiv2/docs/SubscriptionsApi.md create mode 100644 jcapiv2/docs/SuggestionCounts.md delete mode 100644 jcapiv2/docs/SystemGraphManagementReq.md delete mode 100644 jcapiv2/docs/SystemGraphManagementReqAttributes.md create mode 100644 jcapiv2/docs/SystemInsightsAlf.md create mode 100644 jcapiv2/docs/SystemInsightsAlfExceptions.md create mode 100644 jcapiv2/docs/SystemInsightsAlfExplicitAuths.md create mode 100644 jcapiv2/docs/SystemInsightsAppcompatShims.md create mode 100644 jcapiv2/docs/SystemInsightsAuthorizedKeys.md create mode 100644 jcapiv2/docs/SystemInsightsAzureInstanceMetadata.md create mode 100644 jcapiv2/docs/SystemInsightsAzureInstanceTags.md create mode 100644 jcapiv2/docs/SystemInsightsCertificates.md create mode 100644 jcapiv2/docs/SystemInsightsChassisInfo.md create mode 100644 jcapiv2/docs/SystemInsightsConnectivity.md create mode 100644 jcapiv2/docs/SystemInsightsCupsDestinations.md create mode 100644 jcapiv2/docs/SystemInsightsDnsResolvers.md create mode 100644 jcapiv2/docs/SystemInsightsInterfaceDetails.md create mode 100644 jcapiv2/docs/SystemInsightsLinuxPackages.md rename jcapiv2/docs/{SystemInsightsLogicalDrvies.md => SystemInsightsLogicalDrives.md} (95%) create mode 100644 jcapiv2/docs/SystemInsightsManagedPolicies.md create mode 100644 jcapiv2/docs/SystemInsightsPythonPackages.md create mode 100644 jcapiv2/docs/SystemInsightsScheduledTasks.md create mode 100644 jcapiv2/docs/SystemInsightsSecureboot.md create mode 100644 jcapiv2/docs/SystemInsightsServices.md create mode 100644 jcapiv2/docs/SystemInsightsShadow.md create mode 100644 jcapiv2/docs/SystemInsightsSharedFolders.md create mode 100644 jcapiv2/docs/SystemInsightsSharedResources.md create mode 100644 jcapiv2/docs/SystemInsightsSharingPreferences.md create mode 100644 jcapiv2/docs/SystemInsightsSipConfig.md rename jcapiv2/docs/{JobDetails.md => SystemInsightsStartupItems.md} (56%) create mode 100644 jcapiv2/docs/SystemInsightsTpmInfo.md create mode 100644 jcapiv2/docs/SystemInsightsUserSshKeys.md create mode 100644 jcapiv2/docs/SystemInsightsUserassist.md create mode 100644 jcapiv2/docs/SystemInsightsWifiNetworks.md create mode 100644 jcapiv2/docs/SystemInsightsWifiStatus.md delete mode 100644 jcapiv2/docs/SystemInsightsWindowsCrashes.md create mode 100644 jcapiv2/docs/SystemInsightsWindowsSecurityCenter.md create mode 100644 jcapiv2/docs/SystemInsightsWindowsSecurityProducts.md delete mode 100644 jcapiv2/docs/Systemuser.md delete mode 100644 jcapiv2/docs/Systemuserputpost.md create mode 100644 jcapiv2/docs/TicketingIntegrationAlert.md create mode 100644 jcapiv2/docs/TicketingIntegrationAlertsResp.md create mode 100644 jcapiv2/docs/User.md delete mode 100644 jcapiv2/docs/UserGraphManagementReq.md delete mode 100644 jcapiv2/docs/UserGroupAttributes.md delete mode 100644 jcapiv2/docs/UserGroupGraphManagementReq.md create mode 100644 jcapiv2/jcapiv2/api/administrators_api.py create mode 100644 jcapiv2/jcapiv2/api/authentication_policies_api.py create mode 100644 jcapiv2/jcapiv2/api/command_results_api.py create mode 100644 jcapiv2/jcapiv2/api/custom_emails_api.py delete mode 100644 jcapiv2/jcapiv2/api/default_api.py create mode 100644 jcapiv2/jcapiv2/api/g_suite_import_api.py create mode 100644 jcapiv2/jcapiv2/api/image_api.py create mode 100644 jcapiv2/jcapiv2/api/ip_lists_api.py delete mode 100644 jcapiv2/jcapiv2/api/knowledge_api.py create mode 100644 jcapiv2/jcapiv2/api/logos_api.py create mode 100644 jcapiv2/jcapiv2/api/managed_service_provider_api.py create mode 100644 jcapiv2/jcapiv2/api/office_365_import_api.py create mode 100644 jcapiv2/jcapiv2/api/policy_group_associations_api.py create mode 100644 jcapiv2/jcapiv2/api/policy_group_members__membership_api.py create mode 100644 jcapiv2/jcapiv2/api/policy_groups_api.py create mode 100644 jcapiv2/jcapiv2/api/scim_import_api.py create mode 100644 jcapiv2/jcapiv2/api/software_apps_api.py create mode 100644 jcapiv2/jcapiv2/api/subscriptions_api.py create mode 100644 jcapiv2/jcapiv2/models/address.py create mode 100644 jcapiv2/jcapiv2/models/ade.py create mode 100644 jcapiv2/jcapiv2/models/ades.py create mode 100644 jcapiv2/jcapiv2/models/administrator_organization_link.py create mode 100644 jcapiv2/jcapiv2/models/administrator_organization_link_req.py create mode 100644 jcapiv2/jcapiv2/models/all_of_autotask_ticketing_alert_configuration_list_records_items.py create mode 100644 jcapiv2/jcapiv2/models/all_of_connect_wise_ticketing_alert_configuration_list_records_items.py create mode 100644 jcapiv2/jcapiv2/models/any_value.py create mode 100644 jcapiv2/jcapiv2/models/apple_mdm_device.py create mode 100644 jcapiv2/jcapiv2/models/apple_mdm_device_info.py create mode 100644 jcapiv2/jcapiv2/models/apple_mdm_device_security_info.py create mode 100644 jcapiv2/jcapiv2/models/apple_mdm_public_key_cert.py create mode 100644 jcapiv2/jcapiv2/models/apple_mdm_signed_csr_plist.py create mode 100644 jcapiv2/jcapiv2/models/application_id_logo_body.py create mode 100644 jcapiv2/jcapiv2/models/authn_policy.py create mode 100644 jcapiv2/jcapiv2/models/authn_policy_effect.py create mode 100644 jcapiv2/jcapiv2/models/authn_policy_input.py create mode 100644 jcapiv2/jcapiv2/models/authn_policy_obligations.py create mode 100644 jcapiv2/jcapiv2/models/authn_policy_obligations_mfa.py create mode 100644 jcapiv2/jcapiv2/models/authn_policy_obligations_user_verification.py create mode 100644 jcapiv2/jcapiv2/models/authn_policy_resource_target.py create mode 100644 jcapiv2/jcapiv2/models/authn_policy_targets.py create mode 100644 jcapiv2/jcapiv2/models/authn_policy_type.py create mode 100644 jcapiv2/jcapiv2/models/authn_policy_user_attribute_filter.py create mode 100644 jcapiv2/jcapiv2/models/authn_policy_user_attribute_target.py create mode 100644 jcapiv2/jcapiv2/models/authn_policy_user_group_target.py create mode 100644 jcapiv2/jcapiv2/models/authn_policy_user_target.py create mode 100644 jcapiv2/jcapiv2/models/autotask_company.py create mode 100644 jcapiv2/jcapiv2/models/autotask_company_resp.py create mode 100644 jcapiv2/jcapiv2/models/autotask_company_type_resp.py create mode 100644 jcapiv2/jcapiv2/models/autotask_contract.py create mode 100644 jcapiv2/jcapiv2/models/autotask_contract_field.py create mode 100644 jcapiv2/jcapiv2/models/autotask_contract_field_values.py create mode 100644 jcapiv2/jcapiv2/models/autotask_integration.py create mode 100644 jcapiv2/jcapiv2/models/autotask_integration_patch_req.py create mode 100644 jcapiv2/jcapiv2/models/autotask_integration_req.py create mode 100644 jcapiv2/jcapiv2/models/autotask_mapping_request.py create mode 100644 jcapiv2/jcapiv2/models/autotask_mapping_request_company.py create mode 100644 jcapiv2/jcapiv2/models/autotask_mapping_request_contract.py create mode 100644 jcapiv2/jcapiv2/models/autotask_mapping_request_data.py create mode 100644 jcapiv2/jcapiv2/models/autotask_mapping_request_organization.py create mode 100644 jcapiv2/jcapiv2/models/autotask_mapping_request_service.py create mode 100644 jcapiv2/jcapiv2/models/autotask_mapping_response.py create mode 100644 jcapiv2/jcapiv2/models/autotask_mapping_response_company.py create mode 100644 jcapiv2/jcapiv2/models/autotask_mapping_response_contract.py create mode 100644 jcapiv2/jcapiv2/models/autotask_mapping_response_organization.py create mode 100644 jcapiv2/jcapiv2/models/autotask_mapping_response_service.py create mode 100644 jcapiv2/jcapiv2/models/autotask_service.py create mode 100644 jcapiv2/jcapiv2/models/autotask_settings.py create mode 100644 jcapiv2/jcapiv2/models/autotask_settings_patch_req.py create mode 100644 jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration.py create mode 100644 jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_list.py create mode 100644 jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_option.py create mode 100644 jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_option_values.py create mode 100644 jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_options.py create mode 100644 jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_priority.py create mode 100644 jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_request.py create mode 100644 jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_resource.py create mode 100644 jcapiv2/jcapiv2/models/billing_integration_company_type.py delete mode 100644 jcapiv2/jcapiv2/models/body.py delete mode 100644 jcapiv2/jcapiv2/models/body1.py delete mode 100644 jcapiv2/jcapiv2/models/body2.py delete mode 100644 jcapiv2/jcapiv2/models/body3.py create mode 100644 jcapiv2/jcapiv2/models/bulk_scheduled_statechange_create.py create mode 100644 jcapiv2/jcapiv2/models/command_result_list.py create mode 100644 jcapiv2/jcapiv2/models/command_result_list_results.py create mode 100644 jcapiv2/jcapiv2/models/connect_wise_mapping_request.py create mode 100644 jcapiv2/jcapiv2/models/connect_wise_mapping_request_company.py create mode 100644 jcapiv2/jcapiv2/models/connect_wise_mapping_request_data.py create mode 100644 jcapiv2/jcapiv2/models/connect_wise_mapping_request_organization.py create mode 100644 jcapiv2/jcapiv2/models/connect_wise_mapping_response.py create mode 100644 jcapiv2/jcapiv2/models/connect_wise_mapping_response_addition.py create mode 100644 jcapiv2/jcapiv2/models/connect_wise_settings.py create mode 100644 jcapiv2/jcapiv2/models/connect_wise_settings_patch_req.py create mode 100644 jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration.py create mode 100644 jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration_list.py create mode 100644 jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration_option.py create mode 100644 jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration_options.py create mode 100644 jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration_request.py create mode 100644 jcapiv2/jcapiv2/models/connectwise_addition.py create mode 100644 jcapiv2/jcapiv2/models/connectwise_agreement.py create mode 100644 jcapiv2/jcapiv2/models/connectwise_company.py create mode 100644 jcapiv2/jcapiv2/models/connectwise_company_resp.py create mode 100644 jcapiv2/jcapiv2/models/connectwise_company_type_resp.py create mode 100644 jcapiv2/jcapiv2/models/connectwise_integration.py create mode 100644 jcapiv2/jcapiv2/models/connectwise_integration_patch_req.py create mode 100644 jcapiv2/jcapiv2/models/connectwise_integration_req.py create mode 100644 jcapiv2/jcapiv2/models/custom_email.py create mode 100644 jcapiv2/jcapiv2/models/custom_email_template.py create mode 100644 jcapiv2/jcapiv2/models/custom_email_template_field.py create mode 100644 jcapiv2/jcapiv2/models/custom_email_type.py create mode 100644 jcapiv2/jcapiv2/models/dep.py create mode 100644 jcapiv2/jcapiv2/models/dep_setup_assistant_option.py create mode 100644 jcapiv2/jcapiv2/models/dep_welcome_screen.py create mode 100644 jcapiv2/jcapiv2/models/device_id_erase_body.py create mode 100644 jcapiv2/jcapiv2/models/device_id_lock_body.py create mode 100644 jcapiv2/jcapiv2/models/device_id_restart_body.py delete mode 100644 jcapiv2/jcapiv2/models/duo_registration_application.py delete mode 100644 jcapiv2/jcapiv2/models/duo_registration_application_req.py delete mode 100644 jcapiv2/jcapiv2/models/emailrequest.py delete mode 100644 jcapiv2/jcapiv2/models/enrollment_profile.py create mode 100644 jcapiv2/jcapiv2/models/error_details.py delete mode 100644 jcapiv2/jcapiv2/models/errorresponse.py create mode 100644 jcapiv2/jcapiv2/models/feature.py create mode 100644 jcapiv2/jcapiv2/models/filter.py create mode 100644 jcapiv2/jcapiv2/models/filter_query.py create mode 100644 jcapiv2/jcapiv2/models/g_suite_direction_translation.py create mode 100644 jcapiv2/jcapiv2/models/graph_attribute_ldap_groups.py create mode 100644 jcapiv2/jcapiv2/models/graph_attribute_posix_groups.py create mode 100644 jcapiv2/jcapiv2/models/graph_attribute_posix_groups_posix_groups.py create mode 100644 jcapiv2/jcapiv2/models/graph_attribute_radius.py create mode 100644 jcapiv2/jcapiv2/models/graph_attribute_radius_radius.py create mode 100644 jcapiv2/jcapiv2/models/graph_attribute_radius_radius_reply.py create mode 100644 jcapiv2/jcapiv2/models/graph_attribute_samba_enabled.py create mode 100644 jcapiv2/jcapiv2/models/graph_attribute_sudo.py create mode 100644 jcapiv2/jcapiv2/models/graph_attribute_sudo_sudo.py create mode 100644 jcapiv2/jcapiv2/models/graph_attributes.py delete mode 100644 jcapiv2/jcapiv2/models/graph_management_req.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation_active_directory.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation_application.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation_command.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation_g_suite.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation_ldap_server.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation_office365.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation_policy.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation_policy_group.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation_policy_group_member.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation_radius_server.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation_software_app.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation_system.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation_system_group.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation_system_group_member.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation_user.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation_user_group.py create mode 100644 jcapiv2/jcapiv2/models/graph_operation_user_group_member.py create mode 100644 jcapiv2/jcapiv2/models/group_attributes_user_group.py create mode 100644 jcapiv2/jcapiv2/models/group_id_suggestions_body.py create mode 100644 jcapiv2/jcapiv2/models/import_user.py create mode 100644 jcapiv2/jcapiv2/models/import_user_address.py create mode 100644 jcapiv2/jcapiv2/models/import_user_phone_number.py create mode 100644 jcapiv2/jcapiv2/models/import_users_response.py create mode 100644 jcapiv2/jcapiv2/models/inline_response20010.py create mode 100644 jcapiv2/jcapiv2/models/inline_response20011.py create mode 100644 jcapiv2/jcapiv2/models/inline_response20011_users.py create mode 100644 jcapiv2/jcapiv2/models/inline_response20012.py create mode 100644 jcapiv2/jcapiv2/models/inline_response20013.py create mode 100644 jcapiv2/jcapiv2/models/inline_response2002.py create mode 100644 jcapiv2/jcapiv2/models/inline_response2002_users.py create mode 100644 jcapiv2/jcapiv2/models/inline_response2003.py create mode 100644 jcapiv2/jcapiv2/models/inline_response2004.py create mode 100644 jcapiv2/jcapiv2/models/inline_response2005.py create mode 100644 jcapiv2/jcapiv2/models/inline_response2006.py create mode 100644 jcapiv2/jcapiv2/models/inline_response2007.py create mode 100644 jcapiv2/jcapiv2/models/inline_response2008.py create mode 100644 jcapiv2/jcapiv2/models/inline_response2009.py create mode 100644 jcapiv2/jcapiv2/models/integration.py create mode 100644 jcapiv2/jcapiv2/models/integration_sync_error.py create mode 100644 jcapiv2/jcapiv2/models/integration_sync_error_resp.py create mode 100644 jcapiv2/jcapiv2/models/integration_type.py create mode 100644 jcapiv2/jcapiv2/models/integrations_response.py create mode 100644 jcapiv2/jcapiv2/models/ip_list.py create mode 100644 jcapiv2/jcapiv2/models/ip_list_request.py delete mode 100644 jcapiv2/jcapiv2/models/jc_enrollment_profile.py delete mode 100644 jcapiv2/jcapiv2/models/job_details.py create mode 100644 jcapiv2/jcapiv2/models/ldap_group.py create mode 100644 jcapiv2/jcapiv2/models/ldapservers_id_body.py create mode 100644 jcapiv2/jcapiv2/models/member_suggestion.py create mode 100644 jcapiv2/jcapiv2/models/member_suggestions_post_result.py delete mode 100644 jcapiv2/jcapiv2/models/mfa.py delete mode 100644 jcapiv2/jcapiv2/models/oauth_code_input.py create mode 100644 jcapiv2/jcapiv2/models/office365_direction_translation.py create mode 100644 jcapiv2/jcapiv2/models/office365_output.py create mode 100644 jcapiv2/jcapiv2/models/office365_patch_input.py delete mode 100644 jcapiv2/jcapiv2/models/org_crypto_settings.py create mode 100644 jcapiv2/jcapiv2/models/organization.py create mode 100644 jcapiv2/jcapiv2/models/organization_case.py create mode 100644 jcapiv2/jcapiv2/models/organization_cases_response.py delete mode 100644 jcapiv2/jcapiv2/models/orgcryptosettings_ssh_keys.py create mode 100644 jcapiv2/jcapiv2/models/os_restriction.py create mode 100644 jcapiv2/jcapiv2/models/os_restriction_apple_restrictions.py create mode 100644 jcapiv2/jcapiv2/models/phone_number.py create mode 100644 jcapiv2/jcapiv2/models/policy_group.py create mode 100644 jcapiv2/jcapiv2/models/policy_group_data.py delete mode 100644 jcapiv2/jcapiv2/models/provider_contact.py create mode 100644 jcapiv2/jcapiv2/models/provider_invoice.py create mode 100644 jcapiv2/jcapiv2/models/provider_invoice_response.py create mode 100644 jcapiv2/jcapiv2/models/push_endpoint_response.py create mode 100644 jcapiv2/jcapiv2/models/push_endpoint_response_device.py create mode 100644 jcapiv2/jcapiv2/models/pushendpoints_push_endpoint_id_body.py create mode 100644 jcapiv2/jcapiv2/models/pwm_all_users.py create mode 100644 jcapiv2/jcapiv2/models/pwm_all_users_groups.py create mode 100644 jcapiv2/jcapiv2/models/pwm_all_users_results.py create mode 100644 jcapiv2/jcapiv2/models/pwm_overview_app_versions.py create mode 100644 jcapiv2/jcapiv2/models/pwm_overview_app_versions_results.py create mode 100644 jcapiv2/jcapiv2/models/pwm_overview_main.py create mode 100644 jcapiv2/jcapiv2/models/pwm_overview_main_devices.py create mode 100644 jcapiv2/jcapiv2/models/query.py create mode 100644 jcapiv2/jcapiv2/models/queued_command_list.py create mode 100644 jcapiv2/jcapiv2/models/queued_command_list_results.py delete mode 100644 jcapiv2/jcapiv2/models/salesforce_knowledge_list_output.py delete mode 100644 jcapiv2/jcapiv2/models/salesforceknowledgelistoutput_inner.py create mode 100644 jcapiv2/jcapiv2/models/scheduled_userstate_result.py create mode 100644 jcapiv2/jcapiv2/models/setup_assistant_option.py create mode 100644 jcapiv2/jcapiv2/models/shared_folder_access_levels.py create mode 100644 jcapiv2/jcapiv2/models/shared_folder_access_levels_results.py create mode 100644 jcapiv2/jcapiv2/models/shared_folder_details.py create mode 100644 jcapiv2/jcapiv2/models/shared_folder_users.py create mode 100644 jcapiv2/jcapiv2/models/shared_folder_users_results.py create mode 100644 jcapiv2/jcapiv2/models/shared_folders_list.py create mode 100644 jcapiv2/jcapiv2/models/shared_folders_list_results.py create mode 100644 jcapiv2/jcapiv2/models/software_app.py create mode 100644 jcapiv2/jcapiv2/models/software_app_apple_vpp.py create mode 100644 jcapiv2/jcapiv2/models/software_app_reclaim_licenses.py create mode 100644 jcapiv2/jcapiv2/models/software_app_settings.py create mode 100644 jcapiv2/jcapiv2/models/software_app_status.py create mode 100644 jcapiv2/jcapiv2/models/software_app_with_status.py create mode 100644 jcapiv2/jcapiv2/models/software_apps_retry_installation_request.py delete mode 100644 jcapiv2/jcapiv2/models/sshkeylist.py create mode 100644 jcapiv2/jcapiv2/models/subscription.py create mode 100644 jcapiv2/jcapiv2/models/suggestion_counts.py delete mode 100644 jcapiv2/jcapiv2/models/system_graph_management_req.py delete mode 100644 jcapiv2/jcapiv2/models/system_graph_management_req_attributes.py delete mode 100644 jcapiv2/jcapiv2/models/system_graph_management_req_attributes_sudo.py delete mode 100644 jcapiv2/jcapiv2/models/system_group_graph_management_req.py delete mode 100644 jcapiv2/jcapiv2/models/system_group_members_req.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_alf.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_alf_exceptions.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_alf_explicit_auths.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_appcompat_shims.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_authorized_keys.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_azure_instance_metadata.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_azure_instance_tags.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_certificates.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_chassis_info.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_connectivity.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_cups_destinations.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_dns_resolvers.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_interface_details.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_linux_packages.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_logical_drives.py delete mode 100644 jcapiv2/jcapiv2/models/system_insights_logical_drvies.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_managed_policies.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_python_packages.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_scheduled_tasks.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_secureboot.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_services.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_shadow.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_shared_folders.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_shared_resources.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_sharing_preferences.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_sip_config.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_startup_items.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_tpm_info.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_user_ssh_keys.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_userassist.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_wifi_networks.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_wifi_status.py delete mode 100644 jcapiv2/jcapiv2/models/system_insights_windows_crashes.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_windows_security_center.py create mode 100644 jcapiv2/jcapiv2/models/system_insights_windows_security_products.py delete mode 100644 jcapiv2/jcapiv2/models/systemuser.py delete mode 100644 jcapiv2/jcapiv2/models/systemuserputpost.py delete mode 100644 jcapiv2/jcapiv2/models/systemuserputpost_addresses.py delete mode 100644 jcapiv2/jcapiv2/models/systemuserputpost_phone_numbers.py create mode 100644 jcapiv2/jcapiv2/models/ticketing_integration_alert.py create mode 100644 jcapiv2/jcapiv2/models/ticketing_integration_alerts_resp.py create mode 100644 jcapiv2/jcapiv2/models/user.py delete mode 100644 jcapiv2/jcapiv2/models/user_graph_management_req.py delete mode 100644 jcapiv2/jcapiv2/models/user_group_attributes.py delete mode 100644 jcapiv2/jcapiv2/models/user_group_attributes_posix_groups.py delete mode 100644 jcapiv2/jcapiv2/models/user_group_graph_management_req.py delete mode 100644 jcapiv2/jcapiv2/models/user_group_members_req.py delete mode 100644 jcapiv2/jcapiv2/models/workday_request.py create mode 100644 jcapiv2/test/test_address.py create mode 100644 jcapiv2/test/test_ade.py create mode 100644 jcapiv2/test/test_ades.py create mode 100644 jcapiv2/test/test_administrator_organization_link.py create mode 100644 jcapiv2/test/test_administrator_organization_link_req.py create mode 100644 jcapiv2/test/test_administrators_api.py create mode 100644 jcapiv2/test/test_all_of_autotask_ticketing_alert_configuration_list_records_items.py create mode 100644 jcapiv2/test/test_all_of_connect_wise_ticketing_alert_configuration_list_records_items.py create mode 100644 jcapiv2/test/test_any_value.py create mode 100644 jcapiv2/test/test_apple_mdm_device.py create mode 100644 jcapiv2/test/test_apple_mdm_device_info.py create mode 100644 jcapiv2/test/test_apple_mdm_device_security_info.py create mode 100644 jcapiv2/test/test_apple_mdm_public_key_cert.py create mode 100644 jcapiv2/test/test_apple_mdm_signed_csr_plist.py create mode 100644 jcapiv2/test/test_application_id_logo_body.py create mode 100644 jcapiv2/test/test_authentication_policies_api.py create mode 100644 jcapiv2/test/test_authn_policy.py create mode 100644 jcapiv2/test/test_authn_policy_effect.py create mode 100644 jcapiv2/test/test_authn_policy_input.py create mode 100644 jcapiv2/test/test_authn_policy_obligations.py create mode 100644 jcapiv2/test/test_authn_policy_obligations_mfa.py create mode 100644 jcapiv2/test/test_authn_policy_obligations_user_verification.py create mode 100644 jcapiv2/test/test_authn_policy_resource_target.py create mode 100644 jcapiv2/test/test_authn_policy_targets.py create mode 100644 jcapiv2/test/test_authn_policy_type.py create mode 100644 jcapiv2/test/test_authn_policy_user_attribute_filter.py create mode 100644 jcapiv2/test/test_authn_policy_user_attribute_target.py create mode 100644 jcapiv2/test/test_authn_policy_user_group_target.py create mode 100644 jcapiv2/test/test_authn_policy_user_target.py create mode 100644 jcapiv2/test/test_autotask_company.py create mode 100644 jcapiv2/test/test_autotask_company_resp.py create mode 100644 jcapiv2/test/test_autotask_company_type_resp.py create mode 100644 jcapiv2/test/test_autotask_contract.py create mode 100644 jcapiv2/test/test_autotask_contract_field.py create mode 100644 jcapiv2/test/test_autotask_contract_field_values.py create mode 100644 jcapiv2/test/test_autotask_integration.py create mode 100644 jcapiv2/test/test_autotask_integration_patch_req.py create mode 100644 jcapiv2/test/test_autotask_integration_req.py create mode 100644 jcapiv2/test/test_autotask_mapping_request.py create mode 100644 jcapiv2/test/test_autotask_mapping_request_company.py create mode 100644 jcapiv2/test/test_autotask_mapping_request_contract.py create mode 100644 jcapiv2/test/test_autotask_mapping_request_data.py create mode 100644 jcapiv2/test/test_autotask_mapping_request_organization.py create mode 100644 jcapiv2/test/test_autotask_mapping_request_service.py create mode 100644 jcapiv2/test/test_autotask_mapping_response.py create mode 100644 jcapiv2/test/test_autotask_mapping_response_company.py create mode 100644 jcapiv2/test/test_autotask_mapping_response_contract.py create mode 100644 jcapiv2/test/test_autotask_mapping_response_organization.py create mode 100644 jcapiv2/test/test_autotask_mapping_response_service.py create mode 100644 jcapiv2/test/test_autotask_service.py create mode 100644 jcapiv2/test/test_autotask_settings.py create mode 100644 jcapiv2/test/test_autotask_settings_patch_req.py create mode 100644 jcapiv2/test/test_autotask_ticketing_alert_configuration.py create mode 100644 jcapiv2/test/test_autotask_ticketing_alert_configuration_list.py create mode 100644 jcapiv2/test/test_autotask_ticketing_alert_configuration_option.py create mode 100644 jcapiv2/test/test_autotask_ticketing_alert_configuration_option_values.py create mode 100644 jcapiv2/test/test_autotask_ticketing_alert_configuration_options.py create mode 100644 jcapiv2/test/test_autotask_ticketing_alert_configuration_priority.py create mode 100644 jcapiv2/test/test_autotask_ticketing_alert_configuration_request.py create mode 100644 jcapiv2/test/test_autotask_ticketing_alert_configuration_resource.py create mode 100644 jcapiv2/test/test_billing_integration_company_type.py delete mode 100644 jcapiv2/test/test_body.py delete mode 100644 jcapiv2/test/test_body1.py delete mode 100644 jcapiv2/test/test_body2.py delete mode 100644 jcapiv2/test/test_body3.py create mode 100644 jcapiv2/test/test_bulk_scheduled_statechange_create.py create mode 100644 jcapiv2/test/test_command_result_list.py create mode 100644 jcapiv2/test/test_command_result_list_results.py create mode 100644 jcapiv2/test/test_command_results_api.py create mode 100644 jcapiv2/test/test_connect_wise_mapping_request.py create mode 100644 jcapiv2/test/test_connect_wise_mapping_request_company.py create mode 100644 jcapiv2/test/test_connect_wise_mapping_request_data.py create mode 100644 jcapiv2/test/test_connect_wise_mapping_request_organization.py create mode 100644 jcapiv2/test/test_connect_wise_mapping_response.py create mode 100644 jcapiv2/test/test_connect_wise_mapping_response_addition.py create mode 100644 jcapiv2/test/test_connect_wise_settings.py create mode 100644 jcapiv2/test/test_connect_wise_settings_patch_req.py create mode 100644 jcapiv2/test/test_connect_wise_ticketing_alert_configuration.py create mode 100644 jcapiv2/test/test_connect_wise_ticketing_alert_configuration_list.py create mode 100644 jcapiv2/test/test_connect_wise_ticketing_alert_configuration_option.py create mode 100644 jcapiv2/test/test_connect_wise_ticketing_alert_configuration_options.py create mode 100644 jcapiv2/test/test_connect_wise_ticketing_alert_configuration_request.py create mode 100644 jcapiv2/test/test_connectwise_addition.py create mode 100644 jcapiv2/test/test_connectwise_agreement.py create mode 100644 jcapiv2/test/test_connectwise_company.py create mode 100644 jcapiv2/test/test_connectwise_company_resp.py create mode 100644 jcapiv2/test/test_connectwise_company_type_resp.py create mode 100644 jcapiv2/test/test_connectwise_integration.py create mode 100644 jcapiv2/test/test_connectwise_integration_patch_req.py create mode 100644 jcapiv2/test/test_connectwise_integration_req.py create mode 100644 jcapiv2/test/test_custom_email.py create mode 100644 jcapiv2/test/test_custom_email_template.py create mode 100644 jcapiv2/test/test_custom_email_template_field.py create mode 100644 jcapiv2/test/test_custom_email_type.py create mode 100644 jcapiv2/test/test_custom_emails_api.py delete mode 100644 jcapiv2/test/test_default_api.py create mode 100644 jcapiv2/test/test_dep.py create mode 100644 jcapiv2/test/test_dep_setup_assistant_option.py create mode 100644 jcapiv2/test/test_dep_welcome_screen.py create mode 100644 jcapiv2/test/test_device_id_erase_body.py create mode 100644 jcapiv2/test/test_device_id_lock_body.py create mode 100644 jcapiv2/test/test_device_id_restart_body.py delete mode 100644 jcapiv2/test/test_duo_registration_application.py delete mode 100644 jcapiv2/test/test_duo_registration_application_req.py delete mode 100644 jcapiv2/test/test_emailrequest.py delete mode 100644 jcapiv2/test/test_enrollment_profile.py create mode 100644 jcapiv2/test/test_error_details.py delete mode 100644 jcapiv2/test/test_errorresponse.py create mode 100644 jcapiv2/test/test_feature.py create mode 100644 jcapiv2/test/test_filter.py create mode 100644 jcapiv2/test/test_filter_query.py create mode 100644 jcapiv2/test/test_g_suite_direction_translation.py create mode 100644 jcapiv2/test/test_g_suite_import_api.py create mode 100644 jcapiv2/test/test_graph_attribute_ldap_groups.py create mode 100644 jcapiv2/test/test_graph_attribute_posix_groups.py create mode 100644 jcapiv2/test/test_graph_attribute_posix_groups_posix_groups.py create mode 100644 jcapiv2/test/test_graph_attribute_radius.py create mode 100644 jcapiv2/test/test_graph_attribute_radius_radius.py create mode 100644 jcapiv2/test/test_graph_attribute_radius_radius_reply.py create mode 100644 jcapiv2/test/test_graph_attribute_samba_enabled.py create mode 100644 jcapiv2/test/test_graph_attribute_sudo.py create mode 100644 jcapiv2/test/test_graph_attribute_sudo_sudo.py create mode 100644 jcapiv2/test/test_graph_attributes.py delete mode 100644 jcapiv2/test/test_graph_management_req.py create mode 100644 jcapiv2/test/test_graph_operation.py create mode 100644 jcapiv2/test/test_graph_operation_active_directory.py create mode 100644 jcapiv2/test/test_graph_operation_application.py create mode 100644 jcapiv2/test/test_graph_operation_command.py create mode 100644 jcapiv2/test/test_graph_operation_g_suite.py create mode 100644 jcapiv2/test/test_graph_operation_ldap_server.py create mode 100644 jcapiv2/test/test_graph_operation_office365.py create mode 100644 jcapiv2/test/test_graph_operation_policy.py create mode 100644 jcapiv2/test/test_graph_operation_policy_group.py create mode 100644 jcapiv2/test/test_graph_operation_policy_group_member.py create mode 100644 jcapiv2/test/test_graph_operation_radius_server.py create mode 100644 jcapiv2/test/test_graph_operation_software_app.py create mode 100644 jcapiv2/test/test_graph_operation_system.py create mode 100644 jcapiv2/test/test_graph_operation_system_group.py create mode 100644 jcapiv2/test/test_graph_operation_system_group_member.py create mode 100644 jcapiv2/test/test_graph_operation_user.py create mode 100644 jcapiv2/test/test_graph_operation_user_group.py create mode 100644 jcapiv2/test/test_graph_operation_user_group_member.py create mode 100644 jcapiv2/test/test_group_attributes_user_group.py create mode 100644 jcapiv2/test/test_group_id_suggestions_body.py create mode 100644 jcapiv2/test/test_image_api.py create mode 100644 jcapiv2/test/test_import_user.py create mode 100644 jcapiv2/test/test_import_user_address.py create mode 100644 jcapiv2/test/test_import_user_phone_number.py create mode 100644 jcapiv2/test/test_import_users_response.py create mode 100644 jcapiv2/test/test_inline_response20010.py create mode 100644 jcapiv2/test/test_inline_response20011.py create mode 100644 jcapiv2/test/test_inline_response20011_users.py create mode 100644 jcapiv2/test/test_inline_response20012.py create mode 100644 jcapiv2/test/test_inline_response20013.py create mode 100644 jcapiv2/test/test_inline_response2002.py create mode 100644 jcapiv2/test/test_inline_response2002_users.py create mode 100644 jcapiv2/test/test_inline_response2003.py create mode 100644 jcapiv2/test/test_inline_response2004.py create mode 100644 jcapiv2/test/test_inline_response2005.py create mode 100644 jcapiv2/test/test_inline_response2006.py create mode 100644 jcapiv2/test/test_inline_response2007.py create mode 100644 jcapiv2/test/test_inline_response2008.py create mode 100644 jcapiv2/test/test_inline_response2009.py create mode 100644 jcapiv2/test/test_integration.py create mode 100644 jcapiv2/test/test_integration_sync_error.py create mode 100644 jcapiv2/test/test_integration_sync_error_resp.py create mode 100644 jcapiv2/test/test_integration_type.py create mode 100644 jcapiv2/test/test_integrations_response.py create mode 100644 jcapiv2/test/test_ip_list.py create mode 100644 jcapiv2/test/test_ip_list_request.py create mode 100644 jcapiv2/test/test_ip_lists_api.py delete mode 100644 jcapiv2/test/test_jc_enrollment_profile.py delete mode 100644 jcapiv2/test/test_job_details.py delete mode 100644 jcapiv2/test/test_knowledge_api.py create mode 100644 jcapiv2/test/test_ldap_group.py create mode 100644 jcapiv2/test/test_ldapservers_id_body.py create mode 100644 jcapiv2/test/test_logos_api.py create mode 100644 jcapiv2/test/test_managed_service_provider_api.py create mode 100644 jcapiv2/test/test_member_suggestion.py create mode 100644 jcapiv2/test/test_member_suggestions_post_result.py delete mode 100644 jcapiv2/test/test_mfa.py delete mode 100644 jcapiv2/test/test_oauth_code_input.py create mode 100644 jcapiv2/test/test_office365_direction_translation.py create mode 100644 jcapiv2/test/test_office365_output.py create mode 100644 jcapiv2/test/test_office365_patch_input.py create mode 100644 jcapiv2/test/test_office_365_import_api.py delete mode 100644 jcapiv2/test/test_org_crypto_settings.py create mode 100644 jcapiv2/test/test_organization.py create mode 100644 jcapiv2/test/test_organization_case.py create mode 100644 jcapiv2/test/test_organization_cases_response.py delete mode 100644 jcapiv2/test/test_orgcryptosettings_ssh_keys.py create mode 100644 jcapiv2/test/test_os_restriction.py create mode 100644 jcapiv2/test/test_os_restriction_apple_restrictions.py create mode 100644 jcapiv2/test/test_phone_number.py create mode 100644 jcapiv2/test/test_policy_group.py create mode 100644 jcapiv2/test/test_policy_group_associations_api.py create mode 100644 jcapiv2/test/test_policy_group_data.py create mode 100644 jcapiv2/test/test_policy_group_members__membership_api.py create mode 100644 jcapiv2/test/test_policy_groups_api.py delete mode 100644 jcapiv2/test/test_provider_contact.py create mode 100644 jcapiv2/test/test_provider_invoice.py create mode 100644 jcapiv2/test/test_provider_invoice_response.py create mode 100644 jcapiv2/test/test_push_endpoint_response.py create mode 100644 jcapiv2/test/test_push_endpoint_response_device.py create mode 100644 jcapiv2/test/test_pushendpoints_push_endpoint_id_body.py create mode 100644 jcapiv2/test/test_pwm_all_users.py create mode 100644 jcapiv2/test/test_pwm_all_users_groups.py create mode 100644 jcapiv2/test/test_pwm_all_users_results.py create mode 100644 jcapiv2/test/test_pwm_overview_app_versions.py create mode 100644 jcapiv2/test/test_pwm_overview_app_versions_results.py create mode 100644 jcapiv2/test/test_pwm_overview_main.py create mode 100644 jcapiv2/test/test_pwm_overview_main_devices.py create mode 100644 jcapiv2/test/test_query.py create mode 100644 jcapiv2/test/test_queued_command_list.py create mode 100644 jcapiv2/test/test_queued_command_list_results.py delete mode 100644 jcapiv2/test/test_salesforce_knowledge_list_output.py delete mode 100644 jcapiv2/test/test_salesforceknowledgelistoutput_inner.py create mode 100644 jcapiv2/test/test_scheduled_userstate_result.py create mode 100644 jcapiv2/test/test_scim_import_api.py create mode 100644 jcapiv2/test/test_setup_assistant_option.py create mode 100644 jcapiv2/test/test_shared_folder_access_levels.py create mode 100644 jcapiv2/test/test_shared_folder_access_levels_results.py create mode 100644 jcapiv2/test/test_shared_folder_details.py create mode 100644 jcapiv2/test/test_shared_folder_users.py create mode 100644 jcapiv2/test/test_shared_folder_users_results.py create mode 100644 jcapiv2/test/test_shared_folders_list.py create mode 100644 jcapiv2/test/test_shared_folders_list_results.py create mode 100644 jcapiv2/test/test_software_app.py create mode 100644 jcapiv2/test/test_software_app_apple_vpp.py create mode 100644 jcapiv2/test/test_software_app_reclaim_licenses.py create mode 100644 jcapiv2/test/test_software_app_settings.py create mode 100644 jcapiv2/test/test_software_app_status.py create mode 100644 jcapiv2/test/test_software_app_with_status.py create mode 100644 jcapiv2/test/test_software_apps_api.py create mode 100644 jcapiv2/test/test_software_apps_retry_installation_request.py delete mode 100644 jcapiv2/test/test_sshkeylist.py create mode 100644 jcapiv2/test/test_subscription.py create mode 100644 jcapiv2/test/test_subscriptions_api.py create mode 100644 jcapiv2/test/test_suggestion_counts.py delete mode 100644 jcapiv2/test/test_system_graph_management_req.py delete mode 100644 jcapiv2/test/test_system_graph_management_req_attributes.py delete mode 100644 jcapiv2/test/test_system_graph_management_req_attributes_sudo.py delete mode 100644 jcapiv2/test/test_system_group_graph_management_req.py delete mode 100644 jcapiv2/test/test_system_group_members_req.py create mode 100644 jcapiv2/test/test_system_insights_alf.py create mode 100644 jcapiv2/test/test_system_insights_alf_exceptions.py create mode 100644 jcapiv2/test/test_system_insights_alf_explicit_auths.py create mode 100644 jcapiv2/test/test_system_insights_appcompat_shims.py create mode 100644 jcapiv2/test/test_system_insights_authorized_keys.py create mode 100644 jcapiv2/test/test_system_insights_azure_instance_metadata.py create mode 100644 jcapiv2/test/test_system_insights_azure_instance_tags.py create mode 100644 jcapiv2/test/test_system_insights_certificates.py create mode 100644 jcapiv2/test/test_system_insights_chassis_info.py create mode 100644 jcapiv2/test/test_system_insights_connectivity.py create mode 100644 jcapiv2/test/test_system_insights_cups_destinations.py create mode 100644 jcapiv2/test/test_system_insights_dns_resolvers.py create mode 100644 jcapiv2/test/test_system_insights_interface_details.py create mode 100644 jcapiv2/test/test_system_insights_linux_packages.py create mode 100644 jcapiv2/test/test_system_insights_logical_drives.py delete mode 100644 jcapiv2/test/test_system_insights_logical_drvies.py create mode 100644 jcapiv2/test/test_system_insights_managed_policies.py create mode 100644 jcapiv2/test/test_system_insights_python_packages.py create mode 100644 jcapiv2/test/test_system_insights_scheduled_tasks.py create mode 100644 jcapiv2/test/test_system_insights_secureboot.py create mode 100644 jcapiv2/test/test_system_insights_services.py create mode 100644 jcapiv2/test/test_system_insights_shadow.py create mode 100644 jcapiv2/test/test_system_insights_shared_folders.py create mode 100644 jcapiv2/test/test_system_insights_shared_resources.py create mode 100644 jcapiv2/test/test_system_insights_sharing_preferences.py create mode 100644 jcapiv2/test/test_system_insights_sip_config.py create mode 100644 jcapiv2/test/test_system_insights_startup_items.py create mode 100644 jcapiv2/test/test_system_insights_tpm_info.py create mode 100644 jcapiv2/test/test_system_insights_user_ssh_keys.py create mode 100644 jcapiv2/test/test_system_insights_userassist.py create mode 100644 jcapiv2/test/test_system_insights_wifi_networks.py create mode 100644 jcapiv2/test/test_system_insights_wifi_status.py delete mode 100644 jcapiv2/test/test_system_insights_windows_crashes.py create mode 100644 jcapiv2/test/test_system_insights_windows_security_center.py create mode 100644 jcapiv2/test/test_system_insights_windows_security_products.py delete mode 100644 jcapiv2/test/test_systemuser.py delete mode 100644 jcapiv2/test/test_systemuserputpost.py delete mode 100644 jcapiv2/test/test_systemuserputpost_addresses.py delete mode 100644 jcapiv2/test/test_systemuserputpost_phone_numbers.py create mode 100644 jcapiv2/test/test_ticketing_integration_alert.py create mode 100644 jcapiv2/test/test_ticketing_integration_alerts_resp.py create mode 100644 jcapiv2/test/test_user.py delete mode 100644 jcapiv2/test/test_user_graph_management_req.py delete mode 100644 jcapiv2/test/test_user_group_attributes.py delete mode 100644 jcapiv2/test/test_user_group_attributes_posix_groups.py delete mode 100644 jcapiv2/test/test_user_group_graph_management_req.py delete mode 100644 jcapiv2/test/test_user_group_members_req.py delete mode 100644 jcapiv2/test/test_workday_request.py diff --git a/config_v1.json b/config_v1.json index ed7b6d9..04d3c87 100644 --- a/config_v1.json +++ b/config_v1.json @@ -1,4 +1,4 @@ { "packageName": "jcapiv1", - "packageVersion": "4.0.0" -} \ No newline at end of file + "packageVersion": "5.0.0" +} diff --git a/config_v2.json b/config_v2.json index 23fc25a..8fab156 100644 --- a/config_v2.json +++ b/config_v2.json @@ -1,4 +1,4 @@ { "packageName": "jcapiv2", - "packageVersion": "4.0.0" -} \ No newline at end of file + "packageVersion": "5.0.0" +} diff --git a/docker-compose.yml b/docker-compose.yml index ff7f9b6..bdec4c3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '2' services: swagger-codegen: - image: swaggerapi/swagger-codegen-cli:2.4.2 + image: parsertongue/swagger-codegen-cli:3.0.32 volumes: - ./input:/swagger-api/yaml # volume for input yaml files - ./output:/swagger-api/out # volume for generated files diff --git a/jcapiv1/.swagger-codegen/VERSION b/jcapiv1/.swagger-codegen/VERSION index acdc3f1..8d87cde 100644 --- a/jcapiv1/.swagger-codegen/VERSION +++ b/jcapiv1/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.2 \ No newline at end of file +3.0.32 \ No newline at end of file diff --git a/jcapiv1/.travis.yml b/jcapiv1/.travis.yml index 86211e2..dd6c445 100644 --- a/jcapiv1/.travis.yml +++ b/jcapiv1/.travis.yml @@ -1,7 +1,6 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "2.7" - "3.2" - "3.3" - "3.4" diff --git a/jcapiv1/README.md b/jcapiv1/README.md index 4a5fdcf..44cbe75 100644 --- a/jcapiv1/README.md +++ b/jcapiv1/README.md @@ -1,11 +1,12 @@ # jcapiv1 - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. +# Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 1.0 -- Package version: 4.0.0 -- Build package: io.swagger.codegen.languages.PythonClientCodegen +- Package version: 5.0.0 +- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen +For more information, please visit [https://support.jumpcloud.com/support/s/](https://support.jumpcloud.com/support/s/) ## Requirements. @@ -60,22 +61,41 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.ApplicationTemplatesApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = 'fields_example' # str | The comma separated fields included in the returned records. If omitted the default list of fields will be returned. (optional) +fields = 'fields_example' # str | The space separated fields included in the returned records. If omitted the default list of fields will be returned. (optional) limit = 56 # int | The number of records to return at once. (optional) skip = 56 # int | The offset into the records to return. (optional) -sort = 'The comma separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending.' # str | (optional) (default to The comma separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending.) -filter = 'filter_example' # str | A filter to apply to the query. (optional) -x_org_id = '' # str | (optional) (default to ) +sort = 'sort_example' # str | The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) +x_org_id = 'x_org_id_example' # str | (optional) try: # Get an Application Template - api_response = api_instance.application_templates_get(id, content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) + api_response = api_instance.application_templates_get(id, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ApplicationTemplatesApi->application_templates_get: %s\n" % e) +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.ApplicationTemplatesApi(jcapiv1.ApiClient(configuration)) +fields = 'fields_example' # str | The space separated fields included in the returned records. If omitted the default list of fields will be returned. (optional) +limit = 56 # int | The number of records to return at once. (optional) +skip = 56 # int | The offset into the records to return. (optional) +sort = 'sort_example' # str | The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) +x_org_id = 'x_org_id_example' # str | (optional) + +try: + # List Application Templates + api_response = api_instance.application_templates_list(fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ApplicationTemplatesApi->application_templates_list: %s\n" % e) ``` ## Documentation for API Endpoints @@ -98,40 +118,51 @@ Class | Method | HTTP request | Description *CommandsApi* | [**command_file_get**](docs/CommandsApi.md#command_file_get) | **GET** /files/command/{id} | Get a Command File *CommandsApi* | [**commands_delete**](docs/CommandsApi.md#commands_delete) | **DELETE** /commands/{id} | Delete a Command *CommandsApi* | [**commands_get**](docs/CommandsApi.md#commands_get) | **GET** /commands/{id} | List an individual Command +*CommandsApi* | [**commands_get_results**](docs/CommandsApi.md#commands_get_results) | **GET** /commands/{id}/results | Get results for a specific command *CommandsApi* | [**commands_list**](docs/CommandsApi.md#commands_list) | **GET** /commands | List All Commands *CommandsApi* | [**commands_post**](docs/CommandsApi.md#commands_post) | **POST** /commands | Create A Command *CommandsApi* | [**commands_put**](docs/CommandsApi.md#commands_put) | **PUT** /commands/{id} | Update a Command +*ManagedServiceProviderApi* | [**admin_totpreset_begin**](docs/ManagedServiceProviderApi.md#admin_totpreset_begin) | **POST** /users/resettotp/{id} | Administrator TOTP Reset Initiation +*ManagedServiceProviderApi* | [**organization_list**](docs/ManagedServiceProviderApi.md#organization_list) | **GET** /organizations | Get Organization Details +*ManagedServiceProviderApi* | [**users_put**](docs/ManagedServiceProviderApi.md#users_put) | **PUT** /users/{id} | Update a user +*ManagedServiceProviderApi* | [**users_reactivate_get**](docs/ManagedServiceProviderApi.md#users_reactivate_get) | **GET** /users/reactivate/{id} | Administrator Password Reset Initiation *OrganizationsApi* | [**organization_list**](docs/OrganizationsApi.md#organization_list) | **GET** /organizations | Get Organization Details +*OrganizationsApi* | [**organization_put**](docs/OrganizationsApi.md#organization_put) | **PUT** /organizations/{id} | Update an Organization +*OrganizationsApi* | [**organizations_get**](docs/OrganizationsApi.md#organizations_get) | **GET** /organizations/{id} | Get an Organization +*RadiusServersApi* | [**radius_servers_delete**](docs/RadiusServersApi.md#radius_servers_delete) | **DELETE** /radiusservers/{id} | Delete Radius Server +*RadiusServersApi* | [**radius_servers_get**](docs/RadiusServersApi.md#radius_servers_get) | **GET** /radiusservers/{id} | Get Radius Server *RadiusServersApi* | [**radius_servers_list**](docs/RadiusServersApi.md#radius_servers_list) | **GET** /radiusservers | List Radius Servers *RadiusServersApi* | [**radius_servers_post**](docs/RadiusServersApi.md#radius_servers_post) | **POST** /radiusservers | Create a Radius Server *RadiusServersApi* | [**radius_servers_put**](docs/RadiusServersApi.md#radius_servers_put) | **PUT** /radiusservers/{id} | Update Radius Servers +*SearchApi* | [**search_commandresults_post**](docs/SearchApi.md#search_commandresults_post) | **POST** /search/commandresults | Search Commands Results +*SearchApi* | [**search_commands_post**](docs/SearchApi.md#search_commands_post) | **POST** /search/commands | Search Commands *SearchApi* | [**search_organizations_post**](docs/SearchApi.md#search_organizations_post) | **POST** /search/organizations | Search Organizations *SearchApi* | [**search_systems_post**](docs/SearchApi.md#search_systems_post) | **POST** /search/systems | Search Systems *SearchApi* | [**search_systemusers_post**](docs/SearchApi.md#search_systemusers_post) | **POST** /search/systemusers | Search System Users +*SystemsApi* | [**systems_command_builtin_erase**](docs/SystemsApi.md#systems_command_builtin_erase) | **POST** /systems/{system_id}/command/builtin/erase | Erase a System +*SystemsApi* | [**systems_command_builtin_lock**](docs/SystemsApi.md#systems_command_builtin_lock) | **POST** /systems/{system_id}/command/builtin/lock | Lock a System +*SystemsApi* | [**systems_command_builtin_restart**](docs/SystemsApi.md#systems_command_builtin_restart) | **POST** /systems/{system_id}/command/builtin/restart | Restart a System +*SystemsApi* | [**systems_command_builtin_shutdown**](docs/SystemsApi.md#systems_command_builtin_shutdown) | **POST** /systems/{system_id}/command/builtin/shutdown | Shutdown a System *SystemsApi* | [**systems_delete**](docs/SystemsApi.md#systems_delete) | **DELETE** /systems/{id} | Delete a System *SystemsApi* | [**systems_get**](docs/SystemsApi.md#systems_get) | **GET** /systems/{id} | List an individual system *SystemsApi* | [**systems_list**](docs/SystemsApi.md#systems_list) | **GET** /systems | List All Systems *SystemsApi* | [**systems_put**](docs/SystemsApi.md#systems_put) | **PUT** /systems/{id} | Update a system -*SystemsApi* | [**systems_systemusers_binding_list**](docs/SystemsApi.md#systems_systemusers_binding_list) | **GET** /systems/{id}/systemusers | List system user bindings -*SystemsApi* | [**systems_systemusers_binding_put**](docs/SystemsApi.md#systems_systemusers_binding_put) | **PUT** /systems/{id}/systemusers | Update a system's or user's binding -*SystemusersApi* | [**sshkey_delete**](docs/SystemusersApi.md#sshkey_delete) | **DELETE** /systemusers/{systemuser_id}/sshkeys/{id} | Delete a system user's Public SSH Keys -*SystemusersApi* | [**sshkey_list**](docs/SystemusersApi.md#sshkey_list) | **GET** /systemusers/{id}/sshkeys | List a system user's public SSH keys -*SystemusersApi* | [**sshkey_post**](docs/SystemusersApi.md#sshkey_post) | **POST** /systemusers/{id}/sshkeys | Create a system user's Public SSH Key +*SystemusersApi* | [**sshkey_delete**](docs/SystemusersApi.md#sshkey_delete) | **DELETE** /systemusers/{systemuser_id}/sshkeys/{id} | Delete a system user's Public SSH Keys +*SystemusersApi* | [**sshkey_list**](docs/SystemusersApi.md#sshkey_list) | **GET** /systemusers/{id}/sshkeys | List a system user's public SSH keys +*SystemusersApi* | [**sshkey_post**](docs/SystemusersApi.md#sshkey_post) | **POST** /systemusers/{id}/sshkeys | Create a system user's Public SSH Key *SystemusersApi* | [**systemusers_delete**](docs/SystemusersApi.md#systemusers_delete) | **DELETE** /systemusers/{id} | Delete a system user +*SystemusersApi* | [**systemusers_expire**](docs/SystemusersApi.md#systemusers_expire) | **POST** /systemusers/{id}/expire | Expire a system user's password *SystemusersApi* | [**systemusers_get**](docs/SystemusersApi.md#systemusers_get) | **GET** /systemusers/{id} | List a system user *SystemusersApi* | [**systemusers_list**](docs/SystemusersApi.md#systemusers_list) | **GET** /systemusers | List all system users +*SystemusersApi* | [**systemusers_mfasync**](docs/SystemusersApi.md#systemusers_mfasync) | **POST** /systemusers/{id}/mfasync | Sync a systemuser's mfa enrollment status *SystemusersApi* | [**systemusers_post**](docs/SystemusersApi.md#systemusers_post) | **POST** /systemusers | Create a system user *SystemusersApi* | [**systemusers_put**](docs/SystemusersApi.md#systemusers_put) | **PUT** /systemusers/{id} | Update a system user -*SystemusersApi* | [**systemusers_resetmfa**](docs/SystemusersApi.md#systemusers_resetmfa) | **POST** /systemusers/{id}/resetmfa | Reset a system user's MFA token -*SystemusersApi* | [**systemusers_systems_binding_list**](docs/SystemusersApi.md#systemusers_systems_binding_list) | **GET** /systemusers/{id}/systems | List system user binding -*SystemusersApi* | [**systemusers_systems_binding_put**](docs/SystemusersApi.md#systemusers_systems_binding_put) | **PUT** /systemusers/{id}/systems | Update a system user binding +*SystemusersApi* | [**systemusers_resetmfa**](docs/SystemusersApi.md#systemusers_resetmfa) | **POST** /systemusers/{id}/resetmfa | Reset a system user's MFA token +*SystemusersApi* | [**systemusers_state_activate**](docs/SystemusersApi.md#systemusers_state_activate) | **POST** /systemusers/{id}/state/activate | Activate System User *SystemusersApi* | [**systemusers_unlock**](docs/SystemusersApi.md#systemusers_unlock) | **POST** /systemusers/{id}/unlock | Unlock a system user -*TagsApi* | [**tags_delete**](docs/TagsApi.md#tags_delete) | **DELETE** /tags/{name} | Delete a Tag -*TagsApi* | [**tags_get**](docs/TagsApi.md#tags_get) | **GET** /Tags/{name} | List a Tag -*TagsApi* | [**tags_list**](docs/TagsApi.md#tags_list) | **GET** /tags | List All Tags -*TagsApi* | [**tags_post**](docs/TagsApi.md#tags_post) | **POST** /tags | Create a Tag -*TagsApi* | [**tags_put**](docs/TagsApi.md#tags_put) | **PUT** /Tag/{name} | Update a Tag - +*UsersApi* | [**admin_totpreset_begin**](docs/UsersApi.md#admin_totpreset_begin) | **POST** /users/resettotp/{id} | Administrator TOTP Reset Initiation +*UsersApi* | [**users_put**](docs/UsersApi.md#users_put) | **PUT** /users/{id} | Update a user +*UsersApi* | [**users_reactivate_get**](docs/UsersApi.md#users_reactivate_get) | **GET** /users/reactivate/{id} | Administrator Password Reset Initiation ## Documentation For Models @@ -143,12 +174,14 @@ Class | Method | HTTP request | Description - [ApplicationConfigConstantAttributes](docs/ApplicationConfigConstantAttributes.md) - [ApplicationConfigConstantAttributesValue](docs/ApplicationConfigConstantAttributesValue.md) - [ApplicationConfigDatabaseAttributes](docs/ApplicationConfigDatabaseAttributes.md) + - [ApplicationLogo](docs/ApplicationLogo.md) - [Applicationslist](docs/Applicationslist.md) - [Applicationtemplate](docs/Applicationtemplate.md) - [ApplicationtemplateJit](docs/ApplicationtemplateJit.md) + - [ApplicationtemplateLogo](docs/ApplicationtemplateLogo.md) + - [ApplicationtemplateOidc](docs/ApplicationtemplateOidc.md) + - [ApplicationtemplateProvision](docs/ApplicationtemplateProvision.md) - [Applicationtemplateslist](docs/Applicationtemplateslist.md) - - [Body](docs/Body.md) - - [Body1](docs/Body1.md) - [Command](docs/Command.md) - [Commandfilereturn](docs/Commandfilereturn.md) - [CommandfilereturnResults](docs/CommandfilereturnResults.md) @@ -156,47 +189,86 @@ Class | Method | HTTP request | Description - [CommandresultResponse](docs/CommandresultResponse.md) - [CommandresultResponseData](docs/CommandresultResponseData.md) - [Commandresultslist](docs/Commandresultslist.md) + - [CommandresultslistResults](docs/CommandresultslistResults.md) - [Commandslist](docs/Commandslist.md) - [CommandslistResults](docs/CommandslistResults.md) - - [Errorresponse](docs/Errorresponse.md) + - [Error](docs/Error.md) + - [ErrorDetails](docs/ErrorDetails.md) - [Fde](docs/Fde.md) + - [IdResetmfaBody](docs/IdResetmfaBody.md) - [Mfa](docs/Mfa.md) + - [MfaEnrollment](docs/MfaEnrollment.md) + - [MfaEnrollmentStatus](docs/MfaEnrollmentStatus.md) + - [Organization](docs/Organization.md) + - [Organizationentitlement](docs/Organizationentitlement.md) + - [OrganizationentitlementEntitlementProducts](docs/OrganizationentitlementEntitlementProducts.md) + - [OrganizationsIdBody](docs/OrganizationsIdBody.md) + - [Organizationsettings](docs/Organizationsettings.md) + - [OrganizationsettingsDisplayPreferences](docs/OrganizationsettingsDisplayPreferences.md) + - [OrganizationsettingsDisplayPreferencesOrgInsights](docs/OrganizationsettingsDisplayPreferencesOrgInsights.md) + - [OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage](docs/OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) + - [OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats](docs/OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats.md) + - [OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications](docs/OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications.md) + - [OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications](docs/OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications.md) + - [OrganizationsettingsFeatures](docs/OrganizationsettingsFeatures.md) + - [OrganizationsettingsFeaturesDirectoryInsights](docs/OrganizationsettingsFeaturesDirectoryInsights.md) + - [OrganizationsettingsFeaturesDirectoryInsightsPremium](docs/OrganizationsettingsFeaturesDirectoryInsightsPremium.md) + - [OrganizationsettingsFeaturesSystemInsights](docs/OrganizationsettingsFeaturesSystemInsights.md) + - [OrganizationsettingsNewSystemUserStateDefaults](docs/OrganizationsettingsNewSystemUserStateDefaults.md) + - [OrganizationsettingsPasswordPolicy](docs/OrganizationsettingsPasswordPolicy.md) + - [OrganizationsettingsUserPortal](docs/OrganizationsettingsUserPortal.md) + - [Organizationsettingsput](docs/Organizationsettingsput.md) + - [OrganizationsettingsputNewSystemUserStateDefaults](docs/OrganizationsettingsputNewSystemUserStateDefaults.md) + - [OrganizationsettingsputPasswordPolicy](docs/OrganizationsettingsputPasswordPolicy.md) - [Organizationslist](docs/Organizationslist.md) - [OrganizationslistResults](docs/OrganizationslistResults.md) - [Radiusserver](docs/Radiusserver.md) - [Radiusserverpost](docs/Radiusserverpost.md) - [Radiusserverput](docs/Radiusserverput.md) + - [RadiusserversIdBody](docs/RadiusserversIdBody.md) - [Radiusserverslist](docs/Radiusserverslist.md) - [Search](docs/Search.md) - [Sshkeylist](docs/Sshkeylist.md) - [Sshkeypost](docs/Sshkeypost.md) + - [Sso](docs/Sso.md) + - [StateActivateBody](docs/StateActivateBody.md) - [System](docs/System.md) + - [SystemBuiltInCommands](docs/SystemBuiltInCommands.md) + - [SystemDomainInfo](docs/SystemDomainInfo.md) + - [SystemMdm](docs/SystemMdm.md) + - [SystemMdmInternal](docs/SystemMdmInternal.md) - [SystemNetworkInterfaces](docs/SystemNetworkInterfaces.md) + - [SystemOsVersionDetail](docs/SystemOsVersionDetail.md) + - [SystemProvisionMetadata](docs/SystemProvisionMetadata.md) + - [SystemProvisionMetadataProvisioner](docs/SystemProvisionMetadataProvisioner.md) + - [SystemServiceAccountState](docs/SystemServiceAccountState.md) - [SystemSshdParams](docs/SystemSshdParams.md) - [SystemSystemInsights](docs/SystemSystemInsights.md) + - [SystemUserMetrics](docs/SystemUserMetrics.md) - [Systemput](docs/Systemput.md) - [SystemputAgentBoundMessages](docs/SystemputAgentBoundMessages.md) - [Systemslist](docs/Systemslist.md) - - [Systemuser](docs/Systemuser.md) - - [Systemuserbinding](docs/Systemuserbinding.md) - - [Systemuserbindingsput](docs/Systemuserbindingsput.md) - [Systemuserput](docs/Systemuserput.md) - [SystemuserputAddresses](docs/SystemuserputAddresses.md) + - [SystemuserputAttributes](docs/SystemuserputAttributes.md) - [SystemuserputPhoneNumbers](docs/SystemuserputPhoneNumbers.md) + - [SystemuserputRelationships](docs/SystemuserputRelationships.md) - [Systemuserputpost](docs/Systemuserputpost.md) - [SystemuserputpostAddresses](docs/SystemuserputpostAddresses.md) - [SystemuserputpostPhoneNumbers](docs/SystemuserputpostPhoneNumbers.md) + - [SystemuserputpostRecoveryEmail](docs/SystemuserputpostRecoveryEmail.md) - [Systemuserreturn](docs/Systemuserreturn.md) - [SystemuserreturnAddresses](docs/SystemuserreturnAddresses.md) - [SystemuserreturnPhoneNumbers](docs/SystemuserreturnPhoneNumbers.md) + - [SystemuserreturnRecoveryEmail](docs/SystemuserreturnRecoveryEmail.md) - [Systemuserslist](docs/Systemuserslist.md) - - [Tag](docs/Tag.md) - - [Tagpost](docs/Tagpost.md) - - [Tagput](docs/Tagput.md) - - [Tagslist](docs/Tagslist.md) - - [Usersystembinding](docs/Usersystembinding.md) - - [Usersystembindingsput](docs/Usersystembindingsput.md) - + - [Triggerreturn](docs/Triggerreturn.md) + - [TrustedappConfigGet](docs/TrustedappConfigGet.md) + - [TrustedappConfigGetTrustedApps](docs/TrustedappConfigGetTrustedApps.md) + - [TrustedappConfigPut](docs/TrustedappConfigPut.md) + - [Userput](docs/Userput.md) + - [Userreturn](docs/Userreturn.md) + - [UserreturnGrowthData](docs/UserreturnGrowthData.md) ## Documentation For Authorization @@ -210,5 +282,4 @@ Class | Method | HTTP request | Description ## Author - - +support@jumpcloud.com diff --git a/jcapiv1/docs/Application.md b/jcapiv1/docs/Application.md index e4ce16f..8a51f97 100644 --- a/jcapiv1/docs/Application.md +++ b/jcapiv1/docs/Application.md @@ -4,15 +4,21 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] +**active** | **bool** | | [optional] **beta** | **bool** | | [optional] -**config** | [**ApplicationConfig**](ApplicationConfig.md) | | [optional] +**color** | **str** | | [optional] +**config** | [**ApplicationConfig**](ApplicationConfig.md) | | +**created** | **str** | | [optional] +**database_attributes** | **list[object]** | | [optional] +**description** | **str** | | [optional] **display_label** | **str** | | [optional] **display_name** | **str** | | [optional] **learn_more** | **str** | | [optional] -**name** | **str** | | [optional] +**logo** | [**ApplicationLogo**](ApplicationLogo.md) | | [optional] +**name** | **str** | | **organization** | **str** | | [optional] -**sso_url** | **str** | | [optional] +**sso** | [**Sso**](Sso.md) | | [optional] +**sso_url** | **str** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/ApplicationConfig.md b/jcapiv1/docs/ApplicationConfig.md index ea9ffaf..37134b2 100644 --- a/jcapiv1/docs/ApplicationConfig.md +++ b/jcapiv1/docs/ApplicationConfig.md @@ -13,4 +13,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/ApplicationConfigAcsUrl.md b/jcapiv1/docs/ApplicationConfigAcsUrl.md index dda61dc..5f663fa 100644 --- a/jcapiv1/docs/ApplicationConfigAcsUrl.md +++ b/jcapiv1/docs/ApplicationConfigAcsUrl.md @@ -4,9 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **label** | **str** | | [optional] +**options** | **str** | | [optional] **position** | **int** | | [optional] **read_only** | **bool** | | [optional] **required** | **bool** | | [optional] +**toggle** | **str** | | [optional] **tooltip** | [**ApplicationConfigAcsUrlTooltip**](ApplicationConfigAcsUrlTooltip.md) | | [optional] **type** | **str** | | [optional] **value** | **str** | | [optional] @@ -14,4 +16,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/ApplicationConfigAcsUrlTooltip.md b/jcapiv1/docs/ApplicationConfigAcsUrlTooltip.md index 4ece9ef..b1e28d9 100644 --- a/jcapiv1/docs/ApplicationConfigAcsUrlTooltip.md +++ b/jcapiv1/docs/ApplicationConfigAcsUrlTooltip.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/ApplicationConfigAcsUrlTooltipVariables.md b/jcapiv1/docs/ApplicationConfigAcsUrlTooltipVariables.md index 8028db2..2ffd5f3 100644 --- a/jcapiv1/docs/ApplicationConfigAcsUrlTooltipVariables.md +++ b/jcapiv1/docs/ApplicationConfigAcsUrlTooltipVariables.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/ApplicationConfigConstantAttributes.md b/jcapiv1/docs/ApplicationConfigConstantAttributes.md index 4af0a23..01ed81e 100644 --- a/jcapiv1/docs/ApplicationConfigConstantAttributes.md +++ b/jcapiv1/docs/ApplicationConfigConstantAttributes.md @@ -15,4 +15,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/ApplicationConfigConstantAttributesValue.md b/jcapiv1/docs/ApplicationConfigConstantAttributesValue.md index 72b54f7..5bd0dea 100644 --- a/jcapiv1/docs/ApplicationConfigConstantAttributesValue.md +++ b/jcapiv1/docs/ApplicationConfigConstantAttributesValue.md @@ -11,4 +11,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/ApplicationConfigDatabaseAttributes.md b/jcapiv1/docs/ApplicationConfigDatabaseAttributes.md index 1eeaf4a..19ef4f4 100644 --- a/jcapiv1/docs/ApplicationConfigDatabaseAttributes.md +++ b/jcapiv1/docs/ApplicationConfigDatabaseAttributes.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/ApplicationLogo.md b/jcapiv1/docs/ApplicationLogo.md new file mode 100644 index 0000000..50e0a31 --- /dev/null +++ b/jcapiv1/docs/ApplicationLogo.md @@ -0,0 +1,10 @@ +# ApplicationLogo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **str** | | [optional] +**url** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/ApplicationTemplatesApi.md b/jcapiv1/docs/ApplicationTemplatesApi.md index 45423bf..fd22a27 100644 --- a/jcapiv1/docs/ApplicationTemplatesApi.md +++ b/jcapiv1/docs/ApplicationTemplatesApi.md @@ -7,9 +7,8 @@ Method | HTTP request | Description [**application_templates_get**](ApplicationTemplatesApi.md#application_templates_get) | **GET** /application-templates/{id} | Get an Application Template [**application_templates_list**](ApplicationTemplatesApi.md#application_templates_list) | **GET** /application-templates | List Application Templates - # **application_templates_get** -> Applicationtemplate application_templates_get(id, content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) +> Applicationtemplate application_templates_get(id, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) Get an Application Template @@ -32,18 +31,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.ApplicationTemplatesApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = 'fields_example' # str | The comma separated fields included in the returned records. If omitted the default list of fields will be returned. (optional) +fields = 'fields_example' # str | The space separated fields included in the returned records. If omitted the default list of fields will be returned. (optional) limit = 56 # int | The number of records to return at once. (optional) skip = 56 # int | The offset into the records to return. (optional) -sort = 'The comma separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending.' # str | (optional) (default to The comma separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending.) -filter = 'filter_example' # str | A filter to apply to the query. (optional) -x_org_id = '' # str | (optional) (default to ) +sort = 'sort_example' # str | The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) +x_org_id = 'x_org_id_example' # str | (optional) try: # Get an Application Template - api_response = api_instance.application_templates_get(id, content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) + api_response = api_instance.application_templates_get(id, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ApplicationTemplatesApi->application_templates_get: %s\n" % e) @@ -54,14 +51,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | **str**| The comma separated fields included in the returned records. If omitted the default list of fields will be returned. | [optional] + **fields** | **str**| The space separated fields included in the returned records. If omitted the default list of fields will be returned. | [optional] **limit** | **int**| The number of records to return at once. | [optional] **skip** | **int**| The offset into the records to return. | [optional] - **sort** | **str**| | [optional] [default to The comma separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending.] - **filter** | **str**| A filter to apply to the query. | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | **str**| The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] + **x_org_id** | **str**| | [optional] ### Return type @@ -73,13 +68,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **application_templates_list** -> Applicationtemplateslist application_templates_list(content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) +> Applicationtemplateslist application_templates_list(fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) List Application Templates @@ -101,18 +96,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.ApplicationTemplatesApi(jcapiv1.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = 'fields_example' # str | The comma separated fields included in the returned records. If omitted the default list of fields will be returned. (optional) +fields = 'fields_example' # str | The space separated fields included in the returned records. If omitted the default list of fields will be returned. (optional) limit = 56 # int | The number of records to return at once. (optional) skip = 56 # int | The offset into the records to return. (optional) -sort = 'The comma separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending.' # str | (optional) (default to The comma separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending.) -filter = 'filter_example' # str | A filter to apply to the query. (optional) -x_org_id = '' # str | (optional) (default to ) +sort = 'sort_example' # str | The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) +x_org_id = 'x_org_id_example' # str | (optional) try: # List Application Templates - api_response = api_instance.application_templates_list(content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) + api_response = api_instance.application_templates_list(fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ApplicationTemplatesApi->application_templates_list: %s\n" % e) @@ -122,14 +115,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | **str**| The comma separated fields included in the returned records. If omitted the default list of fields will be returned. | [optional] + **fields** | **str**| The space separated fields included in the returned records. If omitted the default list of fields will be returned. | [optional] **limit** | **int**| The number of records to return at once. | [optional] **skip** | **int**| The offset into the records to return. | [optional] - **sort** | **str**| | [optional] [default to The comma separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending.] - **filter** | **str**| A filter to apply to the query. | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | **str**| The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] + **x_org_id** | **str**| | [optional] ### Return type @@ -141,7 +132,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv1/docs/ApplicationsApi.md b/jcapiv1/docs/ApplicationsApi.md index e725007..f3eac59 100644 --- a/jcapiv1/docs/ApplicationsApi.md +++ b/jcapiv1/docs/ApplicationsApi.md @@ -10,9 +10,8 @@ Method | HTTP request | Description [**applications_post**](ApplicationsApi.md#applications_post) | **POST** /applications | Create an Application [**applications_put**](ApplicationsApi.md#applications_put) | **PUT** /applications/{id} | Update an Application - # **applications_delete** -> Application applications_delete(id, content_type=content_type, accept=accept, x_org_id=x_org_id) +> Application applications_delete(id, x_org_id=x_org_id) Delete an Application @@ -35,13 +34,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.ApplicationsApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'content_type_example' # str | (optional) -accept = 'accept_example' # str | (optional) x_org_id = 'x_org_id_example' # str | (optional) try: # Delete an Application - api_response = api_instance.applications_delete(id, content_type=content_type, accept=accept, x_org_id=x_org_id) + api_response = api_instance.applications_delete(id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ApplicationsApi->applications_delete: %s\n" % e) @@ -52,8 +49,6 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [optional] - **accept** | **str**| | [optional] **x_org_id** | **str**| | [optional] ### Return type @@ -66,13 +61,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **applications_get** -> Application applications_get(id, content_type=content_type, accept=accept, x_org_id=x_org_id) +> Application applications_get(id, x_org_id=x_org_id) Get an Application @@ -95,13 +90,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.ApplicationsApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'content_type_example' # str | (optional) -accept = 'accept_example' # str | (optional) x_org_id = 'x_org_id_example' # str | (optional) try: # Get an Application - api_response = api_instance.applications_get(id, content_type=content_type, accept=accept, x_org_id=x_org_id) + api_response = api_instance.applications_get(id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ApplicationsApi->applications_get: %s\n" % e) @@ -112,8 +105,6 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [optional] - **accept** | **str**| | [optional] **x_org_id** | **str**| | [optional] ### Return type @@ -126,13 +117,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **applications_list** -> Applicationslist applications_list(content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) +> Applicationslist applications_list(fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) Applications @@ -154,18 +145,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.ApplicationsApi(jcapiv1.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = 'fields_example' # str | The comma separated fields included in the returned records. If omitted the default list of fields will be returned. (optional) +fields = 'fields_example' # str | The space separated fields included in the returned records. If omitted the default list of fields will be returned. (optional) limit = 56 # int | The number of records to return at once. (optional) skip = 56 # int | The offset into the records to return. (optional) -sort = 'The comma separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending.' # str | (optional) (default to The comma separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending.) -filter = 'filter_example' # str | A filter to apply to the query. (optional) -x_org_id = '' # str | (optional) (default to ) +sort = 'name' # str | The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. (optional) (default to name) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) +x_org_id = 'x_org_id_example' # str | (optional) try: # Applications - api_response = api_instance.applications_list(content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) + api_response = api_instance.applications_list(fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ApplicationsApi->applications_list: %s\n" % e) @@ -175,14 +164,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | **str**| The comma separated fields included in the returned records. If omitted the default list of fields will be returned. | [optional] + **fields** | **str**| The space separated fields included in the returned records. If omitted the default list of fields will be returned. | [optional] **limit** | **int**| The number of records to return at once. | [optional] **skip** | **int**| The offset into the records to return. | [optional] - **sort** | **str**| | [optional] [default to The comma separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending.] - **filter** | **str**| A filter to apply to the query. | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | **str**| The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. | [optional] [default to name] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] + **x_org_id** | **str**| | [optional] ### Return type @@ -194,13 +181,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **applications_post** -> Application applications_post(body=body, content_type=content_type, accept=accept, x_org_id=x_org_id) +> Application applications_post(body=body, x_org_id=x_org_id) Create an Application @@ -223,13 +210,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.ApplicationsApi(jcapiv1.ApiClient(configuration)) body = jcapiv1.Application() # Application | (optional) -content_type = 'content_type_example' # str | (optional) -accept = 'accept_example' # str | (optional) x_org_id = 'x_org_id_example' # str | (optional) try: # Create an Application - api_response = api_instance.applications_post(body=body, content_type=content_type, accept=accept, x_org_id=x_org_id) + api_response = api_instance.applications_post(body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ApplicationsApi->applications_post: %s\n" % e) @@ -240,8 +225,6 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**Application**](Application.md)| | [optional] - **content_type** | **str**| | [optional] - **accept** | **str**| | [optional] **x_org_id** | **str**| | [optional] ### Return type @@ -260,11 +243,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **applications_put** -> Application applications_put(id, body=body, content_type=content_type, accept=accept, x_org_id=x_org_id) +> Application applications_put(id, body=body, x_org_id=x_org_id) Update an Application -The endpoint updates a SSO / SAML Application. +The endpoint updates a SSO / SAML Application. Any fields not provided will be reset or created with default values. ### Example ```python @@ -284,13 +267,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' api_instance = jcapiv1.ApplicationsApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | body = jcapiv1.Application() # Application | (optional) -content_type = 'content_type_example' # str | (optional) -accept = 'accept_example' # str | (optional) x_org_id = 'x_org_id_example' # str | (optional) try: # Update an Application - api_response = api_instance.applications_put(id, body=body, content_type=content_type, accept=accept, x_org_id=x_org_id) + api_response = api_instance.applications_put(id, body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ApplicationsApi->applications_put: %s\n" % e) @@ -302,8 +283,6 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | **body** | [**Application**](Application.md)| | [optional] - **content_type** | **str**| | [optional] - **accept** | **str**| | [optional] **x_org_id** | **str**| | [optional] ### Return type diff --git a/jcapiv1/docs/Applicationslist.md b/jcapiv1/docs/Applicationslist.md index 1caeecd..a7424bc 100644 --- a/jcapiv1/docs/Applicationslist.md +++ b/jcapiv1/docs/Applicationslist.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] **results** | [**list[Application]**](Application.md) | The list of applications. | [optional] **total_count** | **int** | The total number of applications. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Applicationtemplate.md b/jcapiv1/docs/Applicationtemplate.md index 87bf8fe..b65bd55 100644 --- a/jcapiv1/docs/Applicationtemplate.md +++ b/jcapiv1/docs/Applicationtemplate.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] +**active** | **bool** | | [optional] **beta** | **bool** | | [optional] **color** | **str** | | [optional] **config** | [**ApplicationConfig**](ApplicationConfig.md) | | [optional] @@ -11,10 +12,16 @@ Name | Type | Description | Notes **display_name** | **str** | | [optional] **is_configured** | **bool** | | [optional] **jit** | [**ApplicationtemplateJit**](ApplicationtemplateJit.md) | | [optional] +**keywords** | **list[str]** | | [optional] **learn_more** | **str** | | [optional] +**logo** | [**ApplicationtemplateLogo**](ApplicationtemplateLogo.md) | | [optional] **name** | **str** | | [optional] +**oidc** | [**ApplicationtemplateOidc**](ApplicationtemplateOidc.md) | | [optional] +**provision** | [**ApplicationtemplateProvision**](ApplicationtemplateProvision.md) | | [optional] +**sso** | [**Sso**](Sso.md) | | [optional] **sso_url** | **str** | | [optional] +**status** | **str** | | [optional] +**test** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/ApplicationtemplateJit.md b/jcapiv1/docs/ApplicationtemplateJit.md index 4e176aa..dcea943 100644 --- a/jcapiv1/docs/ApplicationtemplateJit.md +++ b/jcapiv1/docs/ApplicationtemplateJit.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Errorresponse.md b/jcapiv1/docs/ApplicationtemplateLogo.md similarity index 81% rename from jcapiv1/docs/Errorresponse.md rename to jcapiv1/docs/ApplicationtemplateLogo.md index cac8ad6..65eaf23 100644 --- a/jcapiv1/docs/Errorresponse.md +++ b/jcapiv1/docs/ApplicationtemplateLogo.md @@ -1,10 +1,9 @@ -# Errorresponse +# ApplicationtemplateLogo ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**message** | **str** | | [optional] +**url** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/ApplicationtemplateOidc.md b/jcapiv1/docs/ApplicationtemplateOidc.md new file mode 100644 index 0000000..3c95fe1 --- /dev/null +++ b/jcapiv1/docs/ApplicationtemplateOidc.md @@ -0,0 +1,12 @@ +# ApplicationtemplateOidc + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**grant_types** | **list[str]** | The grant types allowed. Currently only authorization_code is allowed. | [optional] +**redirect_uris** | **list[str]** | List of allowed redirectUris | [optional] +**sso_url** | **str** | The relying party url to trigger an oidc login. | [optional] +**token_endpoint_auth_method** | **str** | Method that the client uses to authenticate when requesting a token. If 'none', then the client must use PKCE. If 'client_secret_post', then the secret is passed in the post body when requesting the token. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/ApplicationtemplateProvision.md b/jcapiv1/docs/ApplicationtemplateProvision.md new file mode 100644 index 0000000..d7d68f5 --- /dev/null +++ b/jcapiv1/docs/ApplicationtemplateProvision.md @@ -0,0 +1,11 @@ +# ApplicationtemplateProvision + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**beta** | **bool** | | [optional] +**groups_supported** | **bool** | | [optional] +**type** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Applicationtemplateslist.md b/jcapiv1/docs/Applicationtemplateslist.md index 239f01d..e7a4c40 100644 --- a/jcapiv1/docs/Applicationtemplateslist.md +++ b/jcapiv1/docs/Applicationtemplateslist.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Command.md b/jcapiv1/docs/Command.md index 7071c56..682c173 100644 --- a/jcapiv1/docs/Command.md +++ b/jcapiv1/docs/Command.md @@ -5,20 +5,23 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **command** | **str** | The command to execute on the server. | **command_runners** | **list[str]** | An array of IDs of the Command Runner Users that can execute this command. | [optional] -**command_type** | **str** | The Command OS | [optional] +**command_type** | **str** | The Command OS | [default to 'linux'] **files** | **list[str]** | An array of file IDs to include with the command. | [optional] **launch_type** | **str** | How the command will execute. | [optional] **listens_to** | **str** | | [optional] -**name** | **str** | | [optional] +**name** | **str** | | **organization** | **str** | The ID of the organization. | [optional] **schedule** | **str** | A crontab that consists of: [ (seconds) (minutes) (hours) (days of month) (months) (weekdays) ] or [ immediate ]. If you send this as an empty string, it will run immediately. | [optional] **schedule_repeat_type** | **str** | When the command will repeat. | [optional] +**schedule_year** | **int** | The year that a scheduled command will launch in. | [optional] +**shell** | **str** | The shell used to run the command. | [optional] **sudo** | **bool** | | [optional] **systems** | **list[str]** | An array of system IDs to run the command on. Not available if you are using Groups. | [optional] +**template** | **str** | The template this command was created from | [optional] +**time_to_live_seconds** | **int** | Time in seconds a command can wait in the queue to be run before timing out | [optional] **timeout** | **str** | The time in seconds to allow the command to run for. | [optional] **trigger** | **str** | The name of the command trigger. | [optional] **user** | **str** | The ID of the system user to run the command as. This field is required when creating a command with a commandType of \"mac\" or \"linux\". | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/CommandResultsApi.md b/jcapiv1/docs/CommandResultsApi.md index 680d739..26560b3 100644 --- a/jcapiv1/docs/CommandResultsApi.md +++ b/jcapiv1/docs/CommandResultsApi.md @@ -8,13 +8,12 @@ Method | HTTP request | Description [**command_results_get**](CommandResultsApi.md#command_results_get) | **GET** /commandresults/{id} | List an individual Command result [**command_results_list**](CommandResultsApi.md#command_results_list) | **GET** /commandresults | List all Command Results - # **command_results_delete** -> Commandresult command_results_delete(id, content_type, accept, x_org_id=x_org_id) +> Commandresult command_results_delete(id, x_org_id=x_org_id) Delete a Command result -This endpoint deletes a specific command result. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ```` +This endpoint deletes a specific command result. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/commandresults/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ```` ### Example ```python @@ -33,13 +32,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.CommandResultsApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | (optional) try: # Delete a Command result - api_response = api_instance.command_results_delete(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.command_results_delete(id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling CommandResultsApi->command_results_delete: %s\n" % e) @@ -50,9 +47,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| | [optional] ### Return type @@ -64,13 +59,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **command_results_get** -> Commandresult command_results_get(id, content_type, accept, fields=fields, filter=filter, x_org_id=x_org_id) +> Commandresult command_results_get(id, fields=fields, filter=filter, x_org_id=x_org_id) List an individual Command result @@ -93,15 +88,13 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.CommandResultsApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) -filter = 'filter_example' # str | A filter to apply to the query. (optional) -x_org_id = '' # str | (optional) (default to ) +fields = 'fields_example' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) +x_org_id = 'x_org_id_example' # str | (optional) try: # List an individual Command result - api_response = api_instance.command_results_get(id, content_type, accept, fields=fields, filter=filter, x_org_id=x_org_id) + api_response = api_instance.command_results_get(id, fields=fields, filter=filter, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling CommandResultsApi->command_results_get: %s\n" % e) @@ -112,11 +105,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] [default to ] - **filter** | **str**| A filter to apply to the query. | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] + **x_org_id** | **str**| | [optional] ### Return type @@ -128,13 +119,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **command_results_list** -> Commandresultslist command_results_list(content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) +> Commandresultslist command_results_list(fields=fields, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip, sort=sort) List all Command Results @@ -156,18 +147,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.CommandResultsApi(jcapiv1.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) +fields = 'fields_example' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = '' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) (default to ) -filter = 'filter_example' # str | A filter to apply to the query. (optional) -x_org_id = '' # str | (optional) (default to ) +sort = 'sort_example' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) try: # List all Command Results - api_response = api_instance.command_results_list(content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) + api_response = api_instance.command_results_list(fields=fields, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip, sort=sort) pprint(api_response) except ApiException as e: print("Exception when calling CommandResultsApi->command_results_list: %s\n" % e) @@ -177,14 +166,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] [default to ] + **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | **str**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [optional] [default to ] - **filter** | **str**| A filter to apply to the query. | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | **str**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [optional] ### Return type @@ -196,7 +183,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv1/docs/CommandTriggersApi.md b/jcapiv1/docs/CommandTriggersApi.md index ca93d00..2a0e200 100644 --- a/jcapiv1/docs/CommandTriggersApi.md +++ b/jcapiv1/docs/CommandTriggersApi.md @@ -6,9 +6,8 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**command_trigger_webhook_post**](CommandTriggersApi.md#command_trigger_webhook_post) | **POST** /command/trigger/{triggername} | Launch a command via a Trigger - # **command_trigger_webhook_post** -> command_trigger_webhook_post(triggername, content_type, accept, x_org_id=x_org_id) +> Triggerreturn command_trigger_webhook_post(triggername, body=body, x_org_id=x_org_id) Launch a command via a Trigger @@ -31,13 +30,13 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.CommandTriggersApi(jcapiv1.ApiClient(configuration)) triggername = 'triggername_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +body = NULL # object | (optional) +x_org_id = 'x_org_id_example' # str | (optional) try: # Launch a command via a Trigger - api_instance.command_trigger_webhook_post(triggername, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.command_trigger_webhook_post(triggername, body=body, x_org_id=x_org_id) + pprint(api_response) except ApiException as e: print("Exception when calling CommandTriggersApi->command_trigger_webhook_post: %s\n" % e) ``` @@ -47,13 +46,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **triggername** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**object**](object.md)| | [optional] + **x_org_id** | **str**| | [optional] ### Return type -void (empty response body) +[**Triggerreturn**](Triggerreturn.md) ### Authorization diff --git a/jcapiv1/docs/Commandfilereturn.md b/jcapiv1/docs/Commandfilereturn.md index 89257e8..488fb63 100644 --- a/jcapiv1/docs/Commandfilereturn.md +++ b/jcapiv1/docs/Commandfilereturn.md @@ -3,9 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**results** | [**CommandfilereturnResults**](CommandfilereturnResults.md) | | [optional] +**results** | [**list[CommandfilereturnResults]**](CommandfilereturnResults.md) | | [optional] **total_count** | **int** | The total number of commands files | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/CommandfilereturnResults.md b/jcapiv1/docs/CommandfilereturnResults.md index f323a3d..ffee5b9 100644 --- a/jcapiv1/docs/CommandfilereturnResults.md +++ b/jcapiv1/docs/CommandfilereturnResults.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Commandresult.md b/jcapiv1/docs/Commandresult.md index e82f387..a6aab36 100644 --- a/jcapiv1/docs/Commandresult.md +++ b/jcapiv1/docs/Commandresult.md @@ -8,9 +8,9 @@ Name | Type | Description | Notes **files** | **list[str]** | An array of file ids that were included in the command | [optional] **name** | **str** | The name of the command. | [optional] **organization** | **str** | The ID of the organization. | [optional] -**request_time** | **str** | The time that the command was sent. | [optional] +**request_time** | **datetime** | The time that the command was sent. | [optional] **response** | [**CommandresultResponse**](CommandresultResponse.md) | | [optional] -**response_time** | **str** | The time that the command was completed. | [optional] +**response_time** | **datetime** | The time that the command was completed. | [optional] **sudo** | **bool** | If the user had sudo rights | [optional] **system** | **str** | The name of the system the command was executed on. | [optional] **system_id** | **str** | The id of the system the command was executed on. | [optional] @@ -20,4 +20,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/CommandresultResponse.md b/jcapiv1/docs/CommandresultResponse.md index 36f7bf1..09484b7 100644 --- a/jcapiv1/docs/CommandresultResponse.md +++ b/jcapiv1/docs/CommandresultResponse.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/CommandresultResponseData.md b/jcapiv1/docs/CommandresultResponseData.md index ef3b960..d2915fb 100644 --- a/jcapiv1/docs/CommandresultResponseData.md +++ b/jcapiv1/docs/CommandresultResponseData.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Commandresultslist.md b/jcapiv1/docs/Commandresultslist.md index a997afc..c782ec8 100644 --- a/jcapiv1/docs/Commandresultslist.md +++ b/jcapiv1/docs/Commandresultslist.md @@ -3,9 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**results** | [**list[Commandresult]**](Commandresult.md) | The list of command results | [optional] -**total_count** | **int** | The total number of command results | [optional] +**results** | [**list[CommandresultslistResults]**](CommandresultslistResults.md) | | [optional] +**total_count** | **int** | The total number of command results. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/CommandresultslistResults.md b/jcapiv1/docs/CommandresultslistResults.md new file mode 100644 index 0000000..a0fd79d --- /dev/null +++ b/jcapiv1/docs/CommandresultslistResults.md @@ -0,0 +1,19 @@ +# CommandresultslistResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The ID of the command result. | [optional] +**command** | **str** | The command that was executed on the system. | [optional] +**exit_code** | **int** | The stderr output from the command that ran. | [optional] +**name** | **str** | The name of the command. | [optional] +**request_time** | **datetime** | The time (UTC) that the command was sent. | [optional] +**response_time** | **datetime** | The time (UTC) that the command was completed. | [optional] +**sudo** | **bool** | If the user had sudo rights. | [optional] +**system** | **str** | The display name of the system the command was executed on. | [optional] +**system_id** | **str** | The id of the system the command was executed on. | [optional] +**user** | **str** | The user the command ran as. | [optional] +**workflow_id** | **str** | The id for the command that ran on the system. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/CommandsApi.md b/jcapiv1/docs/CommandsApi.md index 04adb4c..8070a81 100644 --- a/jcapiv1/docs/CommandsApi.md +++ b/jcapiv1/docs/CommandsApi.md @@ -7,13 +7,13 @@ Method | HTTP request | Description [**command_file_get**](CommandsApi.md#command_file_get) | **GET** /files/command/{id} | Get a Command File [**commands_delete**](CommandsApi.md#commands_delete) | **DELETE** /commands/{id} | Delete a Command [**commands_get**](CommandsApi.md#commands_get) | **GET** /commands/{id} | List an individual Command +[**commands_get_results**](CommandsApi.md#commands_get_results) | **GET** /commands/{id}/results | Get results for a specific command [**commands_list**](CommandsApi.md#commands_list) | **GET** /commands | List All Commands [**commands_post**](CommandsApi.md#commands_post) | **POST** /commands | Create A Command [**commands_put**](CommandsApi.md#commands_put) | **PUT** /commands/{id} | Update a Command - # **command_file_get** -> Commandfilereturn command_file_get(id, content_type, accept, fields=fields, limit=limit, skip=skip, x_org_id=x_org_id) +> Commandfilereturn command_file_get(id, fields=fields, limit=limit, x_org_id=x_org_id, skip=skip) Get a Command File @@ -36,16 +36,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.CommandsApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) +fields = 'fields_example' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) try: # Get a Command File - api_response = api_instance.command_file_get(id, content_type, accept, fields=fields, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.command_file_get(id, fields=fields, limit=limit, x_org_id=x_org_id, skip=skip) pprint(api_response) except ApiException as e: print("Exception when calling CommandsApi->command_file_get: %s\n" % e) @@ -56,12 +54,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] [default to ] + **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] ### Return type @@ -73,13 +69,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **commands_delete** -> commands_delete(id, content_type, accept, x_org_id=x_org_id) +> Command commands_delete(id, x_org_id=x_org_id) Delete a Command @@ -102,13 +98,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.CommandsApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | (optional) try: # Delete a Command - api_instance.commands_delete(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.commands_delete(id, x_org_id=x_org_id) + pprint(api_response) except ApiException as e: print("Exception when calling CommandsApi->commands_delete: %s\n" % e) ``` @@ -118,13 +113,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| | [optional] ### Return type -void (empty response body) +[**Command**](Command.md) ### Authorization @@ -132,13 +125,13 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **commands_get** -> Command commands_get(id, content_type, accept, fields=fields, filter=filter, x_org_id=x_org_id) +> Command commands_get(id, fields=fields, x_org_id=x_org_id) List an individual Command @@ -161,15 +154,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.CommandsApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) -filter = 'filter_example' # str | A filter to apply to the query. (optional) -x_org_id = '' # str | (optional) (default to ) +fields = 'fields_example' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) +x_org_id = 'x_org_id_example' # str | (optional) try: # List an individual Command - api_response = api_instance.commands_get(id, content_type, accept, fields=fields, filter=filter, x_org_id=x_org_id) + api_response = api_instance.commands_get(id, fields=fields, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling CommandsApi->commands_get: %s\n" % e) @@ -180,11 +170,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] [default to ] - **filter** | **str**| A filter to apply to the query. | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] + **x_org_id** | **str**| | [optional] ### Return type @@ -196,13 +183,67 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **commands_get_results** +> list[Commandresult] commands_get_results(id) + +Get results for a specific command + +This endpoint returns results for a specific command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/{id}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ```` + +### Example +```python +from __future__ import print_function +import time +import jcapiv1 +from jcapiv1.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.CommandsApi(jcapiv1.ApiClient(configuration)) +id = 'id_example' # str | + +try: + # Get results for a specific command + api_response = api_instance.commands_get_results(id) + pprint(api_response) +except ApiException as e: + print("Exception when calling CommandsApi->commands_get_results: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + +### Return type + +[**list[Commandresult]**](Commandresult.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **commands_list** -> Commandslist commands_list(content_type, accept, skip=skip, fields=fields, limit=limit, sort=sort, filter=filter, x_org_id=x_org_id) +> Commandslist commands_list(fields=fields, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip, sort=sort) List All Commands @@ -224,18 +265,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.CommandsApi(jcapiv1.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -skip = 0 # int | The offset into the records to return. (optional) (default to 0) -fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) +fields = 'fields_example' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -sort = '' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) (default to ) -filter = 'filter_example' # str | A filter to apply to the query. (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = 'sort_example' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) try: # List All Commands - api_response = api_instance.commands_list(content_type, accept, skip=skip, fields=fields, limit=limit, sort=sort, filter=filter, x_org_id=x_org_id) + api_response = api_instance.commands_list(fields=fields, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip, sort=sort) pprint(api_response) except ApiException as e: print("Exception when calling CommandsApi->commands_list: %s\n" % e) @@ -245,14 +284,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] [default to ] + **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **sort** | **str**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [optional] [default to ] - **filter** | **str**| A filter to apply to the query. | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | **str**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [optional] ### Return type @@ -264,13 +301,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **commands_post** -> Command commands_post(content_type, accept, body=body, x_org_id=x_org_id) +> Command commands_post(body=body, x_org_id=x_org_id) Create A Command @@ -292,14 +329,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.CommandsApi(jcapiv1.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv1.Command() # Command | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | (optional) try: # Create A Command - api_response = api_instance.commands_post(content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.commands_post(body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling CommandsApi->commands_post: %s\n" % e) @@ -309,10 +344,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**Command**](Command.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| | [optional] ### Return type @@ -330,7 +363,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **commands_put** -> Command commands_put(id, content_type, accept, body=body, x_org_id=x_org_id) +> Command commands_put(id, body=body, x_org_id=x_org_id) Update a Command @@ -353,14 +386,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.CommandsApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv1.Command() # Command | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | (optional) try: # Update a Command - api_response = api_instance.commands_put(id, content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.commands_put(id, body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling CommandsApi->commands_put: %s\n" % e) @@ -371,10 +402,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**Command**](Command.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| | [optional] ### Return type diff --git a/jcapiv1/docs/Commandslist.md b/jcapiv1/docs/Commandslist.md index a4299f6..317f685 100644 --- a/jcapiv1/docs/Commandslist.md +++ b/jcapiv1/docs/Commandslist.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/CommandslistResults.md b/jcapiv1/docs/CommandslistResults.md index e07088f..29ccbb3 100644 --- a/jcapiv1/docs/CommandslistResults.md +++ b/jcapiv1/docs/CommandslistResults.md @@ -16,4 +16,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Error.md b/jcapiv1/docs/Error.md new file mode 100644 index 0000000..3570117 --- /dev/null +++ b/jcapiv1/docs/Error.md @@ -0,0 +1,11 @@ +# Error + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | HTTP status code | [optional] +**message** | **str** | Error message | [optional] +**status** | **str** | HTTP status description | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/ErrorDetails.md b/jcapiv1/docs/ErrorDetails.md new file mode 100644 index 0000000..48d2abd --- /dev/null +++ b/jcapiv1/docs/ErrorDetails.md @@ -0,0 +1,9 @@ +# ErrorDetails + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**details** | **list[object]** | Describes a list of objects with more detailed information of the given error. Each detail schema is according to one of the messages defined in Google's API: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto\" | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Fde.md b/jcapiv1/docs/Fde.md index ca55ef5..510b8b0 100644 --- a/jcapiv1/docs/Fde.md +++ b/jcapiv1/docs/Fde.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/Mfa.md b/jcapiv1/docs/IdResetmfaBody.md similarity index 84% rename from jcapiv2/docs/Mfa.md rename to jcapiv1/docs/IdResetmfaBody.md index 289a503..95239e2 100644 --- a/jcapiv2/docs/Mfa.md +++ b/jcapiv1/docs/IdResetmfaBody.md @@ -1,12 +1,11 @@ -# Mfa +# IdResetmfaBody ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**configured** | **bool** | | [optional] **exclusion** | **bool** | | [optional] +**exclusion_days** | **float** | | [optional] **exclusion_until** | **datetime** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/ManagedServiceProviderApi.md b/jcapiv1/docs/ManagedServiceProviderApi.md new file mode 100644 index 0000000..7531350 --- /dev/null +++ b/jcapiv1/docs/ManagedServiceProviderApi.md @@ -0,0 +1,239 @@ +# jcapiv1.ManagedServiceProviderApi + +All URIs are relative to *https://console.jumpcloud.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**admin_totpreset_begin**](ManagedServiceProviderApi.md#admin_totpreset_begin) | **POST** /users/resettotp/{id} | Administrator TOTP Reset Initiation +[**organization_list**](ManagedServiceProviderApi.md#organization_list) | **GET** /organizations | Get Organization Details +[**users_put**](ManagedServiceProviderApi.md#users_put) | **PUT** /users/{id} | Update a user +[**users_reactivate_get**](ManagedServiceProviderApi.md#users_reactivate_get) | **GET** /users/reactivate/{id} | Administrator Password Reset Initiation + +# **admin_totpreset_begin** +> admin_totpreset_begin(id) + +Administrator TOTP Reset Initiation + +This endpoint initiates a TOTP reset for an admin. This request does not accept a body. + +### Example +```python +from __future__ import print_function +import time +import jcapiv1 +from jcapiv1.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.ManagedServiceProviderApi(jcapiv1.ApiClient(configuration)) +id = 'id_example' # str | + +try: + # Administrator TOTP Reset Initiation + api_instance.admin_totpreset_begin(id) +except ApiException as e: + print("Exception when calling ManagedServiceProviderApi->admin_totpreset_begin: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **organization_list** +> Organizationslist organization_list(fields=fields, filter=filter, limit=limit, search=search, skip=skip, sort=sort) + +Get Organization Details + +This endpoint returns Organization Details. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv1 +from jcapiv1.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.ManagedServiceProviderApi(jcapiv1.ApiClient(configuration)) +fields = 'fields_example' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +search = 'search_example' # str | A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = 'sort_example' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) + +try: + # Get Organization Details + api_response = api_instance.organization_list(fields=fields, filter=filter, limit=limit, search=search, skip=skip, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling ManagedServiceProviderApi->organization_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **search** | **str**| A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | **str**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [optional] + +### Return type + +[**Organizationslist**](Organizationslist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **users_put** +> Userreturn users_put(id, body=body, x_org_id=x_org_id) + +Update a user + +This endpoint allows you to update a user. + +### Example +```python +from __future__ import print_function +import time +import jcapiv1 +from jcapiv1.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.ManagedServiceProviderApi(jcapiv1.ApiClient(configuration)) +id = 'id_example' # str | +body = jcapiv1.Userput() # Userput | (optional) +x_org_id = 'x_org_id_example' # str | (optional) + +try: + # Update a user + api_response = api_instance.users_put(id, body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ManagedServiceProviderApi->users_put: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **body** | [**Userput**](Userput.md)| | [optional] + **x_org_id** | **str**| | [optional] + +### Return type + +[**Userreturn**](Userreturn.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **users_reactivate_get** +> users_reactivate_get(id) + +Administrator Password Reset Initiation + +This endpoint triggers the sending of a reactivation e-mail to an administrator. + +### Example +```python +from __future__ import print_function +import time +import jcapiv1 +from jcapiv1.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.ManagedServiceProviderApi(jcapiv1.ApiClient(configuration)) +id = 'id_example' # str | + +try: + # Administrator Password Reset Initiation + api_instance.users_reactivate_get(id) +except ApiException as e: + print("Exception when calling ManagedServiceProviderApi->users_reactivate_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Mfa.md b/jcapiv1/docs/Mfa.md index 289a503..00b191f 100644 --- a/jcapiv1/docs/Mfa.md +++ b/jcapiv1/docs/Mfa.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **configured** | **bool** | | [optional] **exclusion** | **bool** | | [optional] +**exclusion_days** | **int** | | [optional] **exclusion_until** | **datetime** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/MfaEnrollment.md b/jcapiv1/docs/MfaEnrollment.md new file mode 100644 index 0000000..86e9cc5 --- /dev/null +++ b/jcapiv1/docs/MfaEnrollment.md @@ -0,0 +1,12 @@ +# MfaEnrollment + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**overall_status** | [**MfaEnrollmentStatus**](MfaEnrollmentStatus.md) | | [optional] +**push_status** | [**MfaEnrollmentStatus**](MfaEnrollmentStatus.md) | | [optional] +**totp_status** | [**MfaEnrollmentStatus**](MfaEnrollmentStatus.md) | | [optional] +**web_authn_status** | [**MfaEnrollmentStatus**](MfaEnrollmentStatus.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SalesforceKnowledgeListOutput.md b/jcapiv1/docs/MfaEnrollmentStatus.md similarity index 89% rename from jcapiv2/docs/SalesforceKnowledgeListOutput.md rename to jcapiv1/docs/MfaEnrollmentStatus.md index cb6a426..9fb9c8a 100644 --- a/jcapiv2/docs/SalesforceKnowledgeListOutput.md +++ b/jcapiv1/docs/MfaEnrollmentStatus.md @@ -1,4 +1,4 @@ -# SalesforceKnowledgeListOutput +# MfaEnrollmentStatus ## Properties Name | Type | Description | Notes @@ -6,4 +6,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Organization.md b/jcapiv1/docs/Organization.md new file mode 100644 index 0000000..e34c802 --- /dev/null +++ b/jcapiv1/docs/Organization.md @@ -0,0 +1,21 @@ +# Organization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**accounts_receivable** | **str** | | [optional] +**created** | **str** | | [optional] +**display_name** | **str** | | [optional] +**entitlement** | [**Organizationentitlement**](Organizationentitlement.md) | | [optional] +**has_credit_card** | **bool** | | [optional] +**has_stripe_customer_id** | **bool** | | [optional] +**last_estimate_calculation_time_stamp** | **str** | | [optional] +**last_sfdc_sync_status** | **object** | | [optional] +**logo_url** | **str** | | [optional] +**provider** | **str** | | [optional] +**settings** | [**Organizationsettings**](Organizationsettings.md) | | [optional] +**total_billing_estimate** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Organizationentitlement.md b/jcapiv1/docs/Organizationentitlement.md new file mode 100644 index 0000000..2dec660 --- /dev/null +++ b/jcapiv1/docs/Organizationentitlement.md @@ -0,0 +1,12 @@ +# Organizationentitlement + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**billing_model** | **str** | | [optional] +**entitlement_products** | [**list[OrganizationentitlementEntitlementProducts]**](OrganizationentitlementEntitlementProducts.md) | | [optional] +**is_manually_billed** | **bool** | | [optional] +**price_per_user_sum** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationentitlementEntitlementProducts.md b/jcapiv1/docs/OrganizationentitlementEntitlementProducts.md new file mode 100644 index 0000000..242d0e9 --- /dev/null +++ b/jcapiv1/docs/OrganizationentitlementEntitlementProducts.md @@ -0,0 +1,16 @@ +# OrganizationentitlementEntitlementProducts + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**committed_users** | **int** | | [optional] +**contract_type** | **str** | | [optional] +**max_user_count** | **int** | | [optional] +**name** | **str** | | [optional] +**price_per_user** | **int** | | [optional] +**product_category** | **str** | | [optional] +**product_code** | **str** | | [optional] +**uncommitted_users** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsApi.md b/jcapiv1/docs/OrganizationsApi.md index c7aa226..d17eebb 100644 --- a/jcapiv1/docs/OrganizationsApi.md +++ b/jcapiv1/docs/OrganizationsApi.md @@ -5,10 +5,11 @@ All URIs are relative to *https://console.jumpcloud.com/api* Method | HTTP request | Description ------------- | ------------- | ------------- [**organization_list**](OrganizationsApi.md#organization_list) | **GET** /organizations | Get Organization Details - +[**organization_put**](OrganizationsApi.md#organization_put) | **PUT** /organizations/{id} | Update an Organization +[**organizations_get**](OrganizationsApi.md#organizations_get) | **GET** /organizations/{id} | Get an Organization # **organization_list** -> Organizationslist organization_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, search=search) +> Organizationslist organization_list(fields=fields, filter=filter, limit=limit, search=search, skip=skip, sort=sort) Get Organization Details @@ -30,18 +31,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.OrganizationsApi(jcapiv1.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) -filter = 'filter_example' # str | A filter to apply to the query. (optional) +fields = 'fields_example' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +search = 'search_example' # str | A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = '' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) (default to ) -search = 'search_example' # str | A nested object containing a string `searchTerm` and a list of `fields` to search on. (optional) +sort = 'sort_example' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) try: # Get Organization Details - api_response = api_instance.organization_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, search=search) + api_response = api_instance.organization_list(fields=fields, filter=filter, limit=limit, search=search, skip=skip, sort=sort) pprint(api_response) except ApiException as e: print("Exception when calling OrganizationsApi->organization_list: %s\n" % e) @@ -51,14 +50,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] [default to ] - **filter** | **str**| A filter to apply to the query. | [optional] + **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **search** | **str**| A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | **str**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [optional] [default to ] - **search** | **str**| A nested object containing a string `searchTerm` and a list of `fields` to search on. | [optional] + **sort** | **str**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [optional] ### Return type @@ -68,6 +65,62 @@ Name | Type | Description | Notes [x-api-key](../README.md#x-api-key) +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **organization_put** +> Organization organization_put(id, body=body) + +Update an Organization + +This endpoint allows you to update an Organization. Note: `passwordPolicy` settings are only used when `passwordCompliance` is set to \"custom\". We discourage the use of non-custom passwordCompliance values. `hasStripeCustomerId` is deprecated and will be removed. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/organizations/{OrganizationID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"settings\": { \"contactName\": \"Admin Name\", \"contactEmail\": \"admin@company.com\", \"systemUsersCanEdit\":true, \"passwordPolicy\": { \"enableMaxHistory\": true, \"maxHistory\": 3 } } }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv1 +from jcapiv1.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.OrganizationsApi(jcapiv1.ApiClient(configuration)) +id = 'id_example' # str | +body = jcapiv1.OrganizationsIdBody() # OrganizationsIdBody | (optional) + +try: + # Update an Organization + api_response = api_instance.organization_put(id, body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling OrganizationsApi->organization_put: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **body** | [**OrganizationsIdBody**](OrganizationsIdBody.md)| | [optional] + +### Return type + +[**Organization**](Organization.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + ### HTTP request headers - **Content-Type**: application/json @@ -75,3 +128,61 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **organizations_get** +> Organization organizations_get(id, fields=fields, filter=filter) + +Get an Organization + +This endpoint returns a particular Organization. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/organizations/{OrganizationID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv1 +from jcapiv1.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.OrganizationsApi(jcapiv1.ApiClient(configuration)) +id = 'id_example' # str | +fields = 'fields_example' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) + +try: + # Get an Organization + api_response = api_instance.organizations_get(id, fields=fields, filter=filter) + pprint(api_response) +except ApiException as e: + print("Exception when calling OrganizationsApi->organizations_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] + +### Return type + +[**Organization**](Organization.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsIdBody.md b/jcapiv1/docs/OrganizationsIdBody.md new file mode 100644 index 0000000..788eb7d --- /dev/null +++ b/jcapiv1/docs/OrganizationsIdBody.md @@ -0,0 +1,9 @@ +# OrganizationsIdBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**settings** | [**Organizationsettingsput**](Organizationsettingsput.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Organizationsettings.md b/jcapiv1/docs/Organizationsettings.md new file mode 100644 index 0000000..540a395 --- /dev/null +++ b/jcapiv1/docs/Organizationsettings.md @@ -0,0 +1,38 @@ +# Organizationsettings + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_version** | **str** | | [optional] +**beta_features** | **object** | | [optional] +**contact_email** | **str** | | [optional] +**contact_name** | **str** | | [optional] +**device_identification_enabled** | **bool** | | [optional] +**disable_command_runner** | **bool** | | [optional] +**disable_google_login** | **bool** | | [optional] +**disable_ldap** | **bool** | | [optional] +**disable_um** | **bool** | | [optional] +**display_preferences** | [**OrganizationsettingsDisplayPreferences**](OrganizationsettingsDisplayPreferences.md) | | [optional] +**duplicate_ldap_groups** | **bool** | | [optional] +**email_disclaimer** | **str** | | [optional] +**enable_google_apps** | **bool** | | [optional] +**enable_managed_uid** | **bool** | | [optional] +**enable_o365** | **bool** | | [optional] +**enable_user_portal_agent_install** | **bool** | | [optional] +**features** | [**OrganizationsettingsFeatures**](OrganizationsettingsFeatures.md) | | [optional] +**growth_data** | **object** | Object containing Optimizely experimentIds and states corresponding to them | [optional] +**logo** | **str** | | [optional] +**name** | **str** | | [optional] +**new_system_user_state_defaults** | [**OrganizationsettingsNewSystemUserStateDefaults**](OrganizationsettingsNewSystemUserStateDefaults.md) | | [optional] +**password_compliance** | **str** | | [optional] +**password_policy** | [**OrganizationsettingsPasswordPolicy**](OrganizationsettingsPasswordPolicy.md) | | [optional] +**pending_delete** | **bool** | | [optional] +**show_intro** | **bool** | | [optional] +**system_user_password_expiration_in_days** | **int** | | [optional] +**system_users_can_edit** | **bool** | | [optional] +**system_users_cap** | **int** | | [optional] +**trusted_app_config** | [**TrustedappConfigGet**](TrustedappConfigGet.md) | | [optional] +**user_portal** | [**OrganizationsettingsUserPortal**](OrganizationsettingsUserPortal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsDisplayPreferences.md b/jcapiv1/docs/OrganizationsettingsDisplayPreferences.md new file mode 100644 index 0000000..d765094 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsDisplayPreferences.md @@ -0,0 +1,9 @@ +# OrganizationsettingsDisplayPreferences + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**org_insights** | [**OrganizationsettingsDisplayPreferencesOrgInsights**](OrganizationsettingsDisplayPreferencesOrgInsights.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsights.md b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsights.md new file mode 100644 index 0000000..eeffb47 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsights.md @@ -0,0 +1,27 @@ +# OrganizationsettingsDisplayPreferencesOrgInsights + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**applications_usage** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**console_stats** | [**OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats**](OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats.md) | | [optional] +**device_notifications** | [**OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications**](OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications.md) | | [optional] +**disk_encryption** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**expired_passwords** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**failed_commands** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**failed_configurations** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**fundamentals** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**jc_university** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**learning_center** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**mdm_certificate_expirations** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**mfa_enrolled_devices** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**new_os_releases** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**new_users** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**office_hours** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**pending_commands** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**upcoming_password_expiration** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**user_lockouts** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**user_notifications** | [**OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications**](OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md new file mode 100644 index 0000000..e3c19eb --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md @@ -0,0 +1,9 @@ +# OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**visible** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats.md b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats.md new file mode 100644 index 0000000..8d2a81d --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats.md @@ -0,0 +1,13 @@ +# OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total_applications** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**total_configurations** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**total_devices** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**total_groups** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**total_users** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications.md b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications.md new file mode 100644 index 0000000..944ce14 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications.md @@ -0,0 +1,14 @@ +# OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_out_of_date_metric** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**inactive_metric** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**uptime_metric** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**visible** | **bool** | | [optional] +**without_policies_metric** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**without_users_metric** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications.md b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications.md new file mode 100644 index 0000000..2844d1a --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications.md @@ -0,0 +1,14 @@ +# OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_with_admin_sudo_passwordless_access** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**users_with_admin_sudo_access** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**users_with_samba_access** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**users_without_devices** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**users_without_password** | [**OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) | | [optional] +**visible** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsFeatures.md b/jcapiv1/docs/OrganizationsettingsFeatures.md new file mode 100644 index 0000000..25674bd --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsFeatures.md @@ -0,0 +1,11 @@ +# OrganizationsettingsFeatures + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**directory_insights** | [**OrganizationsettingsFeaturesDirectoryInsights**](OrganizationsettingsFeaturesDirectoryInsights.md) | | [optional] +**directory_insights_premium** | [**OrganizationsettingsFeaturesDirectoryInsightsPremium**](OrganizationsettingsFeaturesDirectoryInsightsPremium.md) | | [optional] +**system_insights** | [**OrganizationsettingsFeaturesSystemInsights**](OrganizationsettingsFeaturesSystemInsights.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemGraphManagementReqAttributesSudo.md b/jcapiv1/docs/OrganizationsettingsFeaturesDirectoryInsights.md similarity index 77% rename from jcapiv2/docs/SystemGraphManagementReqAttributesSudo.md rename to jcapiv1/docs/OrganizationsettingsFeaturesDirectoryInsights.md index 46c7cf6..267ec7f 100644 --- a/jcapiv2/docs/SystemGraphManagementReqAttributesSudo.md +++ b/jcapiv1/docs/OrganizationsettingsFeaturesDirectoryInsights.md @@ -1,11 +1,9 @@ -# SystemGraphManagementReqAttributesSudo +# OrganizationsettingsFeaturesDirectoryInsights ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enabled** | **bool** | | [optional] -**without_password** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/OrganizationsettingsFeaturesDirectoryInsightsPremium.md b/jcapiv1/docs/OrganizationsettingsFeaturesDirectoryInsightsPremium.md new file mode 100644 index 0000000..f7f0fc2 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsFeaturesDirectoryInsightsPremium.md @@ -0,0 +1,11 @@ +# OrganizationsettingsFeaturesDirectoryInsightsPremium + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **str** | | [optional] +**enabled** | **bool** | | [optional] +**updated_at** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsFeaturesSystemInsights.md b/jcapiv1/docs/OrganizationsettingsFeaturesSystemInsights.md new file mode 100644 index 0000000..ab16b10 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsFeaturesSystemInsights.md @@ -0,0 +1,14 @@ +# OrganizationsettingsFeaturesSystemInsights + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **str** | | [optional] +**enable_new_darwin** | **bool** | | [optional] +**enable_new_linux** | **bool** | | [optional] +**enable_new_windows** | **bool** | | [optional] +**enabled** | **bool** | | [optional] +**updated_at** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsNewSystemUserStateDefaults.md b/jcapiv1/docs/OrganizationsettingsNewSystemUserStateDefaults.md new file mode 100644 index 0000000..7d19859 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsNewSystemUserStateDefaults.md @@ -0,0 +1,11 @@ +# OrganizationsettingsNewSystemUserStateDefaults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**application_import** | **str** | The default user state for a user created using the [Bulk Users Create](https://docs.jumpcloud.com/api/2.0/index.html#operation/bulk_usersCreate) endpoint. See endpoint documentation for more details. | [optional] +**csv_import** | **str** | The default user state for a user created using the [Bulk Users Create](https://docs.jumpcloud.com/api/2.0/index.html#operation/bulk_usersCreate) endpoint. See endpoint documentation for more details. | [optional] +**manual_entry** | **str** | The default state for a user that is created using the [Create a system user](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_post) endpoint. See endpoint documentation for more details. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsPasswordPolicy.md b/jcapiv1/docs/OrganizationsettingsPasswordPolicy.md new file mode 100644 index 0000000..248c9a9 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsPasswordPolicy.md @@ -0,0 +1,34 @@ +# OrganizationsettingsPasswordPolicy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allow_username_substring** | **bool** | | [optional] +**days_after_expiration_to_self_recover** | **int** | Deprecated field used for the legacy grace period feature. | [optional] +**days_before_expiration_to_force_reset** | **int** | | [optional] +**effective_date** | **str** | | [optional] +**enable_days_after_expiration_to_self_recover** | **bool** | | [optional] +**enable_days_before_expiration_to_force_reset** | **bool** | | [optional] +**enable_lockout_time_in_seconds** | **bool** | | [optional] +**enable_max_history** | **bool** | | [optional] +**enable_max_login_attempts** | **bool** | | [optional] +**enable_min_change_period_in_days** | **bool** | | [optional] +**enable_min_length** | **bool** | | [optional] +**enable_password_expiration_in_days** | **bool** | | [optional] +**enable_recovery_email** | **bool** | | [optional] +**enable_reset_lockout_counter** | **bool** | | [optional] +**grace_period_date** | **str** | | [optional] +**lockout_time_in_seconds** | **int** | | [optional] +**max_history** | **int** | | [optional] +**max_login_attempts** | **int** | | [optional] +**min_change_period_in_days** | **int** | | [optional] +**min_length** | **int** | | [optional] +**needs_lowercase** | **bool** | | [optional] +**needs_numeric** | **bool** | | [optional] +**needs_symbolic** | **bool** | | [optional] +**needs_uppercase** | **bool** | | [optional] +**password_expiration_in_days** | **int** | | [optional] +**reset_lockout_counter_minutes** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsUserPortal.md b/jcapiv1/docs/OrganizationsettingsUserPortal.md new file mode 100644 index 0000000..45ce29d --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsUserPortal.md @@ -0,0 +1,9 @@ +# OrganizationsettingsUserPortal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**idle_session_duration_minutes** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Organizationsettingsput.md b/jcapiv1/docs/Organizationsettingsput.md new file mode 100644 index 0000000..29f3595 --- /dev/null +++ b/jcapiv1/docs/Organizationsettingsput.md @@ -0,0 +1,30 @@ +# Organizationsettingsput + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contact_email** | **str** | | [optional] +**contact_name** | **str** | | [optional] +**device_identification_enabled** | **bool** | | [optional] +**disable_google_login** | **bool** | | [optional] +**disable_ldap** | **bool** | | [optional] +**disable_um** | **bool** | | [optional] +**duplicate_ldap_groups** | **bool** | | [optional] +**email_disclaimer** | **str** | | [optional] +**enable_managed_uid** | **bool** | | [optional] +**features** | [**OrganizationsettingsFeatures**](OrganizationsettingsFeatures.md) | | [optional] +**growth_data** | **object** | Object containing Optimizely experimentIds and states corresponding to them | [optional] +**logo** | **str** | | [optional] +**name** | **str** | | [optional] +**new_system_user_state_defaults** | [**OrganizationsettingsputNewSystemUserStateDefaults**](OrganizationsettingsputNewSystemUserStateDefaults.md) | | [optional] +**password_compliance** | **str** | | [optional] +**password_policy** | [**OrganizationsettingsputPasswordPolicy**](OrganizationsettingsputPasswordPolicy.md) | | [optional] +**show_intro** | **bool** | | [optional] +**system_user_password_expiration_in_days** | **int** | | [optional] +**system_users_can_edit** | **bool** | | [optional] +**system_users_cap** | **int** | | [optional] +**trusted_app_config** | [**TrustedappConfigPut**](TrustedappConfigPut.md) | | [optional] +**user_portal** | [**OrganizationsettingsUserPortal**](OrganizationsettingsUserPortal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsputNewSystemUserStateDefaults.md b/jcapiv1/docs/OrganizationsettingsputNewSystemUserStateDefaults.md new file mode 100644 index 0000000..75462c0 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsputNewSystemUserStateDefaults.md @@ -0,0 +1,11 @@ +# OrganizationsettingsputNewSystemUserStateDefaults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**application_import** | **str** | | [optional] +**csv_import** | **str** | | [optional] +**manual_entry** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsputPasswordPolicy.md b/jcapiv1/docs/OrganizationsettingsputPasswordPolicy.md new file mode 100644 index 0000000..86625b0 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsputPasswordPolicy.md @@ -0,0 +1,31 @@ +# OrganizationsettingsputPasswordPolicy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allow_username_substring** | **bool** | | [optional] +**days_after_expiration_to_self_recover** | **int** | Deprecated field used for the legacy grace period feature. | [optional] +**days_before_expiration_to_force_reset** | **int** | | [optional] +**effective_date** | **str** | | [optional] +**enable_days_after_expiration_to_self_recover** | **bool** | | [optional] +**enable_days_before_expiration_to_force_reset** | **bool** | | [optional] +**enable_lockout_time_in_seconds** | **bool** | | [optional] +**enable_max_history** | **bool** | | [optional] +**enable_max_login_attempts** | **bool** | | [optional] +**enable_min_change_period_in_days** | **bool** | | [optional] +**enable_min_length** | **bool** | | [optional] +**enable_password_expiration_in_days** | **bool** | | [optional] +**grace_period_date** | **str** | | [optional] +**lockout_time_in_seconds** | **int** | | [optional] +**max_history** | **int** | | [optional] +**max_login_attempts** | **int** | | [optional] +**min_change_period_in_days** | **int** | | [optional] +**min_length** | **int** | | [optional] +**needs_lowercase** | **bool** | | [optional] +**needs_numeric** | **bool** | | [optional] +**needs_symbolic** | **bool** | | [optional] +**needs_uppercase** | **bool** | | [optional] +**password_expiration_in_days** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Organizationslist.md b/jcapiv1/docs/Organizationslist.md index 95a27f4..bb231b9 100644 --- a/jcapiv1/docs/Organizationslist.md +++ b/jcapiv1/docs/Organizationslist.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/OrganizationslistResults.md b/jcapiv1/docs/OrganizationslistResults.md index bb3e500..e0d3057 100644 --- a/jcapiv1/docs/OrganizationslistResults.md +++ b/jcapiv1/docs/OrganizationslistResults.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/RadiusServersApi.md b/jcapiv1/docs/RadiusServersApi.md index 79ea96f..fa3ba3e 100644 --- a/jcapiv1/docs/RadiusServersApi.md +++ b/jcapiv1/docs/RadiusServersApi.md @@ -4,13 +4,126 @@ All URIs are relative to *https://console.jumpcloud.com/api* Method | HTTP request | Description ------------- | ------------- | ------------- +[**radius_servers_delete**](RadiusServersApi.md#radius_servers_delete) | **DELETE** /radiusservers/{id} | Delete Radius Server +[**radius_servers_get**](RadiusServersApi.md#radius_servers_get) | **GET** /radiusservers/{id} | Get Radius Server [**radius_servers_list**](RadiusServersApi.md#radius_servers_list) | **GET** /radiusservers | List Radius Servers [**radius_servers_post**](RadiusServersApi.md#radius_servers_post) | **POST** /radiusservers | Create a Radius Server [**radius_servers_put**](RadiusServersApi.md#radius_servers_put) | **PUT** /radiusservers/{id} | Update Radius Servers +# **radius_servers_delete** +> Radiusserverput radius_servers_delete(id, x_org_id=x_org_id) + +Delete Radius Server + +This endpoint allows you to delete RADIUS servers in your organization. ``` curl -X DELETE https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv1 +from jcapiv1.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.RadiusServersApi(jcapiv1.ApiClient(configuration)) +id = 'id_example' # str | +x_org_id = 'x_org_id_example' # str | (optional) + +try: + # Delete Radius Server + api_response = api_instance.radius_servers_delete(id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling RadiusServersApi->radius_servers_delete: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **x_org_id** | **str**| | [optional] + +### Return type + +[**Radiusserverput**](Radiusserverput.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **radius_servers_get** +> Radiusserver radius_servers_get(id, x_org_id=x_org_id) + +Get Radius Server + +This endpoint allows you to get a RADIUS server in your organization. #### ``` curl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv1 +from jcapiv1.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.RadiusServersApi(jcapiv1.ApiClient(configuration)) +id = 'id_example' # str | +x_org_id = 'x_org_id_example' # str | (optional) + +try: + # Get Radius Server + api_response = api_instance.radius_servers_get(id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling RadiusServersApi->radius_servers_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **x_org_id** | **str**| | [optional] + +### Return type + +[**Radiusserver**](Radiusserver.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **radius_servers_list** -> Radiusserverslist radius_servers_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +> Radiusserverslist radius_servers_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) List Radius Servers @@ -32,18 +145,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.RadiusServersApi(jcapiv1.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) -filter = 'filter_example' # str | A filter to apply to the query. (optional) +fields = 'fields_example' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = '' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) (default to ) -x_org_id = '' # str | (optional) (default to ) +sort = 'sort_example' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | (optional) try: # List Radius Servers - api_response = api_instance.radius_servers_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.radius_servers_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling RadiusServersApi->radius_servers_list: %s\n" % e) @@ -53,14 +164,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] [default to ] - **filter** | **str**| A filter to apply to the query. | [optional] + **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | **str**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [optional] [default to ] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | **str**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| | [optional] ### Return type @@ -72,13 +181,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **radius_servers_post** -> Radiusserver radius_servers_post(content_type, accept, body=body, x_org_id=x_org_id) +> Radiusserver radius_servers_post(body=body, x_org_id=x_org_id) Create a Radius Server @@ -100,14 +209,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.RadiusServersApi(jcapiv1.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv1.Radiusserverpost() # Radiusserverpost | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | (optional) try: # Create a Radius Server - api_response = api_instance.radius_servers_post(content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.radius_servers_post(body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling RadiusServersApi->radius_servers_post: %s\n" % e) @@ -117,10 +224,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**Radiusserverpost**](Radiusserverpost.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| | [optional] ### Return type @@ -138,11 +243,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **radius_servers_put** -> Radiusserverput radius_servers_put(id, content_type, accept, body=body, x_org_id=x_org_id) +> Radiusserverput radius_servers_put(id, body=body, x_org_id=x_org_id) Update Radius Servers -This endpoint allows you to update RADIUS servers in your organization. #### ``` curl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{name_update}\", \"networkSourceIp\": \"{0.0.0.0}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` +This endpoint allows you to update RADIUS servers in your organization. #### ``` curl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{name_update}\", \"networkSourceIp\": \"{0.0.0.0}\", \"sharedSecret\": \"{secret_password}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` ### Example ```python @@ -161,14 +266,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.RadiusServersApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv1.Body() # Body | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv1.RadiusserversIdBody() # RadiusserversIdBody | (optional) +x_org_id = 'x_org_id_example' # str | (optional) try: # Update Radius Servers - api_response = api_instance.radius_servers_put(id, content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.radius_servers_put(id, body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling RadiusServersApi->radius_servers_put: %s\n" % e) @@ -179,10 +282,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**Body**](Body.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**RadiusserversIdBody**](RadiusserversIdBody.md)| | [optional] + **x_org_id** | **str**| | [optional] ### Return type diff --git a/jcapiv1/docs/Radiusserver.md b/jcapiv1/docs/Radiusserver.md index a91db78..3078772 100644 --- a/jcapiv1/docs/Radiusserver.md +++ b/jcapiv1/docs/Radiusserver.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] +**auth_idp** | **str** | | [optional] +**device_cert_enabled** | **bool** | | [optional] **mfa** | **str** | | [optional] **name** | **str** | | [optional] **network_source_ip** | **str** | | [optional] @@ -11,9 +13,10 @@ Name | Type | Description | Notes **shared_secret** | **str** | | [optional] **tag_names** | **list[str]** | | [optional] **tags** | **list[str]** | | [optional] +**user_cert_enabled** | **bool** | | [optional] **user_lockout_action** | **str** | | [optional] +**user_password_enabled** | **bool** | | [optional] **user_password_expiration_action** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Radiusserverpost.md b/jcapiv1/docs/Radiusserverpost.md index 0976b02..2d76f76 100644 --- a/jcapiv1/docs/Radiusserverpost.md +++ b/jcapiv1/docs/Radiusserverpost.md @@ -3,14 +3,17 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**auth_idp** | **str** | | [optional] +**device_cert_enabled** | **bool** | | [optional] **mfa** | **str** | | [optional] **name** | **str** | | **network_source_ip** | **str** | | **shared_secret** | **str** | RADIUS shared secret between the server and client. | **tag_names** | **list[str]** | | [optional] +**user_cert_enabled** | **bool** | | [optional] **user_lockout_action** | **str** | | [optional] +**user_password_enabled** | **bool** | | [optional] **user_password_expiration_action** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Radiusserverput.md b/jcapiv1/docs/Radiusserverput.md index 1a84842..494f1c8 100644 --- a/jcapiv1/docs/Radiusserverput.md +++ b/jcapiv1/docs/Radiusserverput.md @@ -4,13 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] +**auth_idp** | **str** | | [optional] +**device_cert_enabled** | **bool** | | [optional] **mfa** | **str** | | [optional] **name** | **str** | | [optional] **network_source_ip** | **str** | | [optional] **tag_names** | **list[str]** | | [optional] +**user_cert_enabled** | **bool** | | [optional] **user_lockout_action** | **str** | | [optional] +**user_password_enabled** | **bool** | | [optional] **user_password_expiration_action** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/RadiusserversIdBody.md b/jcapiv1/docs/RadiusserversIdBody.md new file mode 100644 index 0000000..94db989 --- /dev/null +++ b/jcapiv1/docs/RadiusserversIdBody.md @@ -0,0 +1,18 @@ +# RadiusserversIdBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**device_cert_enabled** | **bool** | | [optional] +**mfa** | **str** | | [optional] +**name** | **str** | | +**network_source_ip** | **str** | | +**shared_secret** | **str** | | +**tags** | **list[str]** | | [optional] +**user_cert_enabled** | **bool** | | [optional] +**user_lockout_action** | **str** | | [optional] +**user_password_enabled** | **bool** | | [optional] +**user_password_expiration_action** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Radiusserverslist.md b/jcapiv1/docs/Radiusserverslist.md index 408865f..3785297 100644 --- a/jcapiv1/docs/Radiusserverslist.md +++ b/jcapiv1/docs/Radiusserverslist.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Search.md b/jcapiv1/docs/Search.md index 556069e..28d37d0 100644 --- a/jcapiv1/docs/Search.md +++ b/jcapiv1/docs/Search.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SearchApi.md b/jcapiv1/docs/SearchApi.md index 90eb432..8ead431 100644 --- a/jcapiv1/docs/SearchApi.md +++ b/jcapiv1/docs/SearchApi.md @@ -4,13 +4,142 @@ All URIs are relative to *https://console.jumpcloud.com/api* Method | HTTP request | Description ------------- | ------------- | ------------- +[**search_commandresults_post**](SearchApi.md#search_commandresults_post) | **POST** /search/commandresults | Search Commands Results +[**search_commands_post**](SearchApi.md#search_commands_post) | **POST** /search/commands | Search Commands [**search_organizations_post**](SearchApi.md#search_organizations_post) | **POST** /search/organizations | Search Organizations [**search_systems_post**](SearchApi.md#search_systems_post) | **POST** /search/systems | Search Systems [**search_systemusers_post**](SearchApi.md#search_systemusers_post) | **POST** /search/systemusers | Search System Users +# **search_commandresults_post** +> Commandresultslist search_commandresults_post(body=body, x_org_id=x_org_id, fields=fields, filter=filter, limit=limit, skip=skip) + +Search Commands Results + +Return Command Results in multi-record format allowing for the passing of the `filter` parameter. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/commandresults route. The `filter` parameter must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. #### Sample Request Exact search for a specific command result ``` curl -X POST https://console.jumpcloud.com/api/search/commandresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : \"workflowInstanceId:$eq:62f3c599ec4e928499069c7f\", \"fields\" : \"name workflowId sudo\" }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv1 +from jcapiv1.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.SearchApi(jcapiv1.ApiClient(configuration)) +body = jcapiv1.Search() # Search | (optional) +x_org_id = 'x_org_id_example' # str | (optional) +fields = 'fields_example' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) + +try: + # Search Commands Results + api_response = api_instance.search_commandresults_post(body=body, x_org_id=x_org_id, fields=fields, filter=filter, limit=limit, skip=skip) + pprint(api_response) +except ApiException as e: + print("Exception when calling SearchApi->search_commandresults_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Search**](Search.md)| | [optional] + **x_org_id** | **str**| | [optional] + **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + +### Return type + +[**Commandresultslist**](Commandresultslist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **search_commands_post** +> Commandslist search_commands_post(body=body, x_org_id=x_org_id, fields=fields, filter=filter, limit=limit, skip=skip) + +Search Commands + +Return Commands in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new command. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of commands in a launchType ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : [{\"launchType\" : \"repeated\"}], \"fields\" : \"name launchType sudo\" }' ``` Text search for commands with name ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": \"List\", \"fields\": [\"name\"] }, \"fields\" : \"name launchType sudo\" }' ``` Text search for multiple commands ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": [\"List\", \"Log\"], \"fields\": [\"name\"] }, \"fields\" : \"name launchType sudo\" }' ``` Combining `filter` and `searchFilter` to text search for commands with name who are in a list of launchType ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"List\", \"fields\": [\"name\"] }, \"filter\": { \"or\": [ {\"launchType\" : \"repeated\"}, {\"launchType\" : \"one-time\"} ] }, \"fields\" : \"name launchType sudo\" }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv1 +from jcapiv1.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.SearchApi(jcapiv1.ApiClient(configuration)) +body = jcapiv1.Search() # Search | (optional) +x_org_id = 'x_org_id_example' # str | (optional) +fields = 'fields_example' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) + +try: + # Search Commands + api_response = api_instance.search_commands_post(body=body, x_org_id=x_org_id, fields=fields, filter=filter, limit=limit, skip=skip) + pprint(api_response) +except ApiException as e: + print("Exception when calling SearchApi->search_commands_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Search**](Search.md)| | [optional] + **x_org_id** | **str**| | [optional] + **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + +### Return type + +[**Commandslist**](Commandslist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **search_organizations_post** -> Organizationslist search_organizations_post(content_type, accept, body=body, fields=fields, filter=filter, limit=limit, skip=skip) +> Organizationslist search_organizations_post(body=body, fields=fields, filter=filter, limit=limit, skip=skip) Search Organizations @@ -32,17 +161,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SearchApi(jcapiv1.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv1.Search() # Search | (optional) -fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) -filter = 'filter_example' # str | A filter to apply to the query. (optional) +fields = 'fields_example' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) try: # Search Organizations - api_response = api_instance.search_organizations_post(content_type, accept, body=body, fields=fields, filter=filter, limit=limit, skip=skip) + api_response = api_instance.search_organizations_post(body=body, fields=fields, filter=filter, limit=limit, skip=skip) pprint(api_response) except ApiException as e: print("Exception when calling SearchApi->search_organizations_post: %s\n" % e) @@ -52,11 +179,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**Search**](Search.md)| | [optional] - **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] [default to ] - **filter** | **str**| A filter to apply to the query. | [optional] + **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] @@ -76,11 +201,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **search_systems_post** -> Systemslist search_systems_post(content_type, accept, body=body, fields=fields, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> Systemslist search_systems_post(body=body, x_org_id=x_org_id, fields=fields, limit=limit, skip=skip, filter=filter) Search Systems -Return Systems in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the`searchTerm` the record will be returned. #### Sample Request Exact search for a list of hostnames ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\": { \"or\": [ {\"hostname\" : \"my-hostname\"}, {\"hostname\" : \"other-hostname\"} ] }, \"fields\" : \"os hostname displayName\" }' ``` Text search for a hostname or display name ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"fields\": \"os hostname displayName\" }' ``` Combining `filter` and `searchFilter` to search for names that match a given OS ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"filter\": { \"or\": [ {\"os\" : \"Ubuntu\"}, {\"os\" : \"Mac OS X\"} ] }, \"fields\": \"os hostname displayName\" }' ``` +Return Systems in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of hostnames ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\": { \"or\": [ {\"hostname\" : \"my-hostname\"}, {\"hostname\" : \"other-hostname\"} ] }, \"fields\" : \"os hostname displayName\" }' ``` Text search for a hostname or display name ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"fields\": \"os hostname displayName\" }' ``` Text search for a multiple hostnames. ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": [\"my-host\", \"my-other-host\"], \"fields\": [\"hostname\"] }, \"fields\": \"os hostname displayName\" }' ``` Combining `filter` and `searchFilter` to search for names that match a given OS ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"filter\": { \"or\": [ {\"os\" : \"Ubuntu\"}, {\"os\" : \"Mac OS X\"} ] }, \"fields\": \"os hostname displayName\" }' ``` ### Example ```python @@ -98,18 +223,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SearchApi(jcapiv1.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv1.Search() # Search | (optional) -fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) +x_org_id = 'x_org_id_example' # str | (optional) +fields = 'fields_example' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = 'filter_example' # str | A filter to apply to the query. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) try: # Search Systems - api_response = api_instance.search_systems_post(content_type, accept, body=body, fields=fields, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.search_systems_post(body=body, x_org_id=x_org_id, fields=fields, limit=limit, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling SearchApi->search_systems_post: %s\n" % e) @@ -119,14 +242,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**Search**](Search.md)| | [optional] - **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] [default to ] + **x_org_id** | **str**| | [optional] + **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | **str**| A filter to apply to the query. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] ### Return type @@ -144,11 +265,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **search_systemusers_post** -> Systemuserslist search_systemusers_post(content_type, accept, body=body, fields=fields, filter=filter, limit=limit, skip=skip, x_org_id=x_org_id) +> Systemuserslist search_systemusers_post(body=body, x_org_id=x_org_id, fields=fields, filter=filter, limit=limit, skip=skip) Search System Users -Return System Users in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system user. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the`searchTerm` the record will be returned. #### Sample Request Exact search for a list of system users in a department ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : [{\"department\" : \"IT\"}], \"fields\" : \"email username sudo\" }' ``` Text search for system users with and email on a domain ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"fields\" : \"email username sudo\" }' ``` Combining `filter` and `searchFilter` to text search for system users with and email on a domain who are in a list of departments ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"filter\": { \"or\": [ {\"department\" : \"IT\"}, {\"department\" : \"Sales\"} ] }, \"fields\" : \"email username sudo\" }' ``` +Return System Users in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system user. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of system users in a department ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : [{\"department\" : \"IT\"}], \"fields\" : \"email username sudo\" }' ``` Text search for system users with and email on a domain ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"fields\" : \"email username sudo\" }' ``` Text search for multiple system users ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": [\"john\", \"sarah\"], \"fields\": [\"username\"] }, \"fields\" : \"email username sudo\" }' ``` Combining `filter` and `searchFilter` to text search for system users with and email on a domain who are in a list of departments ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"filter\": { \"or\": [ {\"department\" : \"IT\"}, {\"department\" : \"Sales\"} ] }, \"fields\" : \"email username sudo\" }' ``` ### Example ```python @@ -166,18 +287,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SearchApi(jcapiv1.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv1.Search() # Search | (optional) -fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) -filter = 'filter_example' # str | A filter to apply to the query. (optional) +x_org_id = 'x_org_id_example' # str | (optional) +fields = 'fields_example' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) try: # Search System Users - api_response = api_instance.search_systemusers_post(content_type, accept, body=body, fields=fields, filter=filter, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.search_systemusers_post(body=body, x_org_id=x_org_id, fields=fields, filter=filter, limit=limit, skip=skip) pprint(api_response) except ApiException as e: print("Exception when calling SearchApi->search_systemusers_post: %s\n" % e) @@ -187,14 +306,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**Search**](Search.md)| | [optional] - **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] [default to ] - **filter** | **str**| A filter to apply to the query. | [optional] + **x_org_id** | **str**| | [optional] + **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] ### Return type diff --git a/jcapiv1/docs/Sshkeylist.md b/jcapiv1/docs/Sshkeylist.md index 94ed3d6..2313090 100644 --- a/jcapiv1/docs/Sshkeylist.md +++ b/jcapiv1/docs/Sshkeylist.md @@ -10,4 +10,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Sshkeypost.md b/jcapiv1/docs/Sshkeypost.md index ca64251..142afbd 100644 --- a/jcapiv1/docs/Sshkeypost.md +++ b/jcapiv1/docs/Sshkeypost.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Sso.md b/jcapiv1/docs/Sso.md new file mode 100644 index 0000000..50ff971 --- /dev/null +++ b/jcapiv1/docs/Sso.md @@ -0,0 +1,12 @@ +# Sso + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**beta** | **bool** | | [optional] +**idp_cert_expiration_at** | **datetime** | | [optional] +**jit** | **bool** | | [optional] +**type** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Emailrequest.md b/jcapiv1/docs/StateActivateBody.md similarity index 82% rename from jcapiv2/docs/Emailrequest.md rename to jcapiv1/docs/StateActivateBody.md index 2258932..54c2760 100644 --- a/jcapiv2/docs/Emailrequest.md +++ b/jcapiv1/docs/StateActivateBody.md @@ -1,10 +1,9 @@ -# Emailrequest +# StateActivateBody ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**email_type** | **str** | | [optional] +**email** | **object** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/System.md b/jcapiv1/docs/System.md index f99b224..4a0627b 100644 --- a/jcapiv1/docs/System.md +++ b/jcapiv1/docs/System.md @@ -12,25 +12,38 @@ Name | Type | Description | Notes **allow_ssh_root_login** | **bool** | | [optional] **amazon_instance_id** | **str** | | [optional] **arch** | **str** | | [optional] +**azure_ad_joined** | **bool** | | [optional] +**built_in_commands** | [**list[SystemBuiltInCommands]**](SystemBuiltInCommands.md) | | [optional] **connection_history** | **list[object]** | | [optional] -**created** | **str** | | [optional] +**created** | **datetime** | | [optional] +**description** | **str** | | [optional] +**display_manager** | **str** | | [optional] **display_name** | **str** | | [optional] +**domain_info** | [**SystemDomainInfo**](SystemDomainInfo.md) | | [optional] **fde** | [**Fde**](Fde.md) | | [optional] +**file_system** | **str** | | [optional] +**has_service_account** | **bool** | | [optional] **hostname** | **str** | | [optional] -**last_contact** | **str** | | [optional] +**last_contact** | **datetime** | | [optional] +**mdm** | [**SystemMdm**](SystemMdm.md) | | [optional] **modify_sshd_config** | **bool** | | [optional] **network_interfaces** | [**list[SystemNetworkInterfaces]**](SystemNetworkInterfaces.md) | | [optional] **organization** | **str** | | [optional] **os** | **str** | | [optional] +**os_family** | **str** | | [optional] +**os_version_detail** | [**SystemOsVersionDetail**](SystemOsVersionDetail.md) | | [optional] +**provision_metadata** | [**SystemProvisionMetadata**](SystemProvisionMetadata.md) | | [optional] **remote_ip** | **str** | | [optional] +**serial_number** | **str** | | [optional] +**service_account_state** | [**SystemServiceAccountState**](SystemServiceAccountState.md) | | [optional] **ssh_root_enabled** | **bool** | | [optional] **sshd_params** | [**list[SystemSshdParams]**](SystemSshdParams.md) | | [optional] **system_insights** | [**SystemSystemInsights**](SystemSystemInsights.md) | | [optional] **system_timezone** | **int** | | [optional] **tags** | **list[str]** | | [optional] **template_name** | **str** | | [optional] +**user_metrics** | [**list[SystemUserMetrics]**](SystemUserMetrics.md) | | [optional] **version** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/WorkdayRequest.md b/jcapiv1/docs/SystemBuiltInCommands.md similarity index 83% rename from jcapiv2/docs/WorkdayRequest.md rename to jcapiv1/docs/SystemBuiltInCommands.md index 417e756..673c27f 100644 --- a/jcapiv2/docs/WorkdayRequest.md +++ b/jcapiv1/docs/SystemBuiltInCommands.md @@ -1,11 +1,10 @@ -# WorkdayRequest +# SystemBuiltInCommands ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | [optional] -**object_id** | **str** | | [optional] +**type** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemDomainInfo.md b/jcapiv1/docs/SystemDomainInfo.md new file mode 100644 index 0000000..04d3129 --- /dev/null +++ b/jcapiv1/docs/SystemDomainInfo.md @@ -0,0 +1,10 @@ +# SystemDomainInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**domain_name** | **str** | | [optional] +**part_of_domain** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemMdm.md b/jcapiv1/docs/SystemMdm.md new file mode 100644 index 0000000..14e3d65 --- /dev/null +++ b/jcapiv1/docs/SystemMdm.md @@ -0,0 +1,14 @@ +# SystemMdm + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dep** | **bool** | | [optional] +**enrollment_type** | **str** | | [optional] +**internal** | [**SystemMdmInternal**](SystemMdmInternal.md) | | [optional] +**profile_identifier** | **str** | | [optional] +**user_approved** | **bool** | | [optional] +**vendor** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemMdmInternal.md b/jcapiv1/docs/SystemMdmInternal.md new file mode 100644 index 0000000..437cce9 --- /dev/null +++ b/jcapiv1/docs/SystemMdmInternal.md @@ -0,0 +1,9 @@ +# SystemMdmInternal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**device_id** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemNetworkInterfaces.md b/jcapiv1/docs/SystemNetworkInterfaces.md index cbe5860..7532935 100644 --- a/jcapiv1/docs/SystemNetworkInterfaces.md +++ b/jcapiv1/docs/SystemNetworkInterfaces.md @@ -10,4 +10,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemOsVersionDetail.md b/jcapiv1/docs/SystemOsVersionDetail.md new file mode 100644 index 0000000..bc3d5fb --- /dev/null +++ b/jcapiv1/docs/SystemOsVersionDetail.md @@ -0,0 +1,14 @@ +# SystemOsVersionDetail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**major** | **str** | | [optional] +**minor** | **str** | | [optional] +**os_name** | **str** | | [optional] +**patch** | **str** | | [optional] +**release_name** | **str** | | [optional] +**revision** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemProvisionMetadata.md b/jcapiv1/docs/SystemProvisionMetadata.md new file mode 100644 index 0000000..ed88c4d --- /dev/null +++ b/jcapiv1/docs/SystemProvisionMetadata.md @@ -0,0 +1,9 @@ +# SystemProvisionMetadata + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**provisioner** | [**SystemProvisionMetadataProvisioner**](SystemProvisionMetadataProvisioner.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemProvisionMetadataProvisioner.md b/jcapiv1/docs/SystemProvisionMetadataProvisioner.md new file mode 100644 index 0000000..4204937 --- /dev/null +++ b/jcapiv1/docs/SystemProvisionMetadataProvisioner.md @@ -0,0 +1,10 @@ +# SystemProvisionMetadataProvisioner + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**provisioner_id** | **str** | | [optional] +**type** | **str** | | [optional] [default to 'administrator'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemServiceAccountState.md b/jcapiv1/docs/SystemServiceAccountState.md new file mode 100644 index 0000000..7248364 --- /dev/null +++ b/jcapiv1/docs/SystemServiceAccountState.md @@ -0,0 +1,11 @@ +# SystemServiceAccountState + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**has_secure_token** | **bool** | | [optional] +**password_apfs_valid** | **bool** | | [optional] +**password_od_valid** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemSshdParams.md b/jcapiv1/docs/SystemSshdParams.md index 05da4d1..35fd18e 100644 --- a/jcapiv1/docs/SystemSshdParams.md +++ b/jcapiv1/docs/SystemSshdParams.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemSystemInsights.md b/jcapiv1/docs/SystemSystemInsights.md index 22cda5b..7a824ec 100644 --- a/jcapiv1/docs/SystemSystemInsights.md +++ b/jcapiv1/docs/SystemSystemInsights.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemUserMetrics.md b/jcapiv1/docs/SystemUserMetrics.md new file mode 100644 index 0000000..9c3e78b --- /dev/null +++ b/jcapiv1/docs/SystemUserMetrics.md @@ -0,0 +1,13 @@ +# SystemUserMetrics + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**admin** | **bool** | | [optional] +**managed** | **bool** | | [optional] +**secure_token_enabled** | **bool** | | [optional] +**suspended** | **bool** | | [optional] +**user_name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Systemput.md b/jcapiv1/docs/Systemput.md index 09c7230..ee294da 100644 --- a/jcapiv1/docs/Systemput.md +++ b/jcapiv1/docs/Systemput.md @@ -13,4 +13,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemputAgentBoundMessages.md b/jcapiv1/docs/SystemputAgentBoundMessages.md index 5931319..a40368f 100644 --- a/jcapiv1/docs/SystemputAgentBoundMessages.md +++ b/jcapiv1/docs/SystemputAgentBoundMessages.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemsApi.md b/jcapiv1/docs/SystemsApi.md index da2100f..cf8b756 100644 --- a/jcapiv1/docs/SystemsApi.md +++ b/jcapiv1/docs/SystemsApi.md @@ -4,20 +4,76 @@ All URIs are relative to *https://console.jumpcloud.com/api* Method | HTTP request | Description ------------- | ------------- | ------------- +[**systems_command_builtin_erase**](SystemsApi.md#systems_command_builtin_erase) | **POST** /systems/{system_id}/command/builtin/erase | Erase a System +[**systems_command_builtin_lock**](SystemsApi.md#systems_command_builtin_lock) | **POST** /systems/{system_id}/command/builtin/lock | Lock a System +[**systems_command_builtin_restart**](SystemsApi.md#systems_command_builtin_restart) | **POST** /systems/{system_id}/command/builtin/restart | Restart a System +[**systems_command_builtin_shutdown**](SystemsApi.md#systems_command_builtin_shutdown) | **POST** /systems/{system_id}/command/builtin/shutdown | Shutdown a System [**systems_delete**](SystemsApi.md#systems_delete) | **DELETE** /systems/{id} | Delete a System [**systems_get**](SystemsApi.md#systems_get) | **GET** /systems/{id} | List an individual system [**systems_list**](SystemsApi.md#systems_list) | **GET** /systems | List All Systems [**systems_put**](SystemsApi.md#systems_put) | **PUT** /systems/{id} | Update a system -[**systems_systemusers_binding_list**](SystemsApi.md#systems_systemusers_binding_list) | **GET** /systems/{id}/systemusers | List system user bindings -[**systems_systemusers_binding_put**](SystemsApi.md#systems_systemusers_binding_put) | **PUT** /systems/{id}/systemusers | Update a system's or user's binding +# **systems_command_builtin_erase** +> systems_command_builtin_erase(system_id, x_org_id=x_org_id) -# **systems_delete** -> System systems_delete(id, content_type, accept, _date=_date, authorization=authorization, x_org_id=x_org_id) +Erase a System -Delete a System +This endpoint allows you to run the erase command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/erase \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` -This endpoint allows you to delete a system. This command will cause the system to uninstall the JumpCloud agent from its self which can can take about a minute. If the system is not connected to JumpCloud the system record will simply be removed. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +### Example +```python +from __future__ import print_function +import time +import jcapiv1 +from jcapiv1.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.SystemsApi(jcapiv1.ApiClient(configuration)) +system_id = 'system_id_example' # str | +x_org_id = 'x_org_id_example' # str | (optional) + +try: + # Erase a System + api_instance.systems_command_builtin_erase(system_id, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling SystemsApi->systems_command_builtin_erase: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **system_id** | **str**| | + **x_org_id** | **str**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **systems_command_builtin_lock** +> systems_command_builtin_lock(system_id, x_org_id=x_org_id) + +Lock a System + +This endpoint allows you to run the lock command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/lock \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` ### Example ```python @@ -35,35 +91,26 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SystemsApi(jcapiv1.ApiClient(configuration)) -id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -_date = '_date_example' # str | Current date header for the System Context API (optional) -authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) -x_org_id = '' # str | (optional) (default to ) +system_id = 'system_id_example' # str | +x_org_id = 'x_org_id_example' # str | (optional) try: - # Delete a System - api_response = api_instance.systems_delete(id, content_type, accept, _date=_date, authorization=authorization, x_org_id=x_org_id) - pprint(api_response) + # Lock a System + api_instance.systems_command_builtin_lock(system_id, x_org_id=x_org_id) except ApiException as e: - print("Exception when calling SystemsApi->systems_delete: %s\n" % e) + print("Exception when calling SystemsApi->systems_command_builtin_lock: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **_date** | **str**| Current date header for the System Context API | [optional] - **authorization** | **str**| Authorization header for the System Context API | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **system_id** | **str**| | + **x_org_id** | **str**| | [optional] ### Return type -[**System**](System.md) +void (empty response body) ### Authorization @@ -71,17 +118,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systems_get** -> System systems_get(id, content_type, accept, fields=fields, filter=filter, _date=_date, authorization=authorization, x_org_id=x_org_id) +# **systems_command_builtin_restart** +> systems_command_builtin_restart(system_id, x_org_id=x_org_id) -List an individual system +Restart a System -This endpoint returns an individual system. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint allows you to run the restart command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/restart \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` ### Example ```python @@ -99,39 +146,26 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SystemsApi(jcapiv1.ApiClient(configuration)) -id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) -filter = 'filter_example' # str | A filter to apply to the query. (optional) -_date = '_date_example' # str | Current date header for the System Context API (optional) -authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) -x_org_id = '' # str | (optional) (default to ) +system_id = 'system_id_example' # str | +x_org_id = 'x_org_id_example' # str | (optional) try: - # List an individual system - api_response = api_instance.systems_get(id, content_type, accept, fields=fields, filter=filter, _date=_date, authorization=authorization, x_org_id=x_org_id) - pprint(api_response) + # Restart a System + api_instance.systems_command_builtin_restart(system_id, x_org_id=x_org_id) except ApiException as e: - print("Exception when calling SystemsApi->systems_get: %s\n" % e) + print("Exception when calling SystemsApi->systems_command_builtin_restart: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] [default to ] - **filter** | **str**| A filter to apply to the query. | [optional] - **_date** | **str**| Current date header for the System Context API | [optional] - **authorization** | **str**| Authorization header for the System Context API | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **system_id** | **str**| | + **x_org_id** | **str**| | [optional] ### Return type -[**System**](System.md) +void (empty response body) ### Authorization @@ -139,17 +173,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systems_list** -> Systemslist systems_list(content_type, accept, fields=fields, limit=limit, x_org_id=x_org_id, search=search, skip=skip, sort=sort, filter=filter) +# **systems_command_builtin_shutdown** +> systems_command_builtin_shutdown(system_id, x_org_id=x_org_id) -List All Systems +Shutdown a System -This endpoint returns all Systems. #### Sample Requests ``` curl -X GET https://console.jumpcloud.com/api/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint allows you to run the shutdown command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/shutdown \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` ### Example ```python @@ -167,41 +201,26 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SystemsApi(jcapiv1.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) -limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) -search = 'search_example' # str | A nested object containing a string `searchTerm` and a list of `fields` to search on. (optional) -skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = '' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) (default to ) -filter = 'filter_example' # str | A filter to apply to the query. (optional) +system_id = 'system_id_example' # str | +x_org_id = 'x_org_id_example' # str | (optional) try: - # List All Systems - api_response = api_instance.systems_list(content_type, accept, fields=fields, limit=limit, x_org_id=x_org_id, search=search, skip=skip, sort=sort, filter=filter) - pprint(api_response) + # Shutdown a System + api_instance.systems_command_builtin_shutdown(system_id, x_org_id=x_org_id) except ApiException as e: - print("Exception when calling SystemsApi->systems_list: %s\n" % e) + print("Exception when calling SystemsApi->systems_command_builtin_shutdown: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] [default to ] - **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] - **search** | **str**| A nested object containing a string `searchTerm` and a list of `fields` to search on. | [optional] - **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | **str**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [optional] [default to ] - **filter** | **str**| A filter to apply to the query. | [optional] + **system_id** | **str**| | + **x_org_id** | **str**| | [optional] ### Return type -[**Systemslist**](Systemslist.md) +void (empty response body) ### Authorization @@ -209,17 +228,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systems_put** -> System systems_put(id, content_type, accept, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) +# **systems_delete** +> System systems_delete(id, _date=_date, authorization=authorization, x_org_id=x_org_id) -Update a system +Delete a System -This endpoint allows you to update a system. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\":\"Name_Update\", \"allowSshPasswordAuthentication\":\"true\", \"allowSshRootLogin\":\"true\", \"allowMultiFactorAuthentication\":\"true\", \"allowPublicKeyAuthentication\":\"false\" }' ``` +This endpoint allows you to delete a system. This command will cause the system to uninstall the JumpCloud agent from its self which can can take about a minute. If the system is not connected to JumpCloud the system record will simply be removed. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -238,19 +257,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SystemsApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv1.Systemput() # Systemput | (optional) _date = '_date_example' # str | Current date header for the System Context API (optional) authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | (optional) try: - # Update a system - api_response = api_instance.systems_put(id, content_type, accept, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) + # Delete a System + api_response = api_instance.systems_delete(id, _date=_date, authorization=authorization, x_org_id=x_org_id) pprint(api_response) except ApiException as e: - print("Exception when calling SystemsApi->systems_put: %s\n" % e) + print("Exception when calling SystemsApi->systems_delete: %s\n" % e) ``` ### Parameters @@ -258,12 +274,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**Systemput**](Systemput.md)| | [optional] **_date** | **str**| Current date header for the System Context API | [optional] **authorization** | **str**| Authorization header for the System Context API | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| | [optional] ### Return type @@ -275,17 +288,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systems_systemusers_binding_list** -> Systemuserbinding systems_systemusers_binding_list(id, content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) +# **systems_get** +> System systems_get(id, fields=fields, filter=filter, _date=_date, authorization=authorization, x_org_id=x_org_id) -List system user bindings +List an individual system -Hidden as Tags is deprecated List system user bindings for a specific system in a system and user binding format. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). #### Sample Request *List system user bindings for specific system* ``` curl -X https://console.jumpcloud.com/api/systems/{SystemID}/systemusers\\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ \" ``` +This endpoint returns an individual system. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -304,40 +317,100 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SystemsApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) +fields = 'fields_example' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) +_date = '_date_example' # str | Current date header for the System Context API (optional) +authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) +x_org_id = 'x_org_id_example' # str | (optional) + +try: + # List an individual system + api_response = api_instance.systems_get(id, fields=fields, filter=filter, _date=_date, authorization=authorization, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling SystemsApi->systems_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] + **_date** | **str**| Current date header for the System Context API | [optional] + **authorization** | **str**| Authorization header for the System Context API | [optional] + **x_org_id** | **str**| | [optional] + +### Return type + +[**System**](System.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **systems_list** +> Systemslist systems_list(fields=fields, limit=limit, x_org_id=x_org_id, search=search, skip=skip, sort=sort, filter=filter) + +List All Systems + +This endpoint returns all Systems. #### Sample Requests ``` curl -X GET https://console.jumpcloud.com/api/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv1 +from jcapiv1.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.SystemsApi(jcapiv1.ApiClient(configuration)) +fields = 'fields_example' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | (optional) +search = 'search_example' # str | A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = '' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) (default to ) -filter = 'filter_example' # str | A filter to apply to the query. (optional) -x_org_id = '' # str | (optional) (default to ) +sort = 'sort_example' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) try: - # List system user bindings - api_response = api_instance.systems_systemusers_binding_list(id, content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) + # List All Systems + api_response = api_instance.systems_list(fields=fields, limit=limit, x_org_id=x_org_id, search=search, skip=skip, sort=sort, filter=filter) pprint(api_response) except ApiException as e: - print("Exception when calling SystemsApi->systems_systemusers_binding_list: %s\n" % e) + print("Exception when calling SystemsApi->systems_list: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] [default to ] + **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| | [optional] + **search** | **str**| A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | **str**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [optional] [default to ] - **filter** | **str**| A filter to apply to the query. | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | **str**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] ### Return type -[**Systemuserbinding**](Systemuserbinding.md) +[**Systemslist**](Systemslist.md) ### Authorization @@ -345,17 +418,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systems_systemusers_binding_put** -> systems_systemusers_binding_put(id, content_type, accept, body=body, x_org_id=x_org_id) +# **systems_put** +> System systems_put(id, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) -Update a system's or user's binding +Update a system -Hidden as Tags is deprecated Adds or removes a user binding for a system. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). #### Sample Request *Add (or remove) a system user to (from) a system* ``` curl \\ -d '{ \"add\": [\"[SYSTEM_USER_ID_TO_ADD_HERE]\"], \"remove\": [\"[SYSTEM_USER_ID_TO_REMOVE_HERE]\"] }' \\ -X PUT \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/systems/[SYSTEM_ID_HERE]/systemusers +This endpoint allows you to update a system. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\":\"Name_Update\", \"allowSshPasswordAuthentication\":\"true\", \"allowSshRootLogin\":\"true\", \"allowMultiFactorAuthentication\":\"true\", \"allowPublicKeyAuthentication\":\"false\" }' ``` ### Example ```python @@ -374,16 +447,17 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SystemsApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv1.Systemuserbindingsput() # Systemuserbindingsput | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv1.Systemput() # Systemput | (optional) +_date = '_date_example' # str | Current date header for the System Context API (optional) +authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) +x_org_id = 'x_org_id_example' # str | (optional) try: - # Update a system's or user's binding - api_instance.systems_systemusers_binding_put(id, content_type, accept, body=body, x_org_id=x_org_id) + # Update a system + api_response = api_instance.systems_put(id, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) + pprint(api_response) except ApiException as e: - print("Exception when calling SystemsApi->systems_systemusers_binding_put: %s\n" % e) + print("Exception when calling SystemsApi->systems_put: %s\n" % e) ``` ### Parameters @@ -391,14 +465,14 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**Systemuserbindingsput**](Systemuserbindingsput.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**Systemput**](Systemput.md)| | [optional] + **_date** | **str**| Current date header for the System Context API | [optional] + **authorization** | **str**| Authorization header for the System Context API | [optional] + **x_org_id** | **str**| | [optional] ### Return type -void (empty response body) +[**System**](System.md) ### Authorization diff --git a/jcapiv1/docs/Systemslist.md b/jcapiv1/docs/Systemslist.md index c9f156e..cc54f2c 100644 --- a/jcapiv1/docs/Systemslist.md +++ b/jcapiv1/docs/Systemslist.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Systemuser.md b/jcapiv1/docs/Systemuser.md deleted file mode 100644 index 076fa98..0000000 --- a/jcapiv1/docs/Systemuser.md +++ /dev/null @@ -1,50 +0,0 @@ -# Systemuser - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | | [optional] -**account_locked** | **bool** | | [optional] -**activated** | **bool** | | [optional] -**allow_public_key** | **bool** | | [optional] -**associated_tag_count** | **int** | | [optional] -**attributes** | **list[object]** | | [optional] -**company** | **str** | | [optional] -**cost_center** | **str** | | [optional] -**created** | **str** | | [optional] -**department** | **str** | | [optional] -**description** | **str** | | [optional] -**displayname** | **str** | | [optional] -**email** | **str** | | [optional] -**employee_identifier** | **str** | Must be unique per user. | [optional] -**employee_type** | **str** | | [optional] -**enable_managed_uid** | **bool** | | [optional] -**enable_user_portal_multifactor** | **bool** | | [optional] -**external_dn** | **str** | | [optional] -**external_source_type** | **str** | | [optional] -**externally_managed** | **bool** | | [optional] -**firstname** | **str** | | [optional] -**job_title** | **str** | | [optional] -**lastname** | **str** | | [optional] -**ldap_binding_user** | **bool** | | [optional] -**location** | **str** | | [optional] -**mfa** | [**Mfa**](Mfa.md) | | [optional] -**middlename** | **str** | | [optional] -**password_expiration_date** | **str** | | [optional] -**password_expired** | **bool** | | [optional] -**password_never_expires** | **bool** | | [optional] -**passwordless_sudo** | **bool** | | [optional] -**public_key** | **str** | | [optional] -**samba_service_user** | **bool** | | [optional] -**ssh_keys** | [**list[Sshkeylist]**](Sshkeylist.md) | | [optional] -**sudo** | **bool** | | [optional] -**suspended** | **bool** | | [optional] -**tags** | **list[str]** | | [optional] -**totp_enabled** | **bool** | | [optional] -**unix_guid** | **int** | | [optional] -**unix_uid** | **int** | | [optional] -**username** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv1/docs/Systemuserput.md b/jcapiv1/docs/Systemuserput.md index 3538c7f..efd47f8 100644 --- a/jcapiv1/docs/Systemuserput.md +++ b/jcapiv1/docs/Systemuserput.md @@ -6,11 +6,13 @@ Name | Type | Description | Notes **account_locked** | **bool** | | [optional] **addresses** | [**list[SystemuserputAddresses]**](SystemuserputAddresses.md) | type, poBox, extendedAddress, streetAddress, locality, region, postalCode, country | [optional] **allow_public_key** | **bool** | | [optional] -**attributes** | **list[object]** | | [optional] +**alternate_email** | **str** | | [optional] +**attributes** | [**list[SystemuserputAttributes]**](SystemuserputAttributes.md) | | [optional] **company** | **str** | | [optional] **cost_center** | **str** | | [optional] **department** | **str** | | [optional] **description** | **str** | | [optional] +**disable_device_max_login_attempts** | **bool** | | [optional] **displayname** | **str** | | [optional] **email** | **str** | | [optional] **employee_identifier** | **str** | Must be unique per user. | [optional] @@ -18,6 +20,7 @@ Name | Type | Description | Notes **enable_managed_uid** | **bool** | | [optional] **enable_user_portal_multifactor** | **bool** | | [optional] **external_dn** | **str** | | [optional] +**external_password_expiration_date** | **str** | | [optional] **external_source_type** | **str** | | [optional] **externally_managed** | **bool** | | [optional] **firstname** | **str** | | [optional] @@ -25,15 +28,18 @@ Name | Type | Description | Notes **lastname** | **str** | | [optional] **ldap_binding_user** | **bool** | | [optional] **location** | **str** | | [optional] +**managed_apple_id** | **str** | | [optional] +**manager** | **str** | Relation with another systemuser to identify the last as a manager. | [optional] **mfa** | [**Mfa**](Mfa.md) | | [optional] **middlename** | **str** | | [optional] **password** | **str** | | [optional] **password_never_expires** | **bool** | | [optional] **phone_numbers** | [**list[SystemuserputPhoneNumbers]**](SystemuserputPhoneNumbers.md) | | [optional] **public_key** | **str** | | [optional] -**relationships** | **list[object]** | | [optional] +**relationships** | [**list[SystemuserputRelationships]**](SystemuserputRelationships.md) | | [optional] **samba_service_user** | **bool** | | [optional] **ssh_keys** | [**list[Sshkeypost]**](Sshkeypost.md) | | [optional] +**state** | **str** | | [optional] **sudo** | **bool** | | [optional] **suspended** | **bool** | | [optional] **tags** | **list[str]** | | [optional] @@ -43,4 +49,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemuserputAddresses.md b/jcapiv1/docs/SystemuserputAddresses.md index b35da86..1cdc2ab 100644 --- a/jcapiv1/docs/SystemuserputAddresses.md +++ b/jcapiv1/docs/SystemuserputAddresses.md @@ -14,4 +14,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/Body2.md b/jcapiv1/docs/SystemuserputAttributes.md similarity index 76% rename from jcapiv2/docs/Body2.md rename to jcapiv1/docs/SystemuserputAttributes.md index ce6048e..74172ea 100644 --- a/jcapiv2/docs/Body2.md +++ b/jcapiv1/docs/SystemuserputAttributes.md @@ -1,12 +1,10 @@ -# Body2 +# SystemuserputAttributes ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**groups** | **list[str]** | | [optional] **name** | **str** | | [optional] -**users** | **list[str]** | | [optional] +**value** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemuserputPhoneNumbers.md b/jcapiv1/docs/SystemuserputPhoneNumbers.md index 31e89a6..1a44f2e 100644 --- a/jcapiv1/docs/SystemuserputPhoneNumbers.md +++ b/jcapiv1/docs/SystemuserputPhoneNumbers.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemuserputRelationships.md b/jcapiv1/docs/SystemuserputRelationships.md new file mode 100644 index 0000000..feeddfd --- /dev/null +++ b/jcapiv1/docs/SystemuserputRelationships.md @@ -0,0 +1,10 @@ +# SystemuserputRelationships + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [optional] +**value** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Systemuserputpost.md b/jcapiv1/docs/Systemuserputpost.md index 820254b..700ad45 100644 --- a/jcapiv1/docs/Systemuserputpost.md +++ b/jcapiv1/docs/Systemuserputpost.md @@ -7,11 +7,13 @@ Name | Type | Description | Notes **activated** | **bool** | | [optional] **addresses** | [**list[SystemuserputpostAddresses]**](SystemuserputpostAddresses.md) | | [optional] **allow_public_key** | **bool** | | [optional] -**attributes** | **list[object]** | | [optional] +**alternate_email** | **str** | | [optional] +**attributes** | [**list[SystemuserputAttributes]**](SystemuserputAttributes.md) | | [optional] **company** | **str** | | [optional] **cost_center** | **str** | | [optional] **department** | **str** | | [optional] **description** | **str** | | [optional] +**disable_device_max_login_attempts** | **bool** | | [optional] **displayname** | **str** | | [optional] **email** | **str** | | **employee_identifier** | **str** | Must be unique per user. | [optional] @@ -19,6 +21,7 @@ Name | Type | Description | Notes **enable_managed_uid** | **bool** | | [optional] **enable_user_portal_multifactor** | **bool** | | [optional] **external_dn** | **str** | | [optional] +**external_password_expiration_date** | **datetime** | | [optional] **external_source_type** | **str** | | [optional] **externally_managed** | **bool** | | [optional] **firstname** | **str** | | [optional] @@ -26,6 +29,8 @@ Name | Type | Description | Notes **lastname** | **str** | | [optional] **ldap_binding_user** | **bool** | | [optional] **location** | **str** | | [optional] +**managed_apple_id** | **str** | | [optional] +**manager** | **str** | Relation with another systemuser to identify the last as a manager. | [optional] **mfa** | [**Mfa**](Mfa.md) | | [optional] **middlename** | **str** | | [optional] **password** | **str** | | [optional] @@ -33,8 +38,10 @@ Name | Type | Description | Notes **passwordless_sudo** | **bool** | | [optional] **phone_numbers** | [**list[SystemuserputpostPhoneNumbers]**](SystemuserputpostPhoneNumbers.md) | | [optional] **public_key** | **str** | | [optional] -**relationships** | **list[object]** | | [optional] +**recovery_email** | [**SystemuserputpostRecoveryEmail**](SystemuserputpostRecoveryEmail.md) | | [optional] +**relationships** | [**list[SystemuserputRelationships]**](SystemuserputRelationships.md) | | [optional] **samba_service_user** | **bool** | | [optional] +**state** | **str** | | [optional] **sudo** | **bool** | | [optional] **suspended** | **bool** | | [optional] **tags** | **list[str]** | | [optional] @@ -44,4 +51,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemuserputpostAddresses.md b/jcapiv1/docs/SystemuserputpostAddresses.md index 1d6782f..178f182 100644 --- a/jcapiv1/docs/SystemuserputpostAddresses.md +++ b/jcapiv1/docs/SystemuserputpostAddresses.md @@ -14,4 +14,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemuserputpostPhoneNumbers.md b/jcapiv1/docs/SystemuserputpostPhoneNumbers.md index 1550349..05a3ccc 100644 --- a/jcapiv1/docs/SystemuserputpostPhoneNumbers.md +++ b/jcapiv1/docs/SystemuserputpostPhoneNumbers.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemuserputpostRecoveryEmail.md b/jcapiv1/docs/SystemuserputpostRecoveryEmail.md new file mode 100644 index 0000000..106f7a4 --- /dev/null +++ b/jcapiv1/docs/SystemuserputpostRecoveryEmail.md @@ -0,0 +1,9 @@ +# SystemuserputpostRecoveryEmail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Systemuserreturn.md b/jcapiv1/docs/Systemuserreturn.md index a1b3c9f..102043d 100644 --- a/jcapiv1/docs/Systemuserreturn.md +++ b/jcapiv1/docs/Systemuserreturn.md @@ -5,16 +5,20 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] **account_locked** | **bool** | | [optional] +**account_locked_date** | **str** | | [optional] **activated** | **bool** | | [optional] **addresses** | [**list[SystemuserreturnAddresses]**](SystemuserreturnAddresses.md) | | [optional] **allow_public_key** | **bool** | | [optional] -**attributes** | **list[object]** | | [optional] +**alternate_email** | **str** | | [optional] +**attributes** | [**list[SystemuserputAttributes]**](SystemuserputAttributes.md) | | [optional] **bad_login_attempts** | **int** | | [optional] **company** | **str** | | [optional] **cost_center** | **str** | | [optional] **created** | **str** | | [optional] +**creation_source** | **str** | | [optional] **department** | **str** | | [optional] **description** | **str** | | [optional] +**disable_device_max_login_attempts** | **bool** | | [optional] **displayname** | **str** | | [optional] **email** | **str** | | [optional] **employee_identifier** | **str** | Must be unique per user. | [optional] @@ -22,6 +26,7 @@ Name | Type | Description | Notes **enable_managed_uid** | **bool** | | [optional] **enable_user_portal_multifactor** | **bool** | | [optional] **external_dn** | **str** | | [optional] +**external_password_expiration_date** | **str** | | [optional] **external_source_type** | **str** | | [optional] **externally_managed** | **bool** | | [optional] **firstname** | **str** | | [optional] @@ -29,7 +34,10 @@ Name | Type | Description | Notes **lastname** | **str** | | [optional] **ldap_binding_user** | **bool** | | [optional] **location** | **str** | | [optional] +**managed_apple_id** | **str** | | [optional] +**manager** | **str** | Relation with another systemuser to identify the last as a manager. | [optional] **mfa** | [**Mfa**](Mfa.md) | | [optional] +**mfa_enrollment** | [**MfaEnrollment**](MfaEnrollment.md) | | [optional] **middlename** | **str** | | [optional] **organization** | **str** | | [optional] **password_expiration_date** | **str** | | [optional] @@ -38,9 +46,11 @@ Name | Type | Description | Notes **passwordless_sudo** | **bool** | | [optional] **phone_numbers** | [**list[SystemuserreturnPhoneNumbers]**](SystemuserreturnPhoneNumbers.md) | | [optional] **public_key** | **str** | | [optional] -**relationships** | **list[object]** | | [optional] +**recovery_email** | [**SystemuserreturnRecoveryEmail**](SystemuserreturnRecoveryEmail.md) | | [optional] +**relationships** | [**list[SystemuserputRelationships]**](SystemuserputRelationships.md) | | [optional] **samba_service_user** | **bool** | | [optional] **ssh_keys** | [**list[Sshkeylist]**](Sshkeylist.md) | | [optional] +**state** | **str** | | [optional] **sudo** | **bool** | | [optional] **suspended** | **bool** | | [optional] **tags** | **list[str]** | | [optional] @@ -51,4 +61,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemuserreturnAddresses.md b/jcapiv1/docs/SystemuserreturnAddresses.md index e5b0121..04a8ba2 100644 --- a/jcapiv1/docs/SystemuserreturnAddresses.md +++ b/jcapiv1/docs/SystemuserreturnAddresses.md @@ -15,4 +15,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemuserreturnPhoneNumbers.md b/jcapiv1/docs/SystemuserreturnPhoneNumbers.md index 6546e35..e13db0d 100644 --- a/jcapiv1/docs/SystemuserreturnPhoneNumbers.md +++ b/jcapiv1/docs/SystemuserreturnPhoneNumbers.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemuserreturnRecoveryEmail.md b/jcapiv1/docs/SystemuserreturnRecoveryEmail.md new file mode 100644 index 0000000..25b2ebe --- /dev/null +++ b/jcapiv1/docs/SystemuserreturnRecoveryEmail.md @@ -0,0 +1,11 @@ +# SystemuserreturnRecoveryEmail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **str** | | [optional] +**verified** | **bool** | | [optional] +**verified_at** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemusersApi.md b/jcapiv1/docs/SystemusersApi.md index 09ea91b..46f40f1 100644 --- a/jcapiv1/docs/SystemusersApi.md +++ b/jcapiv1/docs/SystemusersApi.md @@ -4,22 +4,22 @@ All URIs are relative to *https://console.jumpcloud.com/api* Method | HTTP request | Description ------------- | ------------- | ------------- -[**sshkey_delete**](SystemusersApi.md#sshkey_delete) | **DELETE** /systemusers/{systemuser_id}/sshkeys/{id} | Delete a system user's Public SSH Keys -[**sshkey_list**](SystemusersApi.md#sshkey_list) | **GET** /systemusers/{id}/sshkeys | List a system user's public SSH keys -[**sshkey_post**](SystemusersApi.md#sshkey_post) | **POST** /systemusers/{id}/sshkeys | Create a system user's Public SSH Key +[**sshkey_delete**](SystemusersApi.md#sshkey_delete) | **DELETE** /systemusers/{systemuser_id}/sshkeys/{id} | Delete a system user's Public SSH Keys +[**sshkey_list**](SystemusersApi.md#sshkey_list) | **GET** /systemusers/{id}/sshkeys | List a system user's public SSH keys +[**sshkey_post**](SystemusersApi.md#sshkey_post) | **POST** /systemusers/{id}/sshkeys | Create a system user's Public SSH Key [**systemusers_delete**](SystemusersApi.md#systemusers_delete) | **DELETE** /systemusers/{id} | Delete a system user +[**systemusers_expire**](SystemusersApi.md#systemusers_expire) | **POST** /systemusers/{id}/expire | Expire a system user's password [**systemusers_get**](SystemusersApi.md#systemusers_get) | **GET** /systemusers/{id} | List a system user [**systemusers_list**](SystemusersApi.md#systemusers_list) | **GET** /systemusers | List all system users +[**systemusers_mfasync**](SystemusersApi.md#systemusers_mfasync) | **POST** /systemusers/{id}/mfasync | Sync a systemuser's mfa enrollment status [**systemusers_post**](SystemusersApi.md#systemusers_post) | **POST** /systemusers | Create a system user [**systemusers_put**](SystemusersApi.md#systemusers_put) | **PUT** /systemusers/{id} | Update a system user -[**systemusers_resetmfa**](SystemusersApi.md#systemusers_resetmfa) | **POST** /systemusers/{id}/resetmfa | Reset a system user's MFA token -[**systemusers_systems_binding_list**](SystemusersApi.md#systemusers_systems_binding_list) | **GET** /systemusers/{id}/systems | List system user binding -[**systemusers_systems_binding_put**](SystemusersApi.md#systemusers_systems_binding_put) | **PUT** /systemusers/{id}/systems | Update a system user binding +[**systemusers_resetmfa**](SystemusersApi.md#systemusers_resetmfa) | **POST** /systemusers/{id}/resetmfa | Reset a system user's MFA token +[**systemusers_state_activate**](SystemusersApi.md#systemusers_state_activate) | **POST** /systemusers/{id}/state/activate | Activate System User [**systemusers_unlock**](SystemusersApi.md#systemusers_unlock) | **POST** /systemusers/{id}/unlock | Unlock a system user - # **sshkey_delete** -> sshkey_delete(systemuser_id, id, content_type, accept, x_org_id=x_org_id) +> str sshkey_delete(systemuser_id, id, x_org_id=x_org_id) Delete a system user's Public SSH Keys @@ -43,13 +43,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' api_instance = jcapiv1.SystemusersApi(jcapiv1.ApiClient(configuration)) systemuser_id = 'systemuser_id_example' # str | id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | (optional) try: # Delete a system user's Public SSH Keys - api_instance.sshkey_delete(systemuser_id, id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.sshkey_delete(systemuser_id, id, x_org_id=x_org_id) + pprint(api_response) except ApiException as e: print("Exception when calling SystemusersApi->sshkey_delete: %s\n" % e) ``` @@ -60,13 +59,11 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **systemuser_id** | **str**| | **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| | [optional] ### Return type -void (empty response body) +**str** ### Authorization @@ -74,13 +71,13 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json, text/plain [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **sshkey_list** -> list[Sshkeylist] sshkey_list(id, content_type, accept, x_org_id=x_org_id) +> list[Sshkeylist] sshkey_list(id, x_org_id=x_org_id) List a system user's public SSH keys @@ -103,13 +100,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SystemusersApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | (optional) try: # List a system user's public SSH keys - api_response = api_instance.sshkey_list(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.sshkey_list(id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemusersApi->sshkey_list: %s\n" % e) @@ -120,9 +115,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| | [optional] ### Return type @@ -134,13 +127,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **sshkey_post** -> Sshkeylist sshkey_post(id, content_type, accept, body=body, x_org_id=x_org_id) +> Sshkeylist sshkey_post(id, body=body, x_org_id=x_org_id) Create a system user's Public SSH Key @@ -163,14 +156,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SystemusersApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv1.Sshkeypost() # Sshkeypost | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | (optional) try: # Create a system user's Public SSH Key - api_response = api_instance.sshkey_post(id, content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.sshkey_post(id, body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemusersApi->sshkey_post: %s\n" % e) @@ -181,10 +172,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**Sshkeypost**](Sshkeypost.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| | [optional] ### Return type @@ -202,7 +191,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **systemusers_delete** -> Systemuserreturn systemusers_delete(id, content_type, accept, x_org_id=x_org_id) +> Systemuserreturn systemusers_delete(id, x_org_id=x_org_id, cascade_manager=cascade_manager) Delete a system user @@ -225,13 +214,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SystemusersApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | (optional) +cascade_manager = 'cascade_manager_example' # str | This is an optional flag that can be enabled on the DELETE call, DELETE /systemusers/{id}?cascade_manager=null. This parameter will clear the Manager attribute on all direct reports and then delete the account. (optional) try: # Delete a system user - api_response = api_instance.systemusers_delete(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.systemusers_delete(id, x_org_id=x_org_id, cascade_manager=cascade_manager) pprint(api_response) except ApiException as e: print("Exception when calling SystemusersApi->systemusers_delete: %s\n" % e) @@ -242,9 +230,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| | [optional] + **cascade_manager** | **str**| This is an optional flag that can be enabled on the DELETE call, DELETE /systemusers/{id}?cascade_manager=null. This parameter will clear the Manager attribute on all direct reports and then delete the account. | [optional] ### Return type @@ -256,13 +243,69 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **systemusers_expire** +> str systemusers_expire(id, x_org_id=x_org_id) + +Expire a system user's password + +This endpoint allows you to expire a user's password. + +### Example +```python +from __future__ import print_function +import time +import jcapiv1 +from jcapiv1.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.SystemusersApi(jcapiv1.ApiClient(configuration)) +id = 'id_example' # str | +x_org_id = 'x_org_id_example' # str | (optional) + +try: + # Expire a system user's password + api_response = api_instance.systemusers_expire(id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling SystemusersApi->systemusers_expire: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **x_org_id** | **str**| | [optional] + +### Return type + +**str** + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **systemusers_get** -> Systemuserreturn systemusers_get(id, content_type, accept, fields=fields, filter=filter, x_org_id=x_org_id) +> Systemuserreturn systemusers_get(id, fields=fields, filter=filter, x_org_id=x_org_id) List a system user @@ -285,15 +328,13 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SystemusersApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) -filter = 'filter_example' # str | A filter to apply to the query. (optional) -x_org_id = '' # str | (optional) (default to ) +fields = 'fields_example' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) +x_org_id = 'x_org_id_example' # str | (optional) try: # List a system user - api_response = api_instance.systemusers_get(id, content_type, accept, fields=fields, filter=filter, x_org_id=x_org_id) + api_response = api_instance.systemusers_get(id, fields=fields, filter=filter, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemusersApi->systemusers_get: %s\n" % e) @@ -304,11 +345,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] [default to ] - **filter** | **str**| A filter to apply to the query. | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] + **x_org_id** | **str**| | [optional] ### Return type @@ -320,13 +359,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **systemusers_list** -> Systemuserslist systemusers_list(content_type, accept, limit=limit, skip=skip, sort=sort, fields=fields, x_org_id=x_org_id, search=search, filter=filter) +> Systemuserslist systemusers_list(limit=limit, skip=skip, sort=sort, fields=fields, filter=filter, x_org_id=x_org_id, search=search) List all system users @@ -348,19 +387,17 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SystemusersApi(jcapiv1.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = '' # str | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to ) -fields = '' # str | The comma separated fields included in the returned records. If omitted the default list of fields will be returned. (optional) (default to ) -x_org_id = '' # str | (optional) (default to ) -search = 'search_example' # str | A nested object containing a string `searchTerm` and a list of `fields` to search on. (optional) -filter = 'filter_example' # str | A filter to apply to the query. (optional) +sort = 'sort_example' # str | The space separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +fields = 'fields_example' # str | The space separated fields included in the returned records. If omitted the default list of fields will be returned. (optional) +filter = 'filter_example' # str | A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. (optional) +x_org_id = 'x_org_id_example' # str | (optional) +search = 'search_example' # str | A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. (optional) try: # List all system users - api_response = api_instance.systemusers_list(content_type, accept, limit=limit, skip=skip, sort=sort, fields=fields, x_org_id=x_org_id, search=search, filter=filter) + api_response = api_instance.systemusers_list(limit=limit, skip=skip, sort=sort, fields=fields, filter=filter, x_org_id=x_org_id, search=search) pprint(api_response) except ApiException as e: print("Exception when calling SystemusersApi->systemusers_list: %s\n" % e) @@ -370,15 +407,13 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | **str**| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to ] - **fields** | **str**| The comma separated fields included in the returned records. If omitted the default list of fields will be returned. | [optional] [default to ] - **x_org_id** | **str**| | [optional] [default to ] - **search** | **str**| A nested object containing a string `searchTerm` and a list of `fields` to search on. | [optional] - **filter** | **str**| A filter to apply to the query. | [optional] + **sort** | **str**| The space separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **fields** | **str**| The space separated fields included in the returned records. If omitted the default list of fields will be returned. | [optional] + **filter** | **str**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | [optional] + **x_org_id** | **str**| | [optional] + **search** | **str**| A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. | [optional] ### Return type @@ -390,17 +425,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systemusers_post** -> Systemuserreturn systemusers_post(content_type, accept, body=body, x_org_id=x_org_id) +# **systemusers_mfasync** +> systemusers_mfasync(id) -Create a system user +Sync a systemuser's mfa enrollment status -This endpoint allows you to create a new system user. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"username\":\"{username}\", \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` +This endpoint allows you to re-sync a user's mfa enrollment status #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systemusers/{UserID}/mfasync \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` ### Example ```python @@ -418,31 +453,24 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SystemusersApi(jcapiv1.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv1.Systemuserputpost() # Systemuserputpost | (optional) -x_org_id = '' # str | (optional) (default to ) +id = 'id_example' # str | try: - # Create a system user - api_response = api_instance.systemusers_post(content_type, accept, body=body, x_org_id=x_org_id) - pprint(api_response) + # Sync a systemuser's mfa enrollment status + api_instance.systemusers_mfasync(id) except ApiException as e: - print("Exception when calling SystemusersApi->systemusers_post: %s\n" % e) + print("Exception when calling SystemusersApi->systemusers_mfasync: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**Systemuserputpost**](Systemuserputpost.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **id** | **str**| | ### Return type -[**Systemuserreturn**](Systemuserreturn.md) +void (empty response body) ### Authorization @@ -450,17 +478,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systemusers_put** -> Systemuserreturn systemusers_put(id, content_type, accept, body=body, x_org_id=x_org_id) +# **systemusers_post** +> Systemuserreturn systemusers_post(body=body, x_org_id=x_org_id, full_validation_details=full_validation_details) -Update a system user +Create a system user -This endpoint allows you to update a system user. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` +\"This endpoint allows you to create a new system user. #### Default User State The `state` of the user can be explicitly passed in or omitted. If `state` is omitted from the request, then the user will get created using the value returned from the [Get an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organizations_get) endpoint. The default user state for manually created users is stored in `settings.newSystemUserStateDefaults.manualEntry` These default state values can be changed in the admin portal settings or by using the [Update an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organization_put) endpoint. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"username\":\"{username}\", \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` ### Example ```python @@ -478,29 +506,25 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SystemusersApi(jcapiv1.ApiClient(configuration)) -id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv1.Systemuserput() # Systemuserput | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv1.Systemuserputpost() # Systemuserputpost | (optional) +x_org_id = 'x_org_id_example' # str | (optional) +full_validation_details = 'full_validation_details_example' # str | Pass this query parameter when a client wants all validation errors to be returned with a detailed error response for the form field specified. The current form fields are allowed: * `password` #### Password validation flag Use the `password` validation flag to receive details on a possible bad request response ``` ?fullValidationDetails=password ``` Without the flag, default behavior will be a normal 400 with only a single validation string error #### Expected Behavior Clients can expect a list of validation error mappings for the validation query field in the details provided on the response: ``` { \"code\": 400, \"message\": \"Password validation fail\", \"status\": \"INVALID_ARGUMENT\", \"details\": [ { \"fieldViolationsList\": [ {\"field\": \"password\", \"description\": \"specialCharacter\"} ], '@type': 'type.googleapis.com/google.rpc.BadRequest', }, ], }, ``` (optional) try: - # Update a system user - api_response = api_instance.systemusers_put(id, content_type, accept, body=body, x_org_id=x_org_id) + # Create a system user + api_response = api_instance.systemusers_post(body=body, x_org_id=x_org_id, full_validation_details=full_validation_details) pprint(api_response) except ApiException as e: - print("Exception when calling SystemusersApi->systemusers_put: %s\n" % e) + print("Exception when calling SystemusersApi->systemusers_post: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**Systemuserput**](Systemuserput.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**Systemuserputpost**](Systemuserputpost.md)| | [optional] + **x_org_id** | **str**| | [optional] + **full_validation_details** | **str**| Pass this query parameter when a client wants all validation errors to be returned with a detailed error response for the form field specified. The current form fields are allowed: * `password` #### Password validation flag Use the `password` validation flag to receive details on a possible bad request response ``` ?fullValidationDetails=password ``` Without the flag, default behavior will be a normal 400 with only a single validation string error #### Expected Behavior Clients can expect a list of validation error mappings for the validation query field in the details provided on the response: ``` { \"code\": 400, \"message\": \"Password validation fail\", \"status\": \"INVALID_ARGUMENT\", \"details\": [ { \"fieldViolationsList\": [ {\"field\": \"password\", \"description\": \"specialCharacter\"} ], '@type': 'type.googleapis.com/google.rpc.BadRequest', }, ], }, ``` | [optional] ### Return type @@ -517,12 +541,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systemusers_resetmfa** -> systemusers_resetmfa(id, content_type, accept, body=body, x_org_id=x_org_id) +# **systemusers_put** +> Systemuserreturn systemusers_put(id, body=body, x_org_id=x_org_id, full_validation_details=full_validation_details) -Reset a system user's MFA token +Update a system user -This endpoint allows you to reset the TOTP key for a specified system user and put them in an TOTP MFA enrollment period. This will result in the user being prompted to setup TOTP MFA when logging into userportal. Please be aware that if the user does not complete TOTP MFA setup before the `exclusionUntil` date, they will be locked out of any resources that require TOTP MFA. Please refer to our [Knowledge Base Article](https://support.jumpcloud.com/customer/en/portal/articles/2959138-using-multifactor-authentication-with-jumpcloud) on setting up MFA for more information. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systemusers/{UserID}/resetmfa \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"exclusion\": true, \"exclusionUntil\": \"{date-time}\"}' ``` +This endpoint allows you to update a system user. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` ### Example ```python @@ -541,16 +565,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SystemusersApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv1.Body1() # Body1 | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv1.Systemuserput() # Systemuserput | (optional) +x_org_id = 'x_org_id_example' # str | (optional) +full_validation_details = 'full_validation_details_example' # str | This endpoint can take in a query when a client wants all validation errors to be returned with error response for the form field specified, i.e. 'password' #### Password validation flag Use the \"password\" validation flag to receive details on a possible bad request response Without the `password` flag, default behavior will be a normal 400 with only a validation string message ``` ?fullValidationDetails=password ``` #### Expected Behavior Clients can expect a list of validation error mappings for the validation query field in the details provided on the response: ``` { \"code\": 400, \"message\": \"Password validation fail\", \"status\": \"INVALID_ARGUMENT\", \"details\": [ { \"fieldViolationsList\": [{ \"field\": \"password\", \"description\": \"passwordHistory\" }], '@type': 'type.googleapis.com/google.rpc.BadRequest', }, ], }, ``` (optional) try: - # Reset a system user's MFA token - api_instance.systemusers_resetmfa(id, content_type, accept, body=body, x_org_id=x_org_id) + # Update a system user + api_response = api_instance.systemusers_put(id, body=body, x_org_id=x_org_id, full_validation_details=full_validation_details) + pprint(api_response) except ApiException as e: - print("Exception when calling SystemusersApi->systemusers_resetmfa: %s\n" % e) + print("Exception when calling SystemusersApi->systemusers_put: %s\n" % e) ``` ### Parameters @@ -558,14 +582,13 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**Body1**](Body1.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**Systemuserput**](Systemuserput.md)| | [optional] + **x_org_id** | **str**| | [optional] + **full_validation_details** | **str**| This endpoint can take in a query when a client wants all validation errors to be returned with error response for the form field specified, i.e. 'password' #### Password validation flag Use the \"password\" validation flag to receive details on a possible bad request response Without the `password` flag, default behavior will be a normal 400 with only a validation string message ``` ?fullValidationDetails=password ``` #### Expected Behavior Clients can expect a list of validation error mappings for the validation query field in the details provided on the response: ``` { \"code\": 400, \"message\": \"Password validation fail\", \"status\": \"INVALID_ARGUMENT\", \"details\": [ { \"fieldViolationsList\": [{ \"field\": \"password\", \"description\": \"passwordHistory\" }], '@type': 'type.googleapis.com/google.rpc.BadRequest', }, ], }, ``` | [optional] ### Return type -void (empty response body) +[**Systemuserreturn**](Systemuserreturn.md) ### Authorization @@ -578,12 +601,12 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systemusers_systems_binding_list** -> object systemusers_systems_binding_list(id, content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) +# **systemusers_resetmfa** +> str systemusers_resetmfa(id, body=body, x_org_id=x_org_id) -List system user binding +Reset a system user's MFA token -Hidden as Tags is deprecated Adds or removes a system binding for a user. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). List system bindings for a specific system user in a system and user binding format. ### Examples #### List system bindings for specific system user ``` curl \\ -H 'Content-Type: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/systemusers/[SYSTEM_USER_ID_HERE]/systems\" ``` +This endpoint allows you to reset the TOTP key for a specified system user and put them in an TOTP MFA enrollment period. This will result in the user being prompted to setup TOTP MFA when logging into userportal. Please be aware that if the user does not complete TOTP MFA setup before the `exclusionUntil` date, they will be locked out of any resources that require TOTP MFA. Please refer to our [Knowledge Base Article](https://support.jumpcloud.com/customer/en/portal/articles/2959138-using-multifactor-authentication-with-jumpcloud) on setting up MFA for more information. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systemusers/{UserID}/resetmfa \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"exclusion\": true, \"exclusionUntil\": \"{date-time}\"}' ``` ### Example ```python @@ -602,21 +625,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SystemusersApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) -limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = '' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) (default to ) -filter = 'filter_example' # str | A filter to apply to the query. (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv1.IdResetmfaBody() # IdResetmfaBody | (optional) +x_org_id = 'x_org_id_example' # str | (optional) try: - # List system user binding - api_response = api_instance.systemusers_systems_binding_list(id, content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) + # Reset a system user's MFA token + api_response = api_instance.systemusers_resetmfa(id, body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: - print("Exception when calling SystemusersApi->systemusers_systems_binding_list: %s\n" % e) + print("Exception when calling SystemusersApi->systemusers_resetmfa: %s\n" % e) ``` ### Parameters @@ -624,18 +641,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] [default to ] - **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | **str**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [optional] [default to ] - **filter** | **str**| A filter to apply to the query. | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**IdResetmfaBody**](IdResetmfaBody.md)| | [optional] + **x_org_id** | **str**| | [optional] ### Return type -**object** +**str** ### Authorization @@ -644,16 +655,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: application/json, text/plain [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systemusers_systems_binding_put** -> Usersystembinding systemusers_systems_binding_put(id, content_type, accept, body=body, x_org_id=x_org_id) +# **systemusers_state_activate** +> str systemusers_state_activate(id, body=body) -Update a system user binding +Activate System User -Hidden as Tags is deprecated Adds or removes a system binding for a user. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). ### Example #### Add (or remove) system to system user ``` curl \\ -d '{ \"add\": [\"[SYSTEM_ID_TO_ADD_HERE]\"], \"remove\": [\"[SYSTEM_ID_TO_REMOVE_HERE]\"] }' \\ -X PUT \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/systemusers/[SYSTEM_USER_ID_HERE]/systems\" ``` +This endpoint changes the state of a STAGED user to ACTIVATED. #### Email Flag Use the \"email\" flag to determine whether or not to send a Welcome or Activation email to the newly activated user. Sending an empty body without the `email` flag, will send an email with default behavior (see the \"Behavior\" section below) ``` {} ``` Sending `email=true` flag will send an email with default behavior (see `Behavior` below) ``` { \"email\": true } ``` Populated email will override the default behavior and send to the specified email value ``` { \"email\": \"example@example.com\" } ``` Sending `email=false` will suppress sending the email ``` { \"email\": false } ``` #### Behavior Users with a password will be sent a Welcome email to: - The address specified in `email` flag in the request - If no `email` flag, the user's primary email address (default behavior) Users without a password will be sent an Activation email to: - The address specified in `email` flag in the request - If no `email` flag, the user's alternate email address (default behavior) - If no alternate email address, the user's primary email address (default behavior) #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/systemusers/{id}/state/activate \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: ' \\ -d '{ \"email\": \"alternate-activation-email@email.com\" }' ``` ### Example ```python @@ -672,17 +683,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SystemusersApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv1.Usersystembindingsput() # Usersystembindingsput | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv1.StateActivateBody() # StateActivateBody | (optional) try: - # Update a system user binding - api_response = api_instance.systemusers_systems_binding_put(id, content_type, accept, body=body, x_org_id=x_org_id) + # Activate System User + api_response = api_instance.systemusers_state_activate(id, body=body) pprint(api_response) except ApiException as e: - print("Exception when calling SystemusersApi->systemusers_systems_binding_put: %s\n" % e) + print("Exception when calling SystemusersApi->systemusers_state_activate: %s\n" % e) ``` ### Parameters @@ -690,14 +698,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**Usersystembindingsput**](Usersystembindingsput.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**StateActivateBody**](StateActivateBody.md)| | [optional] ### Return type -[**Usersystembinding**](Usersystembinding.md) +**str** ### Authorization @@ -711,7 +716,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **systemusers_unlock** -> systemusers_unlock(id, content_type, accept, x_org_id=x_org_id) +> str systemusers_unlock(id, x_org_id=x_org_id) Unlock a system user @@ -734,13 +739,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv1.SystemusersApi(jcapiv1.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | (optional) try: # Unlock a system user - api_instance.systemusers_unlock(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.systemusers_unlock(id, x_org_id=x_org_id) + pprint(api_response) except ApiException as e: print("Exception when calling SystemusersApi->systemusers_unlock: %s\n" % e) ``` @@ -750,13 +754,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| | [optional] ### Return type -void (empty response body) +**str** ### Authorization @@ -764,8 +766,8 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json, text/plain [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv1/docs/Systemuserslist.md b/jcapiv1/docs/Systemuserslist.md index f6c6a02..4626774 100644 --- a/jcapiv1/docs/Systemuserslist.md +++ b/jcapiv1/docs/Systemuserslist.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Tag.md b/jcapiv1/docs/Tag.md deleted file mode 100644 index e54b432..0000000 --- a/jcapiv1/docs/Tag.md +++ /dev/null @@ -1,21 +0,0 @@ -# Tag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | | [optional] -**expired** | **bool** | | [optional] -**external_dn** | **str** | | [optional] -**external_source_type** | **str** | | [optional] -**externally_managed** | **bool** | | [optional] -**group_gid** | **str** | | [optional] -**group_name** | **str** | | [optional] -**name** | **str** | A unique name for the Tag. | [optional] -**regular_expressions** | **list[str]** | | [optional] -**send_to_ldap** | **bool** | | [optional] -**systems** | **list[str]** | An array of system ids that are associated to the Tag. | [optional] -**systemusers** | **list[str]** | An array of system user ids that are associated to the Tag. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv1/docs/Tagpost.md b/jcapiv1/docs/Tagpost.md deleted file mode 100644 index 1adca78..0000000 --- a/jcapiv1/docs/Tagpost.md +++ /dev/null @@ -1,19 +0,0 @@ -# Tagpost - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**external_dn** | **str** | | [optional] -**external_source_type** | **str** | | [optional] -**externally_managed** | **bool** | | [optional] -**group_gid** | **str** | | [optional] -**group_name** | **str** | | [optional] -**name** | **str** | A unique name for the Tag. | -**regular_expressions** | **list[str]** | | [optional] -**send_to_ldap** | **bool** | | [optional] -**systems** | **list[str]** | An array of system ids that are associated to the Tag. | [optional] -**systemusers** | **list[str]** | An array of system user ids that are associated to the Tag. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv1/docs/Tagput.md b/jcapiv1/docs/Tagput.md deleted file mode 100644 index d5fc763..0000000 --- a/jcapiv1/docs/Tagput.md +++ /dev/null @@ -1,19 +0,0 @@ -# Tagput - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**external_dn** | **str** | | [optional] -**external_source_type** | **str** | | [optional] -**externally_managed** | **bool** | | [optional] -**group_gid** | **str** | | [optional] -**group_name** | **str** | | [optional] -**name** | **str** | A unique name for the Tag. | [optional] -**regular_expressions** | **list[str]** | | [optional] -**send_to_ldap** | **bool** | | [optional] -**systems** | **list[str]** | An array of system ids that are associated to the Tag. | [optional] -**systemusers** | **list[str]** | An array of system user ids that are associated to the Tag. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv1/docs/TagsApi.md b/jcapiv1/docs/TagsApi.md deleted file mode 100644 index b777359..0000000 --- a/jcapiv1/docs/TagsApi.md +++ /dev/null @@ -1,323 +0,0 @@ -# jcapiv1.TagsApi - -All URIs are relative to *https://console.jumpcloud.com/api* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**tags_delete**](TagsApi.md#tags_delete) | **DELETE** /tags/{name} | Delete a Tag -[**tags_get**](TagsApi.md#tags_get) | **GET** /Tags/{name} | List a Tag -[**tags_list**](TagsApi.md#tags_list) | **GET** /tags | List All Tags -[**tags_post**](TagsApi.md#tags_post) | **POST** /tags | Create a Tag -[**tags_put**](TagsApi.md#tags_put) | **PUT** /Tag/{name} | Update a Tag - - -# **tags_delete** -> Tag tags_delete(name, content_type, accept) - -Delete a Tag - -Hidden as Tags is deprecated Delete a Tag. - -### Example -```python -from __future__ import print_function -import time -import jcapiv1 -from jcapiv1.rest import ApiException -from pprint import pprint - -# Configure API key authorization: x-api-key -configuration = jcapiv1.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - -# create an instance of the API class -api_instance = jcapiv1.TagsApi(jcapiv1.ApiClient(configuration)) -name = 'name_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) - -try: - # Delete a Tag - api_response = api_instance.tags_delete(name, content_type, accept) - pprint(api_response) -except ApiException as e: - print("Exception when calling TagsApi->tags_delete: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - -### Return type - -[**Tag**](Tag.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tags_get** -> Tag tags_get(name, content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter) - -List a Tag - -Hidden as Tags is deprecated Returns a specific tag. - -### Example -```python -from __future__ import print_function -import time -import jcapiv1 -from jcapiv1.rest import ApiException -from pprint import pprint - -# Configure API key authorization: x-api-key -configuration = jcapiv1.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - -# create an instance of the API class -api_instance = jcapiv1.TagsApi(jcapiv1.ApiClient(configuration)) -name = 'name_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) -limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = '' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) (default to ) -filter = 'filter_example' # str | A filter to apply to the query. (optional) - -try: - # List a Tag - api_response = api_instance.tags_get(name, content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter) - pprint(api_response) -except ApiException as e: - print("Exception when calling TagsApi->tags_get: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] [default to ] - **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | **str**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [optional] [default to ] - **filter** | **str**| A filter to apply to the query. | [optional] - -### Return type - -[**Tag**](Tag.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tags_list** -> Tagslist tags_list(content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter) - -List All Tags - -Hidden as Tags is deprecated Returns all Tags. - -### Example -```python -from __future__ import print_function -import time -import jcapiv1 -from jcapiv1.rest import ApiException -from pprint import pprint - -# Configure API key authorization: x-api-key -configuration = jcapiv1.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - -# create an instance of the API class -api_instance = jcapiv1.TagsApi(jcapiv1.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = '' # str | Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. (optional) (default to ) -limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = '' # str | Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. (optional) (default to ) -filter = 'filter_example' # str | A filter to apply to the query. (optional) - -try: - # List All Tags - api_response = api_instance.tags_list(content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter) - pprint(api_response) -except ApiException as e: - print("Exception when calling TagsApi->tags_list: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | **str**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [optional] [default to ] - **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | **str**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [optional] [default to ] - **filter** | **str**| A filter to apply to the query. | [optional] - -### Return type - -[**Tagslist**](Tagslist.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tags_post** -> Tag tags_post(content_type, accept, body=body) - -Create a Tag - -Hidden as Tags is deprecated Create a tag. ### Examples #### Create a new Tag ``` curl \\ -d '{\"name\" : \"Developers\"}' \\ -X 'POST' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/tags\" ``` - -### Example -```python -from __future__ import print_function -import time -import jcapiv1 -from jcapiv1.rest import ApiException -from pprint import pprint - -# Configure API key authorization: x-api-key -configuration = jcapiv1.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - -# create an instance of the API class -api_instance = jcapiv1.TagsApi(jcapiv1.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv1.Tagpost() # Tagpost | (optional) - -try: - # Create a Tag - api_response = api_instance.tags_post(content_type, accept, body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling TagsApi->tags_post: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**Tagpost**](Tagpost.md)| | [optional] - -### Return type - -[**Tag**](Tag.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **tags_put** -> Tag tags_put(name, content_type, accept, body=body) - -Update a Tag - -Hidden as Tags is deprecated Update a specific tag. - -### Example -```python -from __future__ import print_function -import time -import jcapiv1 -from jcapiv1.rest import ApiException -from pprint import pprint - -# Configure API key authorization: x-api-key -configuration = jcapiv1.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - -# create an instance of the API class -api_instance = jcapiv1.TagsApi(jcapiv1.ApiClient(configuration)) -name = 'name_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv1.Tagput() # Tagput | (optional) - -try: - # Update a Tag - api_response = api_instance.tags_put(name, content_type, accept, body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling TagsApi->tags_put: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**Tagput**](Tagput.md)| | [optional] - -### Return type - -[**Tag**](Tag.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Triggerreturn.md b/jcapiv1/docs/Triggerreturn.md new file mode 100644 index 0000000..f8e39ec --- /dev/null +++ b/jcapiv1/docs/Triggerreturn.md @@ -0,0 +1,9 @@ +# Triggerreturn + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**triggered** | **list[str]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/TrustedappConfigGet.md b/jcapiv1/docs/TrustedappConfigGet.md new file mode 100644 index 0000000..c400f2c --- /dev/null +++ b/jcapiv1/docs/TrustedappConfigGet.md @@ -0,0 +1,10 @@ +# TrustedappConfigGet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**checksum** | **str** | Checksum to validate the trustedApp configuration for the organization | +**trusted_apps** | [**list[TrustedappConfigGetTrustedApps]**](TrustedappConfigGetTrustedApps.md) | List of authorized apps for the organization | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/TrustedappConfigGetTrustedApps.md b/jcapiv1/docs/TrustedappConfigGetTrustedApps.md new file mode 100644 index 0000000..c5dbbe9 --- /dev/null +++ b/jcapiv1/docs/TrustedappConfigGetTrustedApps.md @@ -0,0 +1,11 @@ +# TrustedappConfigGetTrustedApps + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name of the trusted application | +**path** | **str** | Absolute path for the app's location in user's device | [optional] +**teamid** | **str** | App's Team ID | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/TrustedappConfigPut.md b/jcapiv1/docs/TrustedappConfigPut.md new file mode 100644 index 0000000..32fea14 --- /dev/null +++ b/jcapiv1/docs/TrustedappConfigPut.md @@ -0,0 +1,9 @@ +# TrustedappConfigPut + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**trusted_apps** | [**list[TrustedappConfigGetTrustedApps]**](TrustedappConfigGetTrustedApps.md) | List of authorized apps for the organization | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Userput.md b/jcapiv1/docs/Userput.md new file mode 100644 index 0000000..18d1af1 --- /dev/null +++ b/jcapiv1/docs/Userput.md @@ -0,0 +1,15 @@ +# Userput + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **str** | | [optional] +**enable_multi_factor** | **bool** | | [optional] +**firstname** | **str** | | [optional] +**growth_data** | **object** | | [optional] +**last_whats_new_checked** | **date** | | [optional] +**lastname** | **str** | | [optional] +**role_name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Userreturn.md b/jcapiv1/docs/Userreturn.md new file mode 100644 index 0000000..bbc6004 --- /dev/null +++ b/jcapiv1/docs/Userreturn.md @@ -0,0 +1,25 @@ +# Userreturn + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**created** | **datetime** | | [optional] +**disable_introduction** | **bool** | | [optional] +**email** | **str** | | [optional] +**enable_multi_factor** | **bool** | | [optional] +**firstname** | **str** | | [optional] +**growth_data** | [**UserreturnGrowthData**](UserreturnGrowthData.md) | | [optional] +**last_whats_new_checked** | **datetime** | | [optional] +**lastname** | **str** | | [optional] +**organization** | **str** | | [optional] +**provider** | **str** | | [optional] +**role** | **str** | | [optional] +**role_name** | **str** | | [optional] +**session_count** | **int** | | [optional] +**suspended** | **bool** | | [optional] +**totp_enrolled** | **bool** | | [optional] +**users_time_zone** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/UserreturnGrowthData.md b/jcapiv1/docs/UserreturnGrowthData.md new file mode 100644 index 0000000..d3c8137 --- /dev/null +++ b/jcapiv1/docs/UserreturnGrowthData.md @@ -0,0 +1,10 @@ +# UserreturnGrowthData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**experiment_states** | **object** | | [optional] +**onboarding_state** | **object** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/UsersApi.md b/jcapiv1/docs/UsersApi.md new file mode 100644 index 0000000..9b6ce84 --- /dev/null +++ b/jcapiv1/docs/UsersApi.md @@ -0,0 +1,174 @@ +# jcapiv1.UsersApi + +All URIs are relative to *https://console.jumpcloud.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**admin_totpreset_begin**](UsersApi.md#admin_totpreset_begin) | **POST** /users/resettotp/{id} | Administrator TOTP Reset Initiation +[**users_put**](UsersApi.md#users_put) | **PUT** /users/{id} | Update a user +[**users_reactivate_get**](UsersApi.md#users_reactivate_get) | **GET** /users/reactivate/{id} | Administrator Password Reset Initiation + +# **admin_totpreset_begin** +> admin_totpreset_begin(id) + +Administrator TOTP Reset Initiation + +This endpoint initiates a TOTP reset for an admin. This request does not accept a body. + +### Example +```python +from __future__ import print_function +import time +import jcapiv1 +from jcapiv1.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.UsersApi(jcapiv1.ApiClient(configuration)) +id = 'id_example' # str | + +try: + # Administrator TOTP Reset Initiation + api_instance.admin_totpreset_begin(id) +except ApiException as e: + print("Exception when calling UsersApi->admin_totpreset_begin: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **users_put** +> Userreturn users_put(id, body=body, x_org_id=x_org_id) + +Update a user + +This endpoint allows you to update a user. + +### Example +```python +from __future__ import print_function +import time +import jcapiv1 +from jcapiv1.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.UsersApi(jcapiv1.ApiClient(configuration)) +id = 'id_example' # str | +body = jcapiv1.Userput() # Userput | (optional) +x_org_id = 'x_org_id_example' # str | (optional) + +try: + # Update a user + api_response = api_instance.users_put(id, body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling UsersApi->users_put: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **body** | [**Userput**](Userput.md)| | [optional] + **x_org_id** | **str**| | [optional] + +### Return type + +[**Userreturn**](Userreturn.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **users_reactivate_get** +> users_reactivate_get(id) + +Administrator Password Reset Initiation + +This endpoint triggers the sending of a reactivation e-mail to an administrator. + +### Example +```python +from __future__ import print_function +import time +import jcapiv1 +from jcapiv1.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv1.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv1.UsersApi(jcapiv1.ApiClient(configuration)) +id = 'id_example' # str | + +try: + # Administrator Password Reset Initiation + api_instance.users_reactivate_get(id) +except ApiException as e: + print("Exception when calling UsersApi->users_reactivate_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Usersystembindingsput.md b/jcapiv1/docs/Usersystembindingsput.md deleted file mode 100644 index ae44404..0000000 --- a/jcapiv1/docs/Usersystembindingsput.md +++ /dev/null @@ -1,11 +0,0 @@ -# Usersystembindingsput - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**add** | **list[str]** | The list of system ids to be added to this user. | -**remove** | **list[str]** | The list of system ids to be removed from this user. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv1/jcapiv1/__init__.py b/jcapiv1/jcapiv1/__init__.py index 5d2c7ee..e5b049e 100644 --- a/jcapiv1/jcapiv1/__init__.py +++ b/jcapiv1/jcapiv1/__init__.py @@ -3,16 +3,15 @@ # flake8: noqa """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import # import apis into sdk package @@ -21,13 +20,13 @@ from jcapiv1.api.command_results_api import CommandResultsApi from jcapiv1.api.command_triggers_api import CommandTriggersApi from jcapiv1.api.commands_api import CommandsApi +from jcapiv1.api.managed_service_provider_api import ManagedServiceProviderApi from jcapiv1.api.organizations_api import OrganizationsApi from jcapiv1.api.radius_servers_api import RadiusServersApi from jcapiv1.api.search_api import SearchApi from jcapiv1.api.systems_api import SystemsApi from jcapiv1.api.systemusers_api import SystemusersApi -from jcapiv1.api.tags_api import TagsApi - +from jcapiv1.api.users_api import UsersApi # import ApiClient from jcapiv1.api_client import ApiClient from jcapiv1.configuration import Configuration @@ -40,12 +39,14 @@ from jcapiv1.models.application_config_constant_attributes import ApplicationConfigConstantAttributes from jcapiv1.models.application_config_constant_attributes_value import ApplicationConfigConstantAttributesValue from jcapiv1.models.application_config_database_attributes import ApplicationConfigDatabaseAttributes +from jcapiv1.models.application_logo import ApplicationLogo from jcapiv1.models.applicationslist import Applicationslist from jcapiv1.models.applicationtemplate import Applicationtemplate from jcapiv1.models.applicationtemplate_jit import ApplicationtemplateJit +from jcapiv1.models.applicationtemplate_logo import ApplicationtemplateLogo +from jcapiv1.models.applicationtemplate_oidc import ApplicationtemplateOidc +from jcapiv1.models.applicationtemplate_provision import ApplicationtemplateProvision from jcapiv1.models.applicationtemplateslist import Applicationtemplateslist -from jcapiv1.models.body import Body -from jcapiv1.models.body1 import Body1 from jcapiv1.models.command import Command from jcapiv1.models.commandfilereturn import Commandfilereturn from jcapiv1.models.commandfilereturn_results import CommandfilereturnResults @@ -53,43 +54,83 @@ from jcapiv1.models.commandresult_response import CommandresultResponse from jcapiv1.models.commandresult_response_data import CommandresultResponseData from jcapiv1.models.commandresultslist import Commandresultslist +from jcapiv1.models.commandresultslist_results import CommandresultslistResults from jcapiv1.models.commandslist import Commandslist from jcapiv1.models.commandslist_results import CommandslistResults -from jcapiv1.models.errorresponse import Errorresponse +from jcapiv1.models.error import Error +from jcapiv1.models.error_details import ErrorDetails from jcapiv1.models.fde import Fde +from jcapiv1.models.id_resetmfa_body import IdResetmfaBody from jcapiv1.models.mfa import Mfa +from jcapiv1.models.mfa_enrollment import MfaEnrollment +from jcapiv1.models.mfa_enrollment_status import MfaEnrollmentStatus +from jcapiv1.models.organization import Organization +from jcapiv1.models.organizationentitlement import Organizationentitlement +from jcapiv1.models.organizationentitlement_entitlement_products import OrganizationentitlementEntitlementProducts +from jcapiv1.models.organizations_id_body import OrganizationsIdBody +from jcapiv1.models.organizationsettings import Organizationsettings +from jcapiv1.models.organizationsettings_display_preferences import OrganizationsettingsDisplayPreferences +from jcapiv1.models.organizationsettings_display_preferences_org_insights import OrganizationsettingsDisplayPreferencesOrgInsights +from jcapiv1.models.organizationsettings_display_preferences_org_insights_applications_usage import OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage +from jcapiv1.models.organizationsettings_display_preferences_org_insights_console_stats import OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats +from jcapiv1.models.organizationsettings_display_preferences_org_insights_device_notifications import OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications +from jcapiv1.models.organizationsettings_display_preferences_org_insights_user_notifications import OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications +from jcapiv1.models.organizationsettings_features import OrganizationsettingsFeatures +from jcapiv1.models.organizationsettings_features_directory_insights import OrganizationsettingsFeaturesDirectoryInsights +from jcapiv1.models.organizationsettings_features_directory_insights_premium import OrganizationsettingsFeaturesDirectoryInsightsPremium +from jcapiv1.models.organizationsettings_features_system_insights import OrganizationsettingsFeaturesSystemInsights +from jcapiv1.models.organizationsettings_new_system_user_state_defaults import OrganizationsettingsNewSystemUserStateDefaults +from jcapiv1.models.organizationsettings_password_policy import OrganizationsettingsPasswordPolicy +from jcapiv1.models.organizationsettings_user_portal import OrganizationsettingsUserPortal +from jcapiv1.models.organizationsettingsput import Organizationsettingsput +from jcapiv1.models.organizationsettingsput_new_system_user_state_defaults import OrganizationsettingsputNewSystemUserStateDefaults +from jcapiv1.models.organizationsettingsput_password_policy import OrganizationsettingsputPasswordPolicy from jcapiv1.models.organizationslist import Organizationslist from jcapiv1.models.organizationslist_results import OrganizationslistResults from jcapiv1.models.radiusserver import Radiusserver from jcapiv1.models.radiusserverpost import Radiusserverpost from jcapiv1.models.radiusserverput import Radiusserverput +from jcapiv1.models.radiusservers_id_body import RadiusserversIdBody from jcapiv1.models.radiusserverslist import Radiusserverslist from jcapiv1.models.search import Search from jcapiv1.models.sshkeylist import Sshkeylist from jcapiv1.models.sshkeypost import Sshkeypost +from jcapiv1.models.sso import Sso +from jcapiv1.models.state_activate_body import StateActivateBody from jcapiv1.models.system import System +from jcapiv1.models.system_built_in_commands import SystemBuiltInCommands +from jcapiv1.models.system_domain_info import SystemDomainInfo +from jcapiv1.models.system_mdm import SystemMdm +from jcapiv1.models.system_mdm_internal import SystemMdmInternal from jcapiv1.models.system_network_interfaces import SystemNetworkInterfaces +from jcapiv1.models.system_os_version_detail import SystemOsVersionDetail +from jcapiv1.models.system_provision_metadata import SystemProvisionMetadata +from jcapiv1.models.system_provision_metadata_provisioner import SystemProvisionMetadataProvisioner +from jcapiv1.models.system_service_account_state import SystemServiceAccountState from jcapiv1.models.system_sshd_params import SystemSshdParams from jcapiv1.models.system_system_insights import SystemSystemInsights +from jcapiv1.models.system_user_metrics import SystemUserMetrics from jcapiv1.models.systemput import Systemput from jcapiv1.models.systemput_agent_bound_messages import SystemputAgentBoundMessages from jcapiv1.models.systemslist import Systemslist -from jcapiv1.models.systemuser import Systemuser -from jcapiv1.models.systemuserbinding import Systemuserbinding -from jcapiv1.models.systemuserbindingsput import Systemuserbindingsput from jcapiv1.models.systemuserput import Systemuserput from jcapiv1.models.systemuserput_addresses import SystemuserputAddresses +from jcapiv1.models.systemuserput_attributes import SystemuserputAttributes from jcapiv1.models.systemuserput_phone_numbers import SystemuserputPhoneNumbers +from jcapiv1.models.systemuserput_relationships import SystemuserputRelationships from jcapiv1.models.systemuserputpost import Systemuserputpost from jcapiv1.models.systemuserputpost_addresses import SystemuserputpostAddresses from jcapiv1.models.systemuserputpost_phone_numbers import SystemuserputpostPhoneNumbers +from jcapiv1.models.systemuserputpost_recovery_email import SystemuserputpostRecoveryEmail from jcapiv1.models.systemuserreturn import Systemuserreturn from jcapiv1.models.systemuserreturn_addresses import SystemuserreturnAddresses from jcapiv1.models.systemuserreturn_phone_numbers import SystemuserreturnPhoneNumbers +from jcapiv1.models.systemuserreturn_recovery_email import SystemuserreturnRecoveryEmail from jcapiv1.models.systemuserslist import Systemuserslist -from jcapiv1.models.tag import Tag -from jcapiv1.models.tagpost import Tagpost -from jcapiv1.models.tagput import Tagput -from jcapiv1.models.tagslist import Tagslist -from jcapiv1.models.usersystembinding import Usersystembinding -from jcapiv1.models.usersystembindingsput import Usersystembindingsput +from jcapiv1.models.triggerreturn import Triggerreturn +from jcapiv1.models.trustedapp_config_get import TrustedappConfigGet +from jcapiv1.models.trustedapp_config_get_trusted_apps import TrustedappConfigGetTrustedApps +from jcapiv1.models.trustedapp_config_put import TrustedappConfigPut +from jcapiv1.models.userput import Userput +from jcapiv1.models.userreturn import Userreturn +from jcapiv1.models.userreturn_growth_data import UserreturnGrowthData diff --git a/jcapiv1/jcapiv1/api/__init__.py b/jcapiv1/jcapiv1/api/__init__.py index c0df0b4..3000162 100644 --- a/jcapiv1/jcapiv1/api/__init__.py +++ b/jcapiv1/jcapiv1/api/__init__.py @@ -8,9 +8,10 @@ from jcapiv1.api.command_results_api import CommandResultsApi from jcapiv1.api.command_triggers_api import CommandTriggersApi from jcapiv1.api.commands_api import CommandsApi +from jcapiv1.api.managed_service_provider_api import ManagedServiceProviderApi from jcapiv1.api.organizations_api import OrganizationsApi from jcapiv1.api.radius_servers_api import RadiusServersApi from jcapiv1.api.search_api import SearchApi from jcapiv1.api.systems_api import SystemsApi from jcapiv1.api.systemusers_api import SystemusersApi -from jcapiv1.api.tags_api import TagsApi +from jcapiv1.api.users_api import UsersApi diff --git a/jcapiv1/jcapiv1/api/application_templates_api.py b/jcapiv1/jcapiv1/api/application_templates_api.py index 524b78f..7f1eda7 100644 --- a/jcapiv1/jcapiv1/api/application_templates_api.py +++ b/jcapiv1/jcapiv1/api/application_templates_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,61 +32,57 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def application_templates_get(self, id, content_type, accept, **kwargs): # noqa: E501 + def application_templates_get(self, id, **kwargs): # noqa: E501 """Get an Application Template # noqa: E501 The endpoint returns a specific SSO / SAML Application Template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/application-templates/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.application_templates_get(id, content_type, accept, async_req=True) + >>> thread = api.application_templates_get(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str fields: The comma separated fields included in the returned records. If omitted the default list of fields will be returned. + :param str fields: The space separated fields included in the returned records. If omitted the default list of fields will be returned. :param int limit: The number of records to return at once. :param int skip: The offset into the records to return. - :param str sort: - :param str filter: A filter to apply to the query. - :param str x_org_id: + :param str sort: The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param str x_org_id: :return: Applicationtemplate If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.application_templates_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.application_templates_get_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.application_templates_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.application_templates_get_with_http_info(id, **kwargs) # noqa: E501 return data - def application_templates_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def application_templates_get_with_http_info(self, id, **kwargs): # noqa: E501 """Get an Application Template # noqa: E501 The endpoint returns a specific SSO / SAML Application Template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/application-templates/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.application_templates_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.application_templates_get_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str fields: The comma separated fields included in the returned records. If omitted the default list of fields will be returned. + :param str fields: The space separated fields included in the returned records. If omitted the default list of fields will be returned. :param int limit: The number of records to return at once. :param int skip: The offset into the records to return. - :param str sort: - :param str filter: A filter to apply to the query. - :param str x_org_id: + :param str sort: The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param str x_org_id: :return: Applicationtemplate If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'fields', 'limit', 'skip', 'sort', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['id', 'fields', 'limit', 'skip', 'sort', 'filter', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -106,14 +101,6 @@ def application_templates_get_with_http_info(self, id, content_type, accept, **k if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `application_templates_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `application_templates_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `application_templates_get`") # noqa: E501 collection_formats = {} @@ -134,10 +121,6 @@ def application_templates_get_with_http_info(self, id, content_type, accept, **k query_params.append(('filter', params['filter'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -149,10 +132,6 @@ def application_templates_get_with_http_info(self, id, content_type, accept, **k header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -172,59 +151,55 @@ def application_templates_get_with_http_info(self, id, content_type, accept, **k _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def application_templates_list(self, content_type, accept, **kwargs): # noqa: E501 + def application_templates_list(self, **kwargs): # noqa: E501 """List Application Templates # noqa: E501 The endpoint returns all the SSO / SAML Application Templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/application-templates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.application_templates_list(content_type, accept, async_req=True) + >>> thread = api.application_templates_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param str fields: The comma separated fields included in the returned records. If omitted the default list of fields will be returned. + :param str fields: The space separated fields included in the returned records. If omitted the default list of fields will be returned. :param int limit: The number of records to return at once. :param int skip: The offset into the records to return. - :param str sort: - :param str filter: A filter to apply to the query. - :param str x_org_id: + :param str sort: The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param str x_org_id: :return: Applicationtemplateslist If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.application_templates_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.application_templates_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.application_templates_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.application_templates_list_with_http_info(**kwargs) # noqa: E501 return data - def application_templates_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def application_templates_list_with_http_info(self, **kwargs): # noqa: E501 """List Application Templates # noqa: E501 The endpoint returns all the SSO / SAML Application Templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/application-templates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.application_templates_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.application_templates_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param str fields: The comma separated fields included in the returned records. If omitted the default list of fields will be returned. + :param str fields: The space separated fields included in the returned records. If omitted the default list of fields will be returned. :param int limit: The number of records to return at once. :param int skip: The offset into the records to return. - :param str sort: - :param str filter: A filter to apply to the query. - :param str x_org_id: + :param str sort: The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param str x_org_id: :return: Applicationtemplateslist If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'fields', 'limit', 'skip', 'sort', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['fields', 'limit', 'skip', 'sort', 'filter', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -239,14 +214,6 @@ def application_templates_list_with_http_info(self, content_type, accept, **kwar ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `application_templates_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `application_templates_list`") # noqa: E501 collection_formats = {} @@ -265,10 +232,6 @@ def application_templates_list_with_http_info(self, content_type, accept, **kwar query_params.append(('filter', params['filter'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -280,10 +243,6 @@ def application_templates_list_with_http_info(self, content_type, accept, **kwar header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 diff --git a/jcapiv1/jcapiv1/api/applications_api.py b/jcapiv1/jcapiv1/api/applications_api.py index 41e2bb3..9095aeb 100644 --- a/jcapiv1/jcapiv1/api/applications_api.py +++ b/jcapiv1/jcapiv1/api/applications_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -44,8 +43,6 @@ def applications_delete(self, id, **kwargs): # noqa: E501 :param async_req bool :param str id: (required) - :param str content_type: - :param str accept: :param str x_org_id: :return: Application If the method is called asynchronously, @@ -69,15 +66,13 @@ def applications_delete_with_http_info(self, id, **kwargs): # noqa: E501 :param async_req bool :param str id: (required) - :param str content_type: - :param str accept: :param str x_org_id: :return: Application If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -106,10 +101,6 @@ def applications_delete_with_http_info(self, id, **kwargs): # noqa: E501 query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -121,10 +112,6 @@ def applications_delete_with_http_info(self, id, **kwargs): # noqa: E501 header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -155,8 +142,6 @@ def applications_get(self, id, **kwargs): # noqa: E501 :param async_req bool :param str id: (required) - :param str content_type: - :param str accept: :param str x_org_id: :return: Application If the method is called asynchronously, @@ -180,15 +165,13 @@ def applications_get_with_http_info(self, id, **kwargs): # noqa: E501 :param async_req bool :param str id: (required) - :param str content_type: - :param str accept: :param str x_org_id: :return: Application If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -217,10 +200,6 @@ def applications_get_with_http_info(self, id, **kwargs): # noqa: E501 query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -232,10 +211,6 @@ def applications_get_with_http_info(self, id, **kwargs): # noqa: E501 header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -255,59 +230,55 @@ def applications_get_with_http_info(self, id, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def applications_list(self, content_type, accept, **kwargs): # noqa: E501 + def applications_list(self, **kwargs): # noqa: E501 """Applications # noqa: E501 The endpoint returns all your SSO / SAML Applications. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.applications_list(content_type, accept, async_req=True) + >>> thread = api.applications_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param str fields: The comma separated fields included in the returned records. If omitted the default list of fields will be returned. + :param str fields: The space separated fields included in the returned records. If omitted the default list of fields will be returned. :param int limit: The number of records to return at once. :param int skip: The offset into the records to return. - :param str sort: - :param str filter: A filter to apply to the query. - :param str x_org_id: + :param str sort: The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param str x_org_id: :return: Applicationslist If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.applications_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.applications_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.applications_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.applications_list_with_http_info(**kwargs) # noqa: E501 return data - def applications_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def applications_list_with_http_info(self, **kwargs): # noqa: E501 """Applications # noqa: E501 The endpoint returns all your SSO / SAML Applications. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.applications_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.applications_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param str fields: The comma separated fields included in the returned records. If omitted the default list of fields will be returned. + :param str fields: The space separated fields included in the returned records. If omitted the default list of fields will be returned. :param int limit: The number of records to return at once. :param int skip: The offset into the records to return. - :param str sort: - :param str filter: A filter to apply to the query. - :param str x_org_id: + :param str sort: The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param str x_org_id: :return: Applicationslist If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'fields', 'limit', 'skip', 'sort', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['fields', 'limit', 'skip', 'sort', 'filter', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -322,14 +293,6 @@ def applications_list_with_http_info(self, content_type, accept, **kwargs): # n ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `applications_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `applications_list`") # noqa: E501 collection_formats = {} @@ -348,10 +311,6 @@ def applications_list_with_http_info(self, content_type, accept, **kwargs): # n query_params.append(('filter', params['filter'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -363,10 +322,6 @@ def applications_list_with_http_info(self, content_type, accept, **kwargs): # n header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -397,8 +352,6 @@ def applications_post(self, **kwargs): # noqa: E501 :param async_req bool :param Application body: - :param str content_type: - :param str accept: :param str x_org_id: :return: Application If the method is called asynchronously, @@ -422,15 +375,13 @@ def applications_post_with_http_info(self, **kwargs): # noqa: E501 :param async_req bool :param Application body: - :param str content_type: - :param str accept: :param str x_org_id: :return: Application If the method is called asynchronously, returns the request thread. """ - all_params = ['body', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -453,10 +404,6 @@ def applications_post_with_http_info(self, **kwargs): # noqa: E501 query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -496,7 +443,7 @@ def applications_post_with_http_info(self, **kwargs): # noqa: E501 def applications_put(self, id, **kwargs): # noqa: E501 """Update an Application # noqa: E501 - The endpoint updates a SSO / SAML Application. # noqa: E501 + The endpoint updates a SSO / SAML Application. Any fields not provided will be reset or created with default values. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.applications_put(id, async_req=True) @@ -505,8 +452,6 @@ def applications_put(self, id, **kwargs): # noqa: E501 :param async_req bool :param str id: (required) :param Application body: - :param str content_type: - :param str accept: :param str x_org_id: :return: Application If the method is called asynchronously, @@ -522,7 +467,7 @@ def applications_put(self, id, **kwargs): # noqa: E501 def applications_put_with_http_info(self, id, **kwargs): # noqa: E501 """Update an Application # noqa: E501 - The endpoint updates a SSO / SAML Application. # noqa: E501 + The endpoint updates a SSO / SAML Application. Any fields not provided will be reset or created with default values. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.applications_put_with_http_info(id, async_req=True) @@ -531,15 +476,13 @@ def applications_put_with_http_info(self, id, **kwargs): # noqa: E501 :param async_req bool :param str id: (required) :param Application body: - :param str content_type: - :param str accept: :param str x_org_id: :return: Application If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'body', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -568,10 +511,6 @@ def applications_put_with_http_info(self, id, **kwargs): # noqa: E501 query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 diff --git a/jcapiv1/jcapiv1/api/command_results_api.py b/jcapiv1/jcapiv1/api/command_results_api.py index 2e03014..1e7ef07 100644 --- a/jcapiv1/jcapiv1/api/command_results_api.py +++ b/jcapiv1/jcapiv1/api/command_results_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,51 +32,47 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def command_results_delete(self, id, content_type, accept, **kwargs): # noqa: E501 + def command_results_delete(self, id, **kwargs): # noqa: E501 """Delete a Command result # noqa: E501 - This endpoint deletes a specific command result. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ```` # noqa: E501 + This endpoint deletes a specific command result. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/commandresults/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ```` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.command_results_delete(id, content_type, accept, async_req=True) + >>> thread = api.command_results_delete(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: :return: Commandresult If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.command_results_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.command_results_delete_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.command_results_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.command_results_delete_with_http_info(id, **kwargs) # noqa: E501 return data - def command_results_delete_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def command_results_delete_with_http_info(self, id, **kwargs): # noqa: E501 """Delete a Command result # noqa: E501 - This endpoint deletes a specific command result. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ```` # noqa: E501 + This endpoint deletes a specific command result. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/commandresults/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ```` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.command_results_delete_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.command_results_delete_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: :return: Commandresult If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -96,14 +91,6 @@ def command_results_delete_with_http_info(self, id, content_type, accept, **kwar if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `command_results_delete`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `command_results_delete`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `command_results_delete`") # noqa: E501 collection_formats = {} @@ -114,10 +101,6 @@ def command_results_delete_with_http_info(self, id, content_type, accept, **kwar query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -129,10 +112,6 @@ def command_results_delete_with_http_info(self, id, content_type, accept, **kwar header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -152,55 +131,51 @@ def command_results_delete_with_http_info(self, id, content_type, accept, **kwar _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def command_results_get(self, id, content_type, accept, **kwargs): # noqa: E501 + def command_results_get(self, id, **kwargs): # noqa: E501 """List an individual Command result # noqa: E501 This endpoint returns a specific command result. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults/{CommandResultID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.command_results_get(id, content_type, accept, async_req=True) + >>> thread = api.command_results_get(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param str filter: A filter to apply to the query. - :param str x_org_id: + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param str x_org_id: :return: Commandresult If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.command_results_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.command_results_get_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.command_results_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.command_results_get_with_http_info(id, **kwargs) # noqa: E501 return data - def command_results_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def command_results_get_with_http_info(self, id, **kwargs): # noqa: E501 """List an individual Command result # noqa: E501 This endpoint returns a specific command result. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults/{CommandResultID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.command_results_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.command_results_get_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param str filter: A filter to apply to the query. - :param str x_org_id: + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param str x_org_id: :return: Commandresult If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'fields', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['id', 'fields', 'filter', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -219,14 +194,6 @@ def command_results_get_with_http_info(self, id, content_type, accept, **kwargs) if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `command_results_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `command_results_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `command_results_get`") # noqa: E501 collection_formats = {} @@ -241,10 +208,6 @@ def command_results_get_with_http_info(self, id, content_type, accept, **kwargs) query_params.append(('filter', params['filter'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -256,10 +219,6 @@ def command_results_get_with_http_info(self, id, content_type, accept, **kwargs) header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -279,59 +238,55 @@ def command_results_get_with_http_info(self, id, content_type, accept, **kwargs) _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def command_results_list(self, content_type, accept, **kwargs): # noqa: E501 + def command_results_list(self, **kwargs): # noqa: E501 """List all Command Results # noqa: E501 This endpoint returns all command results. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key:{API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.command_results_list(content_type, accept, async_req=True) + >>> thread = api.command_results_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: :param int skip: The offset into the records to return. :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str filter: A filter to apply to the query. - :param str x_org_id: :return: Commandresultslist If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.command_results_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.command_results_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.command_results_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.command_results_list_with_http_info(**kwargs) # noqa: E501 return data - def command_results_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def command_results_list_with_http_info(self, **kwargs): # noqa: E501 """List all Command Results # noqa: E501 This endpoint returns all command results. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key:{API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.command_results_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.command_results_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: :param int skip: The offset into the records to return. :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str filter: A filter to apply to the query. - :param str x_org_id: :return: Commandresultslist If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'fields', 'limit', 'skip', 'sort', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['fields', 'filter', 'limit', 'x_org_id', 'skip', 'sort'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -346,17 +301,7 @@ def command_results_list_with_http_info(self, content_type, accept, **kwargs): ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `command_results_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `command_results_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `command_results_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -364,20 +309,16 @@ def command_results_list_with_http_info(self, content_type, accept, **kwargs): query_params = [] if 'fields' in params: query_params.append(('fields', params['fields'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 if 'sort' in params: query_params.append(('sort', params['sort'])) # noqa: E501 - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -389,10 +330,6 @@ def command_results_list_with_http_info(self, content_type, accept, **kwargs): header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 diff --git a/jcapiv1/jcapiv1/api/command_triggers_api.py b/jcapiv1/jcapiv1/api/command_triggers_api.py index 9c3986f..df1d05d 100644 --- a/jcapiv1/jcapiv1/api/command_triggers_api.py +++ b/jcapiv1/jcapiv1/api/command_triggers_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,51 +32,49 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def command_trigger_webhook_post(self, triggername, content_type, accept, **kwargs): # noqa: E501 + def command_trigger_webhook_post(self, triggername, **kwargs): # noqa: E501 """Launch a command via a Trigger # noqa: E501 This endpoint allows you to launch a command based on a defined trigger. #### Sample Requests **Launch a Command via a Trigger** ``` curl --silent \\ -X 'POST' \\ -H \"x-api-key: {API_KEY}\" \\ \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\" ``` **Launch a Command via a Trigger passing a JSON object to the command** ``` curl --silent \\ -X 'POST' \\ -H \"x-api-key: {API_KEY}\" \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -d '{ \"srcip\":\"192.168.2.32\", \"attack\":\"Cross Site Scripting Attempt\" }' \\ \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\" ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.command_trigger_webhook_post(triggername, content_type, accept, async_req=True) + >>> thread = api.command_trigger_webhook_post(triggername, async_req=True) >>> result = thread.get() :param async_req bool :param str triggername: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: None + :param object body: + :param str x_org_id: + :return: Triggerreturn If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.command_trigger_webhook_post_with_http_info(triggername, content_type, accept, **kwargs) # noqa: E501 + return self.command_trigger_webhook_post_with_http_info(triggername, **kwargs) # noqa: E501 else: - (data) = self.command_trigger_webhook_post_with_http_info(triggername, content_type, accept, **kwargs) # noqa: E501 + (data) = self.command_trigger_webhook_post_with_http_info(triggername, **kwargs) # noqa: E501 return data - def command_trigger_webhook_post_with_http_info(self, triggername, content_type, accept, **kwargs): # noqa: E501 + def command_trigger_webhook_post_with_http_info(self, triggername, **kwargs): # noqa: E501 """Launch a command via a Trigger # noqa: E501 This endpoint allows you to launch a command based on a defined trigger. #### Sample Requests **Launch a Command via a Trigger** ``` curl --silent \\ -X 'POST' \\ -H \"x-api-key: {API_KEY}\" \\ \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\" ``` **Launch a Command via a Trigger passing a JSON object to the command** ``` curl --silent \\ -X 'POST' \\ -H \"x-api-key: {API_KEY}\" \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -d '{ \"srcip\":\"192.168.2.32\", \"attack\":\"Cross Site Scripting Attempt\" }' \\ \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\" ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.command_trigger_webhook_post_with_http_info(triggername, content_type, accept, async_req=True) + >>> thread = api.command_trigger_webhook_post_with_http_info(triggername, async_req=True) >>> result = thread.get() :param async_req bool :param str triggername: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: None + :param object body: + :param str x_org_id: + :return: Triggerreturn If the method is called asynchronously, returns the request thread. """ - all_params = ['triggername', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['triggername', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -96,14 +93,6 @@ def command_trigger_webhook_post_with_http_info(self, triggername, content_type, if ('triggername' not in params or params['triggername'] is None): raise ValueError("Missing the required parameter `triggername` when calling `command_trigger_webhook_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `command_trigger_webhook_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `command_trigger_webhook_post`") # noqa: E501 collection_formats = {} @@ -114,10 +103,6 @@ def command_trigger_webhook_post_with_http_info(self, triggername, content_type, query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -125,6 +110,8 @@ def command_trigger_webhook_post_with_http_info(self, triggername, content_type, local_var_files = {} body_params = None + if 'body' in params: + body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 @@ -144,7 +131,7 @@ def command_trigger_webhook_post_with_http_info(self, triggername, content_type, body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='Triggerreturn', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/jcapiv1/jcapiv1/api/commands_api.py b/jcapiv1/jcapiv1/api/commands_api.py index d3b178d..3fe16f8 100644 --- a/jcapiv1/jcapiv1/api/commands_api.py +++ b/jcapiv1/jcapiv1/api/commands_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,57 +32,53 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def command_file_get(self, id, content_type, accept, **kwargs): # noqa: E501 + def command_file_get(self, id, **kwargs): # noqa: E501 """Get a Command File # noqa: E501 This endpoint returns the uploaded file(s) associated with a specific command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/files/command/{commandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.command_file_get(id, content_type, accept, async_req=True) + >>> thread = api.command_file_get(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: :param int skip: The offset into the records to return. - :param str x_org_id: :return: Commandfilereturn If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.command_file_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.command_file_get_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.command_file_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.command_file_get_with_http_info(id, **kwargs) # noqa: E501 return data - def command_file_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def command_file_get_with_http_info(self, id, **kwargs): # noqa: E501 """Get a Command File # noqa: E501 This endpoint returns the uploaded file(s) associated with a specific command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/files/command/{commandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.command_file_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.command_file_get_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: :param int skip: The offset into the records to return. - :param str x_org_id: :return: Commandfilereturn If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'fields', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['id', 'fields', 'limit', 'x_org_id', 'skip'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -102,17 +97,7 @@ def command_file_get_with_http_info(self, id, content_type, accept, **kwargs): if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `command_file_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `command_file_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `command_file_get`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `command_file_get`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -128,10 +113,6 @@ def command_file_get_with_http_info(self, id, content_type, accept, **kwargs): query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -143,10 +124,6 @@ def command_file_get_with_http_info(self, id, content_type, accept, **kwargs): header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -166,51 +143,47 @@ def command_file_get_with_http_info(self, id, content_type, accept, **kwargs): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def commands_delete(self, id, content_type, accept, **kwargs): # noqa: E501 + def commands_delete(self, id, **kwargs): # noqa: E501 """Delete a Command # noqa: E501 This endpoint deletes a specific command based on the Command ID. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.commands_delete(id, content_type, accept, async_req=True) + >>> thread = api.commands_delete(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: None + :param str x_org_id: + :return: Command If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.commands_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.commands_delete_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.commands_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.commands_delete_with_http_info(id, **kwargs) # noqa: E501 return data - def commands_delete_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def commands_delete_with_http_info(self, id, **kwargs): # noqa: E501 """Delete a Command # noqa: E501 This endpoint deletes a specific command based on the Command ID. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.commands_delete_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.commands_delete_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: None + :param str x_org_id: + :return: Command If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -229,14 +202,6 @@ def commands_delete_with_http_info(self, id, content_type, accept, **kwargs): # if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `commands_delete`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `commands_delete`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `commands_delete`") # noqa: E501 collection_formats = {} @@ -247,10 +212,6 @@ def commands_delete_with_http_info(self, id, content_type, accept, **kwargs): # query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -262,10 +223,6 @@ def commands_delete_with_http_info(self, id, content_type, accept, **kwargs): # header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -277,7 +234,7 @@ def commands_delete_with_http_info(self, id, content_type, accept, **kwargs): # body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='Command', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -285,55 +242,49 @@ def commands_delete_with_http_info(self, id, content_type, accept, **kwargs): # _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def commands_get(self, id, content_type, accept, **kwargs): # noqa: E501 + def commands_get(self, id, **kwargs): # noqa: E501 """List an individual Command # noqa: E501 This endpoint returns a specific command based on the command ID. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.commands_get(id, content_type, accept, async_req=True) + >>> thread = api.commands_get(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param str filter: A filter to apply to the query. - :param str x_org_id: + :param str x_org_id: :return: Command If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.commands_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.commands_get_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.commands_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.commands_get_with_http_info(id, **kwargs) # noqa: E501 return data - def commands_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def commands_get_with_http_info(self, id, **kwargs): # noqa: E501 """List an individual Command # noqa: E501 This endpoint returns a specific command based on the command ID. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.commands_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.commands_get_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param str filter: A filter to apply to the query. - :param str x_org_id: + :param str x_org_id: :return: Command If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'fields', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['id', 'fields', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -352,14 +303,6 @@ def commands_get_with_http_info(self, id, content_type, accept, **kwargs): # no if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `commands_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `commands_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `commands_get`") # noqa: E501 collection_formats = {} @@ -370,14 +313,8 @@ def commands_get_with_http_info(self, id, content_type, accept, **kwargs): # no query_params = [] if 'fields' in params: query_params.append(('fields', params['fields'])) # noqa: E501 - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -389,10 +326,6 @@ def commands_get_with_http_info(self, id, content_type, accept, **kwargs): # no header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -412,59 +345,150 @@ def commands_get_with_http_info(self, id, content_type, accept, **kwargs): # no _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def commands_list(self, content_type, accept, **kwargs): # noqa: E501 + def commands_get_results(self, id, **kwargs): # noqa: E501 + """Get results for a specific command # noqa: E501 + + This endpoint returns results for a specific command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/{id}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ```` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.commands_get_results(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: list[Commandresult] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.commands_get_results_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.commands_get_results_with_http_info(id, **kwargs) # noqa: E501 + return data + + def commands_get_results_with_http_info(self, id, **kwargs): # noqa: E501 + """Get results for a specific command # noqa: E501 + + This endpoint returns results for a specific command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/{id}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ```` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.commands_get_results_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: list[Commandresult] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method commands_get_results" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `commands_get_results`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/commands/{id}/results', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Commandresult]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def commands_list(self, **kwargs): # noqa: E501 """List All Commands # noqa: E501 This endpoint returns all commands. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.commands_list(content_type, accept, async_req=True) + >>> thread = api.commands_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int skip: The offset into the records to return. :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: + :param int skip: The offset into the records to return. :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str filter: A filter to apply to the query. - :param str x_org_id: :return: Commandslist If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.commands_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.commands_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.commands_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.commands_list_with_http_info(**kwargs) # noqa: E501 return data - def commands_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def commands_list_with_http_info(self, **kwargs): # noqa: E501 """List All Commands # noqa: E501 This endpoint returns all commands. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.commands_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.commands_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int skip: The offset into the records to return. :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: + :param int skip: The offset into the records to return. :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str filter: A filter to apply to the query. - :param str x_org_id: :return: Commandslist If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'skip', 'fields', 'limit', 'sort', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['fields', 'filter', 'limit', 'x_org_id', 'skip', 'sort'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -479,38 +503,24 @@ def commands_list_with_http_info(self, content_type, accept, **kwargs): # noqa: ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `commands_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `commands_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `commands_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 if 'fields' in params: query_params.append(('fields', params['fields'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 if 'sort' in params: query_params.append(('sort', params['sort'])) # noqa: E501 - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -522,10 +532,6 @@ def commands_list_with_http_info(self, content_type, accept, **kwargs): # noqa: header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -545,51 +551,47 @@ def commands_list_with_http_info(self, content_type, accept, **kwargs): # noqa: _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def commands_post(self, content_type, accept, **kwargs): # noqa: E501 + def commands_post(self, **kwargs): # noqa: E501 """Create A Command # noqa: E501 This endpoint allows you to create a new command. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/commands/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\":\"Test API Command\", \"command\":\"String\", \"user\":\"{UserID}\", \"schedule\":\"\", \"timeout\":\"100\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.commands_post(content_type, accept, async_req=True) + >>> thread = api.commands_post(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param Command body: - :param str x_org_id: + :param str x_org_id: :return: Command If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.commands_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.commands_post_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.commands_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.commands_post_with_http_info(**kwargs) # noqa: E501 return data - def commands_post_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def commands_post_with_http_info(self, **kwargs): # noqa: E501 """Create A Command # noqa: E501 This endpoint allows you to create a new command. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/commands/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\":\"Test API Command\", \"command\":\"String\", \"user\":\"{UserID}\", \"schedule\":\"\", \"timeout\":\"100\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.commands_post_with_http_info(content_type, accept, async_req=True) + >>> thread = api.commands_post_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param Command body: - :param str x_org_id: + :param str x_org_id: :return: Command If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -604,14 +606,6 @@ def commands_post_with_http_info(self, content_type, accept, **kwargs): # noqa: ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `commands_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `commands_post`") # noqa: E501 collection_formats = {} @@ -620,10 +614,6 @@ def commands_post_with_http_info(self, content_type, accept, **kwargs): # noqa: query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -660,53 +650,49 @@ def commands_post_with_http_info(self, content_type, accept, **kwargs): # noqa: _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def commands_put(self, id, content_type, accept, **kwargs): # noqa: E501 + def commands_put(self, id, **kwargs): # noqa: E501 """Update a Command # noqa: E501 This endpoint Updates a command based on the command ID and returns the modified command record. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\":\"Test API Command\", \"command\":\"String\", \"user\":\"{UserID}\", \"schedule\":\"\", \"timeout\":\"100\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.commands_put(id, content_type, accept, async_req=True) + >>> thread = api.commands_put(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :param Command body: - :param str x_org_id: + :param str x_org_id: :return: Command If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.commands_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.commands_put_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.commands_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.commands_put_with_http_info(id, **kwargs) # noqa: E501 return data - def commands_put_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def commands_put_with_http_info(self, id, **kwargs): # noqa: E501 """Update a Command # noqa: E501 This endpoint Updates a command based on the command ID and returns the modified command record. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\":\"Test API Command\", \"command\":\"String\", \"user\":\"{UserID}\", \"schedule\":\"\", \"timeout\":\"100\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.commands_put_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.commands_put_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :param Command body: - :param str x_org_id: + :param str x_org_id: :return: Command If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -725,14 +711,6 @@ def commands_put_with_http_info(self, id, content_type, accept, **kwargs): # no if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `commands_put`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `commands_put`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `commands_put`") # noqa: E501 collection_formats = {} @@ -743,10 +721,6 @@ def commands_put_with_http_info(self, id, content_type, accept, **kwargs): # no query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 diff --git a/jcapiv1/jcapiv1/api/managed_service_provider_api.py b/jcapiv1/jcapiv1/api/managed_service_provider_api.py new file mode 100644 index 0000000..60955f9 --- /dev/null +++ b/jcapiv1/jcapiv1/api/managed_service_provider_api.py @@ -0,0 +1,441 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv1.api_client import ApiClient + + +class ManagedServiceProviderApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def admin_totpreset_begin(self, id, **kwargs): # noqa: E501 + """Administrator TOTP Reset Initiation # noqa: E501 + + This endpoint initiates a TOTP reset for an admin. This request does not accept a body. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.admin_totpreset_begin(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.admin_totpreset_begin_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.admin_totpreset_begin_with_http_info(id, **kwargs) # noqa: E501 + return data + + def admin_totpreset_begin_with_http_info(self, id, **kwargs): # noqa: E501 + """Administrator TOTP Reset Initiation # noqa: E501 + + This endpoint initiates a TOTP reset for an admin. This request does not accept a body. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.admin_totpreset_begin_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method admin_totpreset_begin" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `admin_totpreset_begin`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/users/resettotp/{id}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def organization_list(self, **kwargs): # noqa: E501 + """Get Organization Details # noqa: E501 + + This endpoint returns Organization Details. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.organization_list(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param int limit: The number of records to return at once. Limited to 100. + :param str search: A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. + :param int skip: The offset into the records to return. + :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. + :return: Organizationslist + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.organization_list_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.organization_list_with_http_info(**kwargs) # noqa: E501 + return data + + def organization_list_with_http_info(self, **kwargs): # noqa: E501 + """Get Organization Details # noqa: E501 + + This endpoint returns Organization Details. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.organization_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param int limit: The number of records to return at once. Limited to 100. + :param str search: A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. + :param int skip: The offset into the records to return. + :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. + :return: Organizationslist + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['fields', 'filter', 'limit', 'search', 'skip', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method organization_list" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'search' in params: + query_params.append(('search', params['search'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/organizations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Organizationslist', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def users_put(self, id, **kwargs): # noqa: E501 + """Update a user # noqa: E501 + + This endpoint allows you to update a user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.users_put(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param Userput body: + :param str x_org_id: + :return: Userreturn + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.users_put_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.users_put_with_http_info(id, **kwargs) # noqa: E501 + return data + + def users_put_with_http_info(self, id, **kwargs): # noqa: E501 + """Update a user # noqa: E501 + + This endpoint allows you to update a user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.users_put_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param Userput body: + :param str x_org_id: + :return: Userreturn + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method users_put" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `users_put`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/users/{id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Userreturn', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def users_reactivate_get(self, id, **kwargs): # noqa: E501 + """Administrator Password Reset Initiation # noqa: E501 + + This endpoint triggers the sending of a reactivation e-mail to an administrator. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.users_reactivate_get(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.users_reactivate_get_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.users_reactivate_get_with_http_info(id, **kwargs) # noqa: E501 + return data + + def users_reactivate_get_with_http_info(self, id, **kwargs): # noqa: E501 + """Administrator Password Reset Initiation # noqa: E501 + + This endpoint triggers the sending of a reactivation e-mail to an administrator. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.users_reactivate_get_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method users_reactivate_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `users_reactivate_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/users/reactivate/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv1/jcapiv1/api/organizations_api.py b/jcapiv1/jcapiv1/api/organizations_api.py index 3e3c7b0..6889f19 100644 --- a/jcapiv1/jcapiv1/api/organizations_api.py +++ b/jcapiv1/jcapiv1/api/organizations_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,59 +32,55 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def organization_list(self, content_type, accept, **kwargs): # noqa: E501 + def organization_list(self, **kwargs): # noqa: E501 """Get Organization Details # noqa: E501 This endpoint returns Organization Details. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.organization_list(content_type, accept, async_req=True) + >>> thread = api.organization_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param str filter: A filter to apply to the query. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. :param int limit: The number of records to return at once. Limited to 100. + :param str search: A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. :param int skip: The offset into the records to return. :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str search: A nested object containing a string `searchTerm` and a list of `fields` to search on. :return: Organizationslist If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.organization_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.organization_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.organization_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.organization_list_with_http_info(**kwargs) # noqa: E501 return data - def organization_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def organization_list_with_http_info(self, **kwargs): # noqa: E501 """Get Organization Details # noqa: E501 This endpoint returns Organization Details. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.organization_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.organization_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param str filter: A filter to apply to the query. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. :param int limit: The number of records to return at once. Limited to 100. + :param str search: A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. :param int skip: The offset into the records to return. :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str search: A nested object containing a string `searchTerm` and a list of `fields` to search on. :return: Organizationslist If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'fields', 'filter', 'limit', 'skip', 'sort', 'search'] # noqa: E501 + all_params = ['fields', 'filter', 'limit', 'search', 'skip', 'sort'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -100,17 +95,7 @@ def organization_list_with_http_info(self, content_type, accept, **kwargs): # n ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `organization_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `organization_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `organization_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -122,18 +107,14 @@ def organization_list_with_http_info(self, content_type, accept, **kwargs): # n query_params.append(('filter', params['filter'])) # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 + if 'search' in params: + query_params.append(('search', params['search'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 if 'sort' in params: query_params.append(('sort', params['sort'])) # noqa: E501 - if 'search' in params: - query_params.append(('search', params['search'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -143,6 +124,105 @@ def organization_list_with_http_info(self, content_type, accept, **kwargs): # n header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/organizations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Organizationslist', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def organization_put(self, id, **kwargs): # noqa: E501 + """Update an Organization # noqa: E501 + + This endpoint allows you to update an Organization. Note: `passwordPolicy` settings are only used when `passwordCompliance` is set to \"custom\". We discourage the use of non-custom passwordCompliance values. `hasStripeCustomerId` is deprecated and will be removed. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/organizations/{OrganizationID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"settings\": { \"contactName\": \"Admin Name\", \"contactEmail\": \"admin@company.com\", \"systemUsersCanEdit\":true, \"passwordPolicy\": { \"enableMaxHistory\": true, \"maxHistory\": 3 } } }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.organization_put(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param OrganizationsIdBody body: + :return: Organization + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.organization_put_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.organization_put_with_http_info(id, **kwargs) # noqa: E501 + return data + + def organization_put_with_http_info(self, id, **kwargs): # noqa: E501 + """Update an Organization # noqa: E501 + + This endpoint allows you to update an Organization. Note: `passwordPolicy` settings are only used when `passwordCompliance` is set to \"custom\". We discourage the use of non-custom passwordCompliance values. `hasStripeCustomerId` is deprecated and will be removed. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/organizations/{OrganizationID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"settings\": { \"contactName\": \"Admin Name\", \"contactEmail\": \"admin@company.com\", \"systemUsersCanEdit\":true, \"passwordPolicy\": { \"enableMaxHistory\": true, \"maxHistory\": 3 } } }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.organization_put_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param OrganizationsIdBody body: + :return: Organization + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method organization_put" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `organization_put`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -151,14 +231,117 @@ def organization_list_with_http_info(self, content_type, accept, **kwargs): # n auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/organizations', 'GET', + '/organizations/{id}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Organizationslist', # noqa: E501 + response_type='Organization', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def organizations_get(self, id, **kwargs): # noqa: E501 + """Get an Organization # noqa: E501 + + This endpoint returns a particular Organization. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/organizations/{OrganizationID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.organizations_get(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :return: Organization + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.organizations_get_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.organizations_get_with_http_info(id, **kwargs) # noqa: E501 + return data + + def organizations_get_with_http_info(self, id, **kwargs): # noqa: E501 + """Get an Organization # noqa: E501 + + This endpoint returns a particular Organization. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/organizations/{OrganizationID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.organizations_get_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :return: Organization + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'fields', 'filter'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method organizations_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `organizations_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/organizations/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Organization', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/jcapiv1/jcapiv1/api/radius_servers_api.py b/jcapiv1/jcapiv1/api/radius_servers_api.py index 36537f2..21293d7 100644 --- a/jcapiv1/jcapiv1/api/radius_servers_api.py +++ b/jcapiv1/jcapiv1/api/radius_servers_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,59 +32,253 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def radius_servers_list(self, content_type, accept, **kwargs): # noqa: E501 + def radius_servers_delete(self, id, **kwargs): # noqa: E501 + """Delete Radius Server # noqa: E501 + + This endpoint allows you to delete RADIUS servers in your organization. ``` curl -X DELETE https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.radius_servers_delete(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str x_org_id: + :return: Radiusserverput + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.radius_servers_delete_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.radius_servers_delete_with_http_info(id, **kwargs) # noqa: E501 + return data + + def radius_servers_delete_with_http_info(self, id, **kwargs): # noqa: E501 + """Delete Radius Server # noqa: E501 + + This endpoint allows you to delete RADIUS servers in your organization. ``` curl -X DELETE https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.radius_servers_delete_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str x_org_id: + :return: Radiusserverput + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method radius_servers_delete" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `radius_servers_delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/radiusservers/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Radiusserverput', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def radius_servers_get(self, id, **kwargs): # noqa: E501 + """Get Radius Server # noqa: E501 + + This endpoint allows you to get a RADIUS server in your organization. #### ``` curl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.radius_servers_get(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str x_org_id: + :return: Radiusserver + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.radius_servers_get_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.radius_servers_get_with_http_info(id, **kwargs) # noqa: E501 + return data + + def radius_servers_get_with_http_info(self, id, **kwargs): # noqa: E501 + """Get Radius Server # noqa: E501 + + This endpoint allows you to get a RADIUS server in your organization. #### ``` curl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.radius_servers_get_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str x_org_id: + :return: Radiusserver + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method radius_servers_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `radius_servers_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/radiusservers/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Radiusserver', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def radius_servers_list(self, **kwargs): # noqa: E501 """List Radius Servers # noqa: E501 This endpoint allows you to get a list of all RADIUS servers in your organization. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/radiusservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.radius_servers_list(content_type, accept, async_req=True) + >>> thread = api.radius_servers_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param str filter: A filter to apply to the query. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: :return: Radiusserverslist If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.radius_servers_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.radius_servers_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.radius_servers_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.radius_servers_list_with_http_info(**kwargs) # noqa: E501 return data - def radius_servers_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def radius_servers_list_with_http_info(self, **kwargs): # noqa: E501 """List Radius Servers # noqa: E501 This endpoint allows you to get a list of all RADIUS servers in your organization. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/radiusservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.radius_servers_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.radius_servers_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param str filter: A filter to apply to the query. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: :return: Radiusserverslist If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -100,17 +293,7 @@ def radius_servers_list_with_http_info(self, content_type, accept, **kwargs): # ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `radius_servers_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `radius_servers_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `radius_servers_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -128,10 +311,6 @@ def radius_servers_list_with_http_info(self, content_type, accept, **kwargs): # query_params.append(('sort', params['sort'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -143,10 +322,6 @@ def radius_servers_list_with_http_info(self, content_type, accept, **kwargs): # header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -166,51 +341,47 @@ def radius_servers_list_with_http_info(self, content_type, accept, **kwargs): # _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def radius_servers_post(self, content_type, accept, **kwargs): # noqa: E501 + def radius_servers_post(self, **kwargs): # noqa: E501 """Create a Radius Server # noqa: E501 This endpoint allows you to create RADIUS servers in your organization. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/radiusservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{test_radius}\", \"networkSourceIp\": \"{0.0.0.0}\", \"sharedSecret\":\"{secretpassword}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.radius_servers_post(content_type, accept, async_req=True) + >>> thread = api.radius_servers_post(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param Radiusserverpost body: - :param str x_org_id: + :param str x_org_id: :return: Radiusserver If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.radius_servers_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.radius_servers_post_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.radius_servers_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.radius_servers_post_with_http_info(**kwargs) # noqa: E501 return data - def radius_servers_post_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def radius_servers_post_with_http_info(self, **kwargs): # noqa: E501 """Create a Radius Server # noqa: E501 This endpoint allows you to create RADIUS servers in your organization. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/radiusservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{test_radius}\", \"networkSourceIp\": \"{0.0.0.0}\", \"sharedSecret\":\"{secretpassword}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.radius_servers_post_with_http_info(content_type, accept, async_req=True) + >>> thread = api.radius_servers_post_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param Radiusserverpost body: - :param str x_org_id: + :param str x_org_id: :return: Radiusserver If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -225,14 +396,6 @@ def radius_servers_post_with_http_info(self, content_type, accept, **kwargs): # ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `radius_servers_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `radius_servers_post`") # noqa: E501 collection_formats = {} @@ -241,10 +404,6 @@ def radius_servers_post_with_http_info(self, content_type, accept, **kwargs): # query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -281,53 +440,49 @@ def radius_servers_post_with_http_info(self, content_type, accept, **kwargs): # _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def radius_servers_put(self, id, content_type, accept, **kwargs): # noqa: E501 + def radius_servers_put(self, id, **kwargs): # noqa: E501 """Update Radius Servers # noqa: E501 - This endpoint allows you to update RADIUS servers in your organization. #### ``` curl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{name_update}\", \"networkSourceIp\": \"{0.0.0.0}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` # noqa: E501 + This endpoint allows you to update RADIUS servers in your organization. #### ``` curl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{name_update}\", \"networkSourceIp\": \"{0.0.0.0}\", \"sharedSecret\": \"{secret_password}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.radius_servers_put(id, content_type, accept, async_req=True) + >>> thread = api.radius_servers_put(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param Body body: - :param str x_org_id: + :param RadiusserversIdBody body: + :param str x_org_id: :return: Radiusserverput If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.radius_servers_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.radius_servers_put_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.radius_servers_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.radius_servers_put_with_http_info(id, **kwargs) # noqa: E501 return data - def radius_servers_put_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def radius_servers_put_with_http_info(self, id, **kwargs): # noqa: E501 """Update Radius Servers # noqa: E501 - This endpoint allows you to update RADIUS servers in your organization. #### ``` curl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{name_update}\", \"networkSourceIp\": \"{0.0.0.0}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` # noqa: E501 + This endpoint allows you to update RADIUS servers in your organization. #### ``` curl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{name_update}\", \"networkSourceIp\": \"{0.0.0.0}\", \"sharedSecret\": \"{secret_password}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.radius_servers_put_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.radius_servers_put_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param Body body: - :param str x_org_id: + :param RadiusserversIdBody body: + :param str x_org_id: :return: Radiusserverput If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -346,14 +501,6 @@ def radius_servers_put_with_http_info(self, id, content_type, accept, **kwargs): if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `radius_servers_put`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `radius_servers_put`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `radius_servers_put`") # noqa: E501 collection_formats = {} @@ -364,10 +511,6 @@ def radius_servers_put_with_http_info(self, id, content_type, accept, **kwargs): query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 diff --git a/jcapiv1/jcapiv1/api/search_api.py b/jcapiv1/jcapiv1/api/search_api.py index f83e77a..2f1fd12 100644 --- a/jcapiv1/jcapiv1/api/search_api.py +++ b/jcapiv1/jcapiv1/api/search_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,21 +32,249 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def search_organizations_post(self, content_type, accept, **kwargs): # noqa: E501 + def search_commandresults_post(self, **kwargs): # noqa: E501 + """Search Commands Results # noqa: E501 + + Return Command Results in multi-record format allowing for the passing of the `filter` parameter. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/commandresults route. The `filter` parameter must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. #### Sample Request Exact search for a specific command result ``` curl -X POST https://console.jumpcloud.com/api/search/commandresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : \"workflowInstanceId:$eq:62f3c599ec4e928499069c7f\", \"fields\" : \"name workflowId sudo\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.search_commandresults_post(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Search body: + :param str x_org_id: + :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: Commandresultslist + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.search_commandresults_post_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.search_commandresults_post_with_http_info(**kwargs) # noqa: E501 + return data + + def search_commandresults_post_with_http_info(self, **kwargs): # noqa: E501 + """Search Commands Results # noqa: E501 + + Return Command Results in multi-record format allowing for the passing of the `filter` parameter. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/commandresults route. The `filter` parameter must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. #### Sample Request Exact search for a specific command result ``` curl -X POST https://console.jumpcloud.com/api/search/commandresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : \"workflowInstanceId:$eq:62f3c599ec4e928499069c7f\", \"fields\" : \"name workflowId sudo\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.search_commandresults_post_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Search body: + :param str x_org_id: + :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: Commandresultslist + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'x_org_id', 'fields', 'filter', 'limit', 'skip'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method search_commandresults_post" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/search/commandresults', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Commandresultslist', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def search_commands_post(self, **kwargs): # noqa: E501 + """Search Commands # noqa: E501 + + Return Commands in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new command. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of commands in a launchType ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : [{\"launchType\" : \"repeated\"}], \"fields\" : \"name launchType sudo\" }' ``` Text search for commands with name ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": \"List\", \"fields\": [\"name\"] }, \"fields\" : \"name launchType sudo\" }' ``` Text search for multiple commands ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": [\"List\", \"Log\"], \"fields\": [\"name\"] }, \"fields\" : \"name launchType sudo\" }' ``` Combining `filter` and `searchFilter` to text search for commands with name who are in a list of launchType ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"List\", \"fields\": [\"name\"] }, \"filter\": { \"or\": [ {\"launchType\" : \"repeated\"}, {\"launchType\" : \"one-time\"} ] }, \"fields\" : \"name launchType sudo\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.search_commands_post(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Search body: + :param str x_org_id: + :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: Commandslist + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.search_commands_post_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.search_commands_post_with_http_info(**kwargs) # noqa: E501 + return data + + def search_commands_post_with_http_info(self, **kwargs): # noqa: E501 + """Search Commands # noqa: E501 + + Return Commands in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new command. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of commands in a launchType ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : [{\"launchType\" : \"repeated\"}], \"fields\" : \"name launchType sudo\" }' ``` Text search for commands with name ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": \"List\", \"fields\": [\"name\"] }, \"fields\" : \"name launchType sudo\" }' ``` Text search for multiple commands ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": [\"List\", \"Log\"], \"fields\": [\"name\"] }, \"fields\" : \"name launchType sudo\" }' ``` Combining `filter` and `searchFilter` to text search for commands with name who are in a list of launchType ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"List\", \"fields\": [\"name\"] }, \"filter\": { \"or\": [ {\"launchType\" : \"repeated\"}, {\"launchType\" : \"one-time\"} ] }, \"fields\" : \"name launchType sudo\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.search_commands_post_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Search body: + :param str x_org_id: + :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: Commandslist + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'x_org_id', 'fields', 'filter', 'limit', 'skip'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method search_commands_post" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/search/commands', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Commandslist', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def search_organizations_post(self, **kwargs): # noqa: E501 """Search Organizations # noqa: E501 This endpoint will return Organization data based on your search parameters. This endpoint WILL NOT allow you to add a new Organization. You can use the supported parameters and pass those in the body of request. The parameters must be passed as Content-Type application/json. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/search/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"search\":{ \"fields\" : [\"settings.name\"], \"searchTerm\": \"Second\" }, \"fields\": [\"_id\", \"displayName\", \"logoUrl\"], \"limit\" : 0, \"skip\" : 0 }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_organizations_post(content_type, accept, async_req=True) + >>> thread = api.search_organizations_post(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param Search body: :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param str filter: A filter to apply to the query. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :return: Organizationslist @@ -56,26 +283,24 @@ def search_organizations_post(self, content_type, accept, **kwargs): # noqa: E5 """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.search_organizations_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.search_organizations_post_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.search_organizations_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.search_organizations_post_with_http_info(**kwargs) # noqa: E501 return data - def search_organizations_post_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def search_organizations_post_with_http_info(self, **kwargs): # noqa: E501 """Search Organizations # noqa: E501 This endpoint will return Organization data based on your search parameters. This endpoint WILL NOT allow you to add a new Organization. You can use the supported parameters and pass those in the body of request. The parameters must be passed as Content-Type application/json. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/search/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"search\":{ \"fields\" : [\"settings.name\"], \"searchTerm\": \"Second\" }, \"fields\": [\"_id\", \"displayName\", \"logoUrl\"], \"limit\" : 0, \"skip\" : 0 }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_organizations_post_with_http_info(content_type, accept, async_req=True) + >>> thread = api.search_organizations_post_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param Search body: :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param str filter: A filter to apply to the query. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :return: Organizationslist @@ -83,7 +308,7 @@ def search_organizations_post_with_http_info(self, content_type, accept, **kwarg returns the request thread. """ - all_params = ['content_type', 'accept', 'body', 'fields', 'filter', 'limit', 'skip'] # noqa: E501 + all_params = ['body', 'fields', 'filter', 'limit', 'skip'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -98,17 +323,7 @@ def search_organizations_post_with_http_info(self, content_type, accept, **kwarg ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `search_organizations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `search_organizations_post`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `search_organizations_post`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -124,10 +339,6 @@ def search_organizations_post_with_http_info(self, content_type, accept, **kwarg query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -162,59 +373,55 @@ def search_organizations_post_with_http_info(self, content_type, accept, **kwarg _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def search_systems_post(self, content_type, accept, **kwargs): # noqa: E501 + def search_systems_post(self, **kwargs): # noqa: E501 """Search Systems # noqa: E501 - Return Systems in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the`searchTerm` the record will be returned. #### Sample Request Exact search for a list of hostnames ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\": { \"or\": [ {\"hostname\" : \"my-hostname\"}, {\"hostname\" : \"other-hostname\"} ] }, \"fields\" : \"os hostname displayName\" }' ``` Text search for a hostname or display name ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"fields\": \"os hostname displayName\" }' ``` Combining `filter` and `searchFilter` to search for names that match a given OS ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"filter\": { \"or\": [ {\"os\" : \"Ubuntu\"}, {\"os\" : \"Mac OS X\"} ] }, \"fields\": \"os hostname displayName\" }' ``` # noqa: E501 + Return Systems in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of hostnames ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\": { \"or\": [ {\"hostname\" : \"my-hostname\"}, {\"hostname\" : \"other-hostname\"} ] }, \"fields\" : \"os hostname displayName\" }' ``` Text search for a hostname or display name ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"fields\": \"os hostname displayName\" }' ``` Text search for a multiple hostnames. ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": [\"my-host\", \"my-other-host\"], \"fields\": [\"hostname\"] }, \"fields\": \"os hostname displayName\" }' ``` Combining `filter` and `searchFilter` to search for names that match a given OS ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"filter\": { \"or\": [ {\"os\" : \"Ubuntu\"}, {\"os\" : \"Mac OS X\"} ] }, \"fields\": \"os hostname displayName\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_systems_post(content_type, accept, async_req=True) + >>> thread = api.search_systems_post(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param Search body: + :param str x_org_id: :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: :param int skip: The offset into the records to return. - :param str filter: A filter to apply to the query. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. :return: Systemslist If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.search_systems_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.search_systems_post_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.search_systems_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.search_systems_post_with_http_info(**kwargs) # noqa: E501 return data - def search_systems_post_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def search_systems_post_with_http_info(self, **kwargs): # noqa: E501 """Search Systems # noqa: E501 - Return Systems in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the`searchTerm` the record will be returned. #### Sample Request Exact search for a list of hostnames ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\": { \"or\": [ {\"hostname\" : \"my-hostname\"}, {\"hostname\" : \"other-hostname\"} ] }, \"fields\" : \"os hostname displayName\" }' ``` Text search for a hostname or display name ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"fields\": \"os hostname displayName\" }' ``` Combining `filter` and `searchFilter` to search for names that match a given OS ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"filter\": { \"or\": [ {\"os\" : \"Ubuntu\"}, {\"os\" : \"Mac OS X\"} ] }, \"fields\": \"os hostname displayName\" }' ``` # noqa: E501 + Return Systems in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of hostnames ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\": { \"or\": [ {\"hostname\" : \"my-hostname\"}, {\"hostname\" : \"other-hostname\"} ] }, \"fields\" : \"os hostname displayName\" }' ``` Text search for a hostname or display name ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"fields\": \"os hostname displayName\" }' ``` Text search for a multiple hostnames. ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": [\"my-host\", \"my-other-host\"], \"fields\": [\"hostname\"] }, \"fields\": \"os hostname displayName\" }' ``` Combining `filter` and `searchFilter` to search for names that match a given OS ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"filter\": { \"or\": [ {\"os\" : \"Ubuntu\"}, {\"os\" : \"Mac OS X\"} ] }, \"fields\": \"os hostname displayName\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_systems_post_with_http_info(content_type, accept, async_req=True) + >>> thread = api.search_systems_post_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param Search body: + :param str x_org_id: :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: :param int skip: The offset into the records to return. - :param str filter: A filter to apply to the query. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. :return: Systemslist If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'body', 'fields', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['body', 'x_org_id', 'fields', 'limit', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -229,17 +436,7 @@ def search_systems_post_with_http_info(self, content_type, accept, **kwargs): # ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `search_systems_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `search_systems_post`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `search_systems_post`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -257,10 +454,6 @@ def search_systems_post_with_http_info(self, content_type, accept, **kwargs): # header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -295,59 +488,55 @@ def search_systems_post_with_http_info(self, content_type, accept, **kwargs): # _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def search_systemusers_post(self, content_type, accept, **kwargs): # noqa: E501 + def search_systemusers_post(self, **kwargs): # noqa: E501 """Search System Users # noqa: E501 - Return System Users in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system user. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the`searchTerm` the record will be returned. #### Sample Request Exact search for a list of system users in a department ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : [{\"department\" : \"IT\"}], \"fields\" : \"email username sudo\" }' ``` Text search for system users with and email on a domain ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"fields\" : \"email username sudo\" }' ``` Combining `filter` and `searchFilter` to text search for system users with and email on a domain who are in a list of departments ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"filter\": { \"or\": [ {\"department\" : \"IT\"}, {\"department\" : \"Sales\"} ] }, \"fields\" : \"email username sudo\" }' ``` # noqa: E501 + Return System Users in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system user. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of system users in a department ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : [{\"department\" : \"IT\"}], \"fields\" : \"email username sudo\" }' ``` Text search for system users with and email on a domain ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"fields\" : \"email username sudo\" }' ``` Text search for multiple system users ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": [\"john\", \"sarah\"], \"fields\": [\"username\"] }, \"fields\" : \"email username sudo\" }' ``` Combining `filter` and `searchFilter` to text search for system users with and email on a domain who are in a list of departments ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"filter\": { \"or\": [ {\"department\" : \"IT\"}, {\"department\" : \"Sales\"} ] }, \"fields\" : \"email username sudo\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_systemusers_post(content_type, accept, async_req=True) + >>> thread = api.search_systemusers_post(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param Search body: + :param str x_org_id: :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param str filter: A filter to apply to the query. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: :return: Systemuserslist If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.search_systemusers_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.search_systemusers_post_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.search_systemusers_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.search_systemusers_post_with_http_info(**kwargs) # noqa: E501 return data - def search_systemusers_post_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def search_systemusers_post_with_http_info(self, **kwargs): # noqa: E501 """Search System Users # noqa: E501 - Return System Users in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system user. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the`searchTerm` the record will be returned. #### Sample Request Exact search for a list of system users in a department ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : [{\"department\" : \"IT\"}], \"fields\" : \"email username sudo\" }' ``` Text search for system users with and email on a domain ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"fields\" : \"email username sudo\" }' ``` Combining `filter` and `searchFilter` to text search for system users with and email on a domain who are in a list of departments ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"filter\": { \"or\": [ {\"department\" : \"IT\"}, {\"department\" : \"Sales\"} ] }, \"fields\" : \"email username sudo\" }' ``` # noqa: E501 + Return System Users in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system user. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of system users in a department ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : [{\"department\" : \"IT\"}], \"fields\" : \"email username sudo\" }' ``` Text search for system users with and email on a domain ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"fields\" : \"email username sudo\" }' ``` Text search for multiple system users ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": [\"john\", \"sarah\"], \"fields\": [\"username\"] }, \"fields\" : \"email username sudo\" }' ``` Combining `filter` and `searchFilter` to text search for system users with and email on a domain who are in a list of departments ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"filter\": { \"or\": [ {\"department\" : \"IT\"}, {\"department\" : \"Sales\"} ] }, \"fields\" : \"email username sudo\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_systemusers_post_with_http_info(content_type, accept, async_req=True) + >>> thread = api.search_systemusers_post_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param Search body: + :param str x_org_id: :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param str filter: A filter to apply to the query. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: :return: Systemuserslist If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'body', 'fields', 'filter', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['body', 'x_org_id', 'fields', 'filter', 'limit', 'skip'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -362,17 +551,7 @@ def search_systemusers_post_with_http_info(self, content_type, accept, **kwargs) ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `search_systemusers_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `search_systemusers_post`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `search_systemusers_post`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -388,10 +567,6 @@ def search_systemusers_post_with_http_info(self, content_type, accept, **kwargs) query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 diff --git a/jcapiv1/jcapiv1/api/systems_api.py b/jcapiv1/jcapiv1/api/systems_api.py index f92331d..7922823 100644 --- a/jcapiv1/jcapiv1/api/systems_api.py +++ b/jcapiv1/jcapiv1/api/systems_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,55 +32,47 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def systems_delete(self, id, content_type, accept, **kwargs): # noqa: E501 - """Delete a System # noqa: E501 + def systems_command_builtin_erase(self, system_id, **kwargs): # noqa: E501 + """Erase a System # noqa: E501 - This endpoint allows you to delete a system. This command will cause the system to uninstall the JumpCloud agent from its self which can can take about a minute. If the system is not connected to JumpCloud the system record will simply be removed. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint allows you to run the erase command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/erase \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systems_delete(id, content_type, accept, async_req=True) + >>> thread = api.systems_command_builtin_erase(system_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str _date: Current date header for the System Context API - :param str authorization: Authorization header for the System Context API - :param str x_org_id: - :return: System + :param str system_id: (required) + :param str x_org_id: + :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systems_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.systems_command_builtin_erase_with_http_info(system_id, **kwargs) # noqa: E501 else: - (data) = self.systems_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systems_command_builtin_erase_with_http_info(system_id, **kwargs) # noqa: E501 return data - def systems_delete_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """Delete a System # noqa: E501 + def systems_command_builtin_erase_with_http_info(self, system_id, **kwargs): # noqa: E501 + """Erase a System # noqa: E501 - This endpoint allows you to delete a system. This command will cause the system to uninstall the JumpCloud agent from its self which can can take about a minute. If the system is not connected to JumpCloud the system record will simply be removed. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint allows you to run the erase command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/erase \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systems_delete_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.systems_command_builtin_erase_with_http_info(system_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str _date: Current date header for the System Context API - :param str authorization: Authorization header for the System Context API - :param str x_org_id: - :return: System + :param str system_id: (required) + :param str x_org_id: + :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', '_date', 'authorization', 'x_org_id'] # noqa: E501 + all_params = ['system_id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -92,40 +83,24 @@ def systems_delete_with_http_info(self, id, content_type, accept, **kwargs): # if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systems_delete" % key + " to method systems_command_builtin_erase" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `systems_delete`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systems_delete`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systems_delete`") # noqa: E501 + # verify the required parameter 'system_id' is set + if ('system_id' not in params or + params['system_id'] is None): + raise ValueError("Missing the required parameter `system_id` when calling `systems_command_builtin_erase`") # noqa: E501 collection_formats = {} path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 + if 'system_id' in params: + path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - if '_date' in params: - header_params['Date'] = params['_date'] # noqa: E501 - if 'authorization' in params: - header_params['Authorization'] = params['authorization'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -137,22 +112,18 @@ def systems_delete_with_http_info(self, id, content_type, accept, **kwargs): # header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systems/{id}', 'DELETE', + '/systems/{system_id}/command/builtin/erase', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='System', # noqa: E501 + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -160,59 +131,47 @@ def systems_delete_with_http_info(self, id, content_type, accept, **kwargs): # _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systems_get(self, id, content_type, accept, **kwargs): # noqa: E501 - """List an individual system # noqa: E501 + def systems_command_builtin_lock(self, system_id, **kwargs): # noqa: E501 + """Lock a System # noqa: E501 - This endpoint returns an individual system. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint allows you to run the lock command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/lock \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systems_get(id, content_type, accept, async_req=True) + >>> thread = api.systems_command_builtin_lock(system_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param str filter: A filter to apply to the query. - :param str _date: Current date header for the System Context API - :param str authorization: Authorization header for the System Context API - :param str x_org_id: - :return: System + :param str system_id: (required) + :param str x_org_id: + :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systems_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.systems_command_builtin_lock_with_http_info(system_id, **kwargs) # noqa: E501 else: - (data) = self.systems_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systems_command_builtin_lock_with_http_info(system_id, **kwargs) # noqa: E501 return data - def systems_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """List an individual system # noqa: E501 + def systems_command_builtin_lock_with_http_info(self, system_id, **kwargs): # noqa: E501 + """Lock a System # noqa: E501 - This endpoint returns an individual system. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint allows you to run the lock command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/lock \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systems_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.systems_command_builtin_lock_with_http_info(system_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param str filter: A filter to apply to the query. - :param str _date: Current date header for the System Context API - :param str authorization: Authorization header for the System Context API - :param str x_org_id: - :return: System + :param str system_id: (required) + :param str x_org_id: + :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'fields', 'filter', '_date', 'authorization', 'x_org_id'] # noqa: E501 + all_params = ['system_id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -223,44 +182,24 @@ def systems_get_with_http_info(self, id, content_type, accept, **kwargs): # noq if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systems_get" % key + " to method systems_command_builtin_lock" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `systems_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systems_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systems_get`") # noqa: E501 + # verify the required parameter 'system_id' is set + if ('system_id' not in params or + params['system_id'] is None): + raise ValueError("Missing the required parameter `system_id` when calling `systems_command_builtin_lock`") # noqa: E501 collection_formats = {} path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 + if 'system_id' in params: + path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'fields' in params: - query_params.append(('fields', params['fields'])) # noqa: E501 - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - if '_date' in params: - header_params['Date'] = params['_date'] # noqa: E501 - if 'authorization' in params: - header_params['Authorization'] = params['authorization'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -272,22 +211,18 @@ def systems_get_with_http_info(self, id, content_type, accept, **kwargs): # noq header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systems/{id}', 'GET', + '/systems/{system_id}/command/builtin/lock', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='System', # noqa: E501 + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -295,61 +230,47 @@ def systems_get_with_http_info(self, id, content_type, accept, **kwargs): # noq _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systems_list(self, content_type, accept, **kwargs): # noqa: E501 - """List All Systems # noqa: E501 + def systems_command_builtin_restart(self, system_id, **kwargs): # noqa: E501 + """Restart a System # noqa: E501 - This endpoint returns all Systems. #### Sample Requests ``` curl -X GET https://console.jumpcloud.com/api/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint allows you to run the restart command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/restart \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systems_list(content_type, accept, async_req=True) + >>> thread = api.systems_command_builtin_restart(system_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: - :param str search: A nested object containing a string `searchTerm` and a list of `fields` to search on. - :param int skip: The offset into the records to return. - :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str filter: A filter to apply to the query. - :return: Systemslist + :param str system_id: (required) + :param str x_org_id: + :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systems_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systems_command_builtin_restart_with_http_info(system_id, **kwargs) # noqa: E501 else: - (data) = self.systems_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systems_command_builtin_restart_with_http_info(system_id, **kwargs) # noqa: E501 return data - def systems_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List All Systems # noqa: E501 + def systems_command_builtin_restart_with_http_info(self, system_id, **kwargs): # noqa: E501 + """Restart a System # noqa: E501 - This endpoint returns all Systems. #### Sample Requests ``` curl -X GET https://console.jumpcloud.com/api/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint allows you to run the restart command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/restart \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systems_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systems_command_builtin_restart_with_http_info(system_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: - :param str search: A nested object containing a string `searchTerm` and a list of `fields` to search on. - :param int skip: The offset into the records to return. - :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str filter: A filter to apply to the query. - :return: Systemslist + :param str system_id: (required) + :param str x_org_id: + :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'fields', 'limit', 'x_org_id', 'search', 'skip', 'sort', 'filter'] # noqa: E501 + all_params = ['system_id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -360,46 +281,26 @@ def systems_list_with_http_info(self, content_type, accept, **kwargs): # noqa: if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systems_list" % key + " to method systems_command_builtin_restart" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systems_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systems_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systems_list`, must be a value greater than or equal to `0`") # noqa: E501 + # verify the required parameter 'system_id' is set + if ('system_id' not in params or + params['system_id'] is None): + raise ValueError("Missing the required parameter `system_id` when calling `systems_command_builtin_restart`") # noqa: E501 + collection_formats = {} path_params = {} + if 'system_id' in params: + path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'fields' in params: - query_params.append(('fields', params['fields'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'search' in params: - query_params.append(('search', params['search'])) # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -409,22 +310,117 @@ def systems_list_with_http_info(self, content_type, accept, **kwargs): # noqa: header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systems/{system_id}/command/builtin/restart', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def systems_command_builtin_shutdown(self, system_id, **kwargs): # noqa: E501 + """Shutdown a System # noqa: E501 + + This endpoint allows you to run the shutdown command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/shutdown \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systems_command_builtin_shutdown(system_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str system_id: (required) + :param str x_org_id: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.systems_command_builtin_shutdown_with_http_info(system_id, **kwargs) # noqa: E501 + else: + (data) = self.systems_command_builtin_shutdown_with_http_info(system_id, **kwargs) # noqa: E501 + return data + + def systems_command_builtin_shutdown_with_http_info(self, system_id, **kwargs): # noqa: E501 + """Shutdown a System # noqa: E501 + + This endpoint allows you to run the shutdown command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/shutdown \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systems_command_builtin_shutdown_with_http_info(system_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str system_id: (required) + :param str x_org_id: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['system_id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method systems_command_builtin_shutdown" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'system_id' is set + if ('system_id' not in params or + params['system_id'] is None): + raise ValueError("Missing the required parameter `system_id` when calling `systems_command_builtin_shutdown`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'system_id' in params: + path_params['system_id'] = params['system_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systems', 'GET', + '/systems/{system_id}/command/builtin/shutdown', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Systemslist', # noqa: E501 + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -432,57 +428,51 @@ def systems_list_with_http_info(self, content_type, accept, **kwargs): # noqa: _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systems_put(self, id, content_type, accept, **kwargs): # noqa: E501 - """Update a system # noqa: E501 + def systems_delete(self, id, **kwargs): # noqa: E501 + """Delete a System # noqa: E501 - This endpoint allows you to update a system. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\":\"Name_Update\", \"allowSshPasswordAuthentication\":\"true\", \"allowSshRootLogin\":\"true\", \"allowMultiFactorAuthentication\":\"true\", \"allowPublicKeyAuthentication\":\"false\" }' ``` # noqa: E501 + This endpoint allows you to delete a system. This command will cause the system to uninstall the JumpCloud agent from its self which can can take about a minute. If the system is not connected to JumpCloud the system record will simply be removed. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systems_put(id, content_type, accept, async_req=True) + >>> thread = api.systems_delete(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param Systemput body: :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param str x_org_id: + :param str x_org_id: :return: System If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systems_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.systems_delete_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.systems_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systems_delete_with_http_info(id, **kwargs) # noqa: E501 return data - def systems_put_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """Update a system # noqa: E501 + def systems_delete_with_http_info(self, id, **kwargs): # noqa: E501 + """Delete a System # noqa: E501 - This endpoint allows you to update a system. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\":\"Name_Update\", \"allowSshPasswordAuthentication\":\"true\", \"allowSshRootLogin\":\"true\", \"allowMultiFactorAuthentication\":\"true\", \"allowPublicKeyAuthentication\":\"false\" }' ``` # noqa: E501 + This endpoint allows you to delete a system. This command will cause the system to uninstall the JumpCloud agent from its self which can can take about a minute. If the system is not connected to JumpCloud the system record will simply be removed. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systems_put_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.systems_delete_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param Systemput body: :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param str x_org_id: + :param str x_org_id: :return: System If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'body', '_date', 'authorization', 'x_org_id'] # noqa: E501 + all_params = ['id', '_date', 'authorization', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -493,22 +483,14 @@ def systems_put_with_http_info(self, id, content_type, accept, **kwargs): # noq if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systems_put" % key + " to method systems_delete" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `systems_put`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systems_put`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systems_put`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `systems_delete`") # noqa: E501 collection_formats = {} @@ -519,10 +501,6 @@ def systems_put_with_http_info(self, id, content_type, accept, **kwargs): # noq query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if '_date' in params: header_params['Date'] = params['_date'] # noqa: E501 if 'authorization' in params: @@ -534,21 +512,130 @@ def systems_put_with_http_info(self, id, content_type, accept, **kwargs): # noq local_var_files = {} body_params = None - if 'body' in params: - body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systems/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='System', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def systems_get(self, id, **kwargs): # noqa: E501 + """List an individual system # noqa: E501 + + This endpoint returns an individual system. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systems_get(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param str _date: Current date header for the System Context API + :param str authorization: Authorization header for the System Context API + :param str x_org_id: + :return: System + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.systems_get_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.systems_get_with_http_info(id, **kwargs) # noqa: E501 + return data + + def systems_get_with_http_info(self, id, **kwargs): # noqa: E501 + """List an individual system # noqa: E501 + + This endpoint returns an individual system. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systems_get_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param str _date: Current date header for the System Context API + :param str authorization: Authorization header for the System Context API + :param str x_org_id: + :return: System + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'fields', 'filter', '_date', 'authorization', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method systems_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `systems_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + + header_params = {} + if '_date' in params: + header_params['Date'] = params['_date'] # noqa: E501 + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systems/{id}', 'PUT', + '/systems/{id}', 'GET', path_params, query_params, header_params, @@ -563,61 +650,57 @@ def systems_put_with_http_info(self, id, content_type, accept, **kwargs): # noq _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systems_systemusers_binding_list(self, id, content_type, accept, **kwargs): # noqa: E501 - """List system user bindings # noqa: E501 + def systems_list(self, **kwargs): # noqa: E501 + """List All Systems # noqa: E501 - Hidden as Tags is deprecated List system user bindings for a specific system in a system and user binding format. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). #### Sample Request *List system user bindings for specific system* ``` curl -X https://console.jumpcloud.com/api/systems/{SystemID}/systemusers\\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ \" ``` # noqa: E501 + This endpoint returns all Systems. #### Sample Requests ``` curl -X GET https://console.jumpcloud.com/api/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systems_systemusers_binding_list(id, content_type, accept, async_req=True) + >>> thread = api.systems_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: + :param str search: A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. :param int skip: The offset into the records to return. :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str filter: A filter to apply to the query. - :param str x_org_id: - :return: Systemuserbinding + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :return: Systemslist If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systems_systemusers_binding_list_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.systems_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systems_systemusers_binding_list_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systems_list_with_http_info(**kwargs) # noqa: E501 return data - def systems_systemusers_binding_list_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """List system user bindings # noqa: E501 + def systems_list_with_http_info(self, **kwargs): # noqa: E501 + """List All Systems # noqa: E501 - Hidden as Tags is deprecated List system user bindings for a specific system in a system and user binding format. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). #### Sample Request *List system user bindings for specific system* ``` curl -X https://console.jumpcloud.com/api/systems/{SystemID}/systemusers\\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ \" ``` # noqa: E501 + This endpoint returns all Systems. #### Sample Requests ``` curl -X GET https://console.jumpcloud.com/api/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systems_systemusers_binding_list_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.systems_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: + :param str search: A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. :param int skip: The offset into the records to return. :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str filter: A filter to apply to the query. - :param str x_org_id: - :return: Systemuserbinding + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :return: Systemslist If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'fields', 'limit', 'skip', 'sort', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['fields', 'limit', 'x_org_id', 'search', 'skip', 'sort', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -628,36 +711,22 @@ def systems_systemusers_binding_list_with_http_info(self, id, content_type, acce if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systems_systemusers_binding_list" % key + " to method systems_list" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `systems_systemusers_binding_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systems_systemusers_binding_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systems_systemusers_binding_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systems_systemusers_binding_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 query_params = [] if 'fields' in params: query_params.append(('fields', params['fields'])) # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 + if 'search' in params: + query_params.append(('search', params['search'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 if 'sort' in params: @@ -666,10 +735,6 @@ def systems_systemusers_binding_list_with_http_info(self, id, content_type, acce query_params.append(('filter', params['filter'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -681,22 +746,18 @@ def systems_systemusers_binding_list_with_http_info(self, id, content_type, acce header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systems/{id}/systemusers', 'GET', + '/systems', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Systemuserbinding', # noqa: E501 + response_type='Systemslist', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -704,53 +765,53 @@ def systems_systemusers_binding_list_with_http_info(self, id, content_type, acce _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systems_systemusers_binding_put(self, id, content_type, accept, **kwargs): # noqa: E501 - """Update a system's or user's binding # noqa: E501 + def systems_put(self, id, **kwargs): # noqa: E501 + """Update a system # noqa: E501 - Hidden as Tags is deprecated Adds or removes a user binding for a system. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). #### Sample Request *Add (or remove) a system user to (from) a system* ``` curl \\ -d '{ \"add\": [\"[SYSTEM_USER_ID_TO_ADD_HERE]\"], \"remove\": [\"[SYSTEM_USER_ID_TO_REMOVE_HERE]\"] }' \\ -X PUT \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/systems/[SYSTEM_ID_HERE]/systemusers # noqa: E501 + This endpoint allows you to update a system. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\":\"Name_Update\", \"allowSshPasswordAuthentication\":\"true\", \"allowSshRootLogin\":\"true\", \"allowMultiFactorAuthentication\":\"true\", \"allowPublicKeyAuthentication\":\"false\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systems_systemusers_binding_put(id, content_type, accept, async_req=True) + >>> thread = api.systems_put(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param Systemuserbindingsput body: - :param str x_org_id: - :return: None + :param Systemput body: + :param str _date: Current date header for the System Context API + :param str authorization: Authorization header for the System Context API + :param str x_org_id: + :return: System If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systems_systemusers_binding_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.systems_put_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.systems_systemusers_binding_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systems_put_with_http_info(id, **kwargs) # noqa: E501 return data - def systems_systemusers_binding_put_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """Update a system's or user's binding # noqa: E501 + def systems_put_with_http_info(self, id, **kwargs): # noqa: E501 + """Update a system # noqa: E501 - Hidden as Tags is deprecated Adds or removes a user binding for a system. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). #### Sample Request *Add (or remove) a system user to (from) a system* ``` curl \\ -d '{ \"add\": [\"[SYSTEM_USER_ID_TO_ADD_HERE]\"], \"remove\": [\"[SYSTEM_USER_ID_TO_REMOVE_HERE]\"] }' \\ -X PUT \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/systems/[SYSTEM_ID_HERE]/systemusers # noqa: E501 + This endpoint allows you to update a system. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\":\"Name_Update\", \"allowSshPasswordAuthentication\":\"true\", \"allowSshRootLogin\":\"true\", \"allowMultiFactorAuthentication\":\"true\", \"allowPublicKeyAuthentication\":\"false\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systems_systemusers_binding_put_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.systems_put_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param Systemuserbindingsput body: - :param str x_org_id: - :return: None + :param Systemput body: + :param str _date: Current date header for the System Context API + :param str authorization: Authorization header for the System Context API + :param str x_org_id: + :return: System If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['id', 'body', '_date', 'authorization', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -761,22 +822,14 @@ def systems_systemusers_binding_put_with_http_info(self, id, content_type, accep if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systems_systemusers_binding_put" % key + " to method systems_put" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `systems_systemusers_binding_put`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systems_systemusers_binding_put`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systems_systemusers_binding_put`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `systems_put`") # noqa: E501 collection_formats = {} @@ -787,10 +840,10 @@ def systems_systemusers_binding_put_with_http_info(self, id, content_type, accep query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 + if '_date' in params: + header_params['Date'] = params['_date'] # noqa: E501 + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -812,14 +865,14 @@ def systems_systemusers_binding_put_with_http_info(self, id, content_type, accep auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systems/{id}/systemusers', 'PUT', + '/systems/{id}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='System', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/jcapiv1/jcapiv1/api/systemusers_api.py b/jcapiv1/jcapiv1/api/systemusers_api.py index af2a103..4be2d77 100644 --- a/jcapiv1/jcapiv1/api/systemusers_api.py +++ b/jcapiv1/jcapiv1/api/systemusers_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,53 +32,49 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def sshkey_delete(self, systemuser_id, id, content_type, accept, **kwargs): # noqa: E501 + def sshkey_delete(self, systemuser_id, id, **kwargs): # noqa: E501 """Delete a system user's Public SSH Keys # noqa: E501 This endpoint will delete a specific System User's SSH Key. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.sshkey_delete(systemuser_id, id, content_type, accept, async_req=True) + >>> thread = api.sshkey_delete(systemuser_id, id, async_req=True) >>> result = thread.get() :param async_req bool :param str systemuser_id: (required) :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: None + :param str x_org_id: + :return: str If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.sshkey_delete_with_http_info(systemuser_id, id, content_type, accept, **kwargs) # noqa: E501 + return self.sshkey_delete_with_http_info(systemuser_id, id, **kwargs) # noqa: E501 else: - (data) = self.sshkey_delete_with_http_info(systemuser_id, id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.sshkey_delete_with_http_info(systemuser_id, id, **kwargs) # noqa: E501 return data - def sshkey_delete_with_http_info(self, systemuser_id, id, content_type, accept, **kwargs): # noqa: E501 + def sshkey_delete_with_http_info(self, systemuser_id, id, **kwargs): # noqa: E501 """Delete a system user's Public SSH Keys # noqa: E501 This endpoint will delete a specific System User's SSH Key. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.sshkey_delete_with_http_info(systemuser_id, id, content_type, accept, async_req=True) + >>> thread = api.sshkey_delete_with_http_info(systemuser_id, id, async_req=True) >>> result = thread.get() :param async_req bool :param str systemuser_id: (required) :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: None + :param str x_org_id: + :return: str If the method is called asynchronously, returns the request thread. """ - all_params = ['systemuser_id', 'id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['systemuser_id', 'id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -102,14 +97,6 @@ def sshkey_delete_with_http_info(self, systemuser_id, id, content_type, accept, if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `sshkey_delete`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `sshkey_delete`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `sshkey_delete`") # noqa: E501 collection_formats = {} @@ -122,10 +109,6 @@ def sshkey_delete_with_http_info(self, systemuser_id, id, content_type, accept, query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -135,11 +118,7 @@ def sshkey_delete_with_http_info(self, systemuser_id, id, content_type, accept, body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + ['application/json', 'text/plain']) # noqa: E501 # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -152,7 +131,7 @@ def sshkey_delete_with_http_info(self, systemuser_id, id, content_type, accept, body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='str', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -160,51 +139,47 @@ def sshkey_delete_with_http_info(self, systemuser_id, id, content_type, accept, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def sshkey_list(self, id, content_type, accept, **kwargs): # noqa: E501 + def sshkey_list(self, id, **kwargs): # noqa: E501 """List a system user's public SSH keys # noqa: E501 This endpoint will return a specific System User's public SSH key. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.sshkey_list(id, content_type, accept, async_req=True) + >>> thread = api.sshkey_list(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: :return: list[Sshkeylist] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.sshkey_list_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.sshkey_list_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.sshkey_list_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.sshkey_list_with_http_info(id, **kwargs) # noqa: E501 return data - def sshkey_list_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def sshkey_list_with_http_info(self, id, **kwargs): # noqa: E501 """List a system user's public SSH keys # noqa: E501 This endpoint will return a specific System User's public SSH key. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.sshkey_list_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.sshkey_list_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: :return: list[Sshkeylist] If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -223,14 +198,6 @@ def sshkey_list_with_http_info(self, id, content_type, accept, **kwargs): # noq if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `sshkey_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `sshkey_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `sshkey_list`") # noqa: E501 collection_formats = {} @@ -241,10 +208,6 @@ def sshkey_list_with_http_info(self, id, content_type, accept, **kwargs): # noq query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -256,10 +219,6 @@ def sshkey_list_with_http_info(self, id, content_type, accept, **kwargs): # noq header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -279,53 +238,49 @@ def sshkey_list_with_http_info(self, id, content_type, accept, **kwargs): # noq _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def sshkey_post(self, id, content_type, accept, **kwargs): # noqa: E501 + def sshkey_post(self, id, **kwargs): # noqa: E501 """Create a system user's Public SSH Key # noqa: E501 This endpoint will create a specific System User's Public SSH Key. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.sshkey_post(id, content_type, accept, async_req=True) + >>> thread = api.sshkey_post(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :param Sshkeypost body: - :param str x_org_id: + :param str x_org_id: :return: Sshkeylist If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.sshkey_post_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.sshkey_post_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.sshkey_post_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.sshkey_post_with_http_info(id, **kwargs) # noqa: E501 return data - def sshkey_post_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def sshkey_post_with_http_info(self, id, **kwargs): # noqa: E501 """Create a system user's Public SSH Key # noqa: E501 This endpoint will create a specific System User's Public SSH Key. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.sshkey_post_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.sshkey_post_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :param Sshkeypost body: - :param str x_org_id: + :param str x_org_id: :return: Sshkeylist If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -344,14 +299,6 @@ def sshkey_post_with_http_info(self, id, content_type, accept, **kwargs): # noq if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `sshkey_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `sshkey_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `sshkey_post`") # noqa: E501 collection_formats = {} @@ -362,10 +309,6 @@ def sshkey_post_with_http_info(self, id, content_type, accept, **kwargs): # noq query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -402,51 +345,49 @@ def sshkey_post_with_http_info(self, id, content_type, accept, **kwargs): # noq _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systemusers_delete(self, id, content_type, accept, **kwargs): # noqa: E501 + def systemusers_delete(self, id, **kwargs): # noqa: E501 """Delete a system user # noqa: E501 This endpoint allows you to delete a particular system user. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_delete(id, content_type, accept, async_req=True) + >>> thread = api.systemusers_delete(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: + :param str cascade_manager: This is an optional flag that can be enabled on the DELETE call, DELETE /systemusers/{id}?cascade_manager=null. This parameter will clear the Manager attribute on all direct reports and then delete the account. :return: Systemuserreturn If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systemusers_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.systemusers_delete_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.systemusers_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systemusers_delete_with_http_info(id, **kwargs) # noqa: E501 return data - def systemusers_delete_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def systemusers_delete_with_http_info(self, id, **kwargs): # noqa: E501 """Delete a system user # noqa: E501 This endpoint allows you to delete a particular system user. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_delete_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.systemusers_delete_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: + :param str cascade_manager: This is an optional flag that can be enabled on the DELETE call, DELETE /systemusers/{id}?cascade_manager=null. This parameter will clear the Manager attribute on all direct reports and then delete the account. :return: Systemuserreturn If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id', 'cascade_manager'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -465,14 +406,6 @@ def systemusers_delete_with_http_info(self, id, content_type, accept, **kwargs): if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `systemusers_delete`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systemusers_delete`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systemusers_delete`") # noqa: E501 collection_formats = {} @@ -481,12 +414,10 @@ def systemusers_delete_with_http_info(self, id, content_type, accept, **kwargs): path_params['id'] = params['id'] # noqa: E501 query_params = [] + if 'cascade_manager' in params: + query_params.append(('cascade_manager', params['cascade_manager'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -498,10 +429,6 @@ def systemusers_delete_with_http_info(self, id, content_type, accept, **kwargs): header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -521,55 +448,150 @@ def systemusers_delete_with_http_info(self, id, content_type, accept, **kwargs): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systemusers_get(self, id, content_type, accept, **kwargs): # noqa: E501 + def systemusers_expire(self, id, **kwargs): # noqa: E501 + """Expire a system user's password # noqa: E501 + + This endpoint allows you to expire a user's password. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systemusers_expire(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str x_org_id: + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.systemusers_expire_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.systemusers_expire_with_http_info(id, **kwargs) # noqa: E501 + return data + + def systemusers_expire_with_http_info(self, id, **kwargs): # noqa: E501 + """Expire a system user's password # noqa: E501 + + This endpoint allows you to expire a user's password. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systemusers_expire_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str x_org_id: + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method systemusers_expire" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `systemusers_expire`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'text/plain']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systemusers/{id}/expire', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def systemusers_get(self, id, **kwargs): # noqa: E501 """List a system user # noqa: E501 This endpoint returns a particular System User. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_get(id, content_type, accept, async_req=True) + >>> thread = api.systemusers_get(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param str filter: A filter to apply to the query. - :param str x_org_id: + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param str x_org_id: :return: Systemuserreturn If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systemusers_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.systemusers_get_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.systemusers_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systemusers_get_with_http_info(id, **kwargs) # noqa: E501 return data - def systemusers_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def systemusers_get_with_http_info(self, id, **kwargs): # noqa: E501 """List a system user # noqa: E501 This endpoint returns a particular System User. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.systemusers_get_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param str filter: A filter to apply to the query. - :param str x_org_id: + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param str x_org_id: :return: Systemuserreturn If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'fields', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['id', 'fields', 'filter', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -588,14 +610,6 @@ def systemusers_get_with_http_info(self, id, content_type, accept, **kwargs): # if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `systemusers_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systemusers_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systemusers_get`") # noqa: E501 collection_formats = {} @@ -610,10 +624,6 @@ def systemusers_get_with_http_info(self, id, content_type, accept, **kwargs): # query_params.append(('filter', params['filter'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -625,10 +635,6 @@ def systemusers_get_with_http_info(self, id, content_type, accept, **kwargs): # header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -648,61 +654,57 @@ def systemusers_get_with_http_info(self, id, content_type, accept, **kwargs): # _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systemusers_list(self, content_type, accept, **kwargs): # noqa: E501 + def systemusers_list(self, **kwargs): # noqa: E501 """List all system users # noqa: E501 This endpoint returns all systemusers. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_list(content_type, accept, async_req=True) + >>> thread = api.systemusers_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. :param int skip: The offset into the records to return. - :param str sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str fields: The comma separated fields included in the returned records. If omitted the default list of fields will be returned. - :param str x_org_id: - :param str search: A nested object containing a string `searchTerm` and a list of `fields` to search on. - :param str filter: A filter to apply to the query. + :param str sort: The space separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param str fields: The space separated fields included in the returned records. If omitted the default list of fields will be returned. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param str x_org_id: + :param str search: A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. :return: Systemuserslist If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systemusers_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systemusers_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systemusers_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systemusers_list_with_http_info(**kwargs) # noqa: E501 return data - def systemusers_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def systemusers_list_with_http_info(self, **kwargs): # noqa: E501 """List all system users # noqa: E501 This endpoint returns all systemusers. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systemusers_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. :param int skip: The offset into the records to return. - :param str sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str fields: The comma separated fields included in the returned records. If omitted the default list of fields will be returned. - :param str x_org_id: - :param str search: A nested object containing a string `searchTerm` and a list of `fields` to search on. - :param str filter: A filter to apply to the query. + :param str sort: The space separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param str fields: The space separated fields included in the returned records. If omitted the default list of fields will be returned. + :param str filter: A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/` endpoints, e.g. `/search/systems`. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + :param str x_org_id: + :param str search: A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. :return: Systemuserslist If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'sort', 'fields', 'x_org_id', 'search', 'filter'] # noqa: E501 + all_params = ['limit', 'skip', 'sort', 'fields', 'filter', 'x_org_id', 'search'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -717,14 +719,6 @@ def systemusers_list_with_http_info(self, content_type, accept, **kwargs): # no ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systemusers_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systemusers_list`") # noqa: E501 collection_formats = {} @@ -739,18 +733,14 @@ def systemusers_list_with_http_info(self, content_type, accept, **kwargs): # no query_params.append(('sort', params['sort'])) # noqa: E501 if 'fields' in params: query_params.append(('fields', params['fields'])) # noqa: E501 - if 'search' in params: - query_params.append(('search', params['search'])) # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 + if 'search' in params: + query_params.append(('search', params['search'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -760,10 +750,6 @@ def systemusers_list_with_http_info(self, content_type, accept, **kwargs): # no header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -783,51 +769,45 @@ def systemusers_list_with_http_info(self, content_type, accept, **kwargs): # no _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systemusers_post(self, content_type, accept, **kwargs): # noqa: E501 - """Create a system user # noqa: E501 + def systemusers_mfasync(self, id, **kwargs): # noqa: E501 + """Sync a systemuser's mfa enrollment status # noqa: E501 - This endpoint allows you to create a new system user. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"username\":\"{username}\", \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` # noqa: E501 + This endpoint allows you to re-sync a user's mfa enrollment status #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systemusers/{UserID}/mfasync \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_post(content_type, accept, async_req=True) + >>> thread = api.systemusers_mfasync(id, async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param Systemuserputpost body: - :param str x_org_id: - :return: Systemuserreturn + :param str id: (required) + :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systemusers_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systemusers_mfasync_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.systemusers_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systemusers_mfasync_with_http_info(id, **kwargs) # noqa: E501 return data - def systemusers_post_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """Create a system user # noqa: E501 + def systemusers_mfasync_with_http_info(self, id, **kwargs): # noqa: E501 + """Sync a systemuser's mfa enrollment status # noqa: E501 - This endpoint allows you to create a new system user. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"username\":\"{username}\", \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` # noqa: E501 + This endpoint allows you to re-sync a user's mfa enrollment status #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systemusers/{UserID}/mfasync \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_post_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systemusers_mfasync_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param Systemuserputpost body: - :param str x_org_id: - :return: Systemuserreturn + :param str id: (required) + :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -838,59 +818,45 @@ def systemusers_post_with_http_info(self, content_type, accept, **kwargs): # no if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systemusers_post" % key + " to method systemusers_mfasync" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systemusers_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systemusers_post`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `systemusers_mfasync`") # noqa: E501 collection_formats = {} path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - if 'x_org_id' in params: - header_params['x-org-id'] = params['x_org_id'] # noqa: E501 form_params = [] local_var_files = {} body_params = None - if 'body' in params: - body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systemusers', 'POST', + '/systemusers/{id}/mfasync', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Systemuserreturn', # noqa: E501 + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -898,53 +864,49 @@ def systemusers_post_with_http_info(self, content_type, accept, **kwargs): # no _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systemusers_put(self, id, content_type, accept, **kwargs): # noqa: E501 - """Update a system user # noqa: E501 + def systemusers_post(self, **kwargs): # noqa: E501 + """Create a system user # noqa: E501 - This endpoint allows you to update a system user. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` # noqa: E501 + \"This endpoint allows you to create a new system user. #### Default User State The `state` of the user can be explicitly passed in or omitted. If `state` is omitted from the request, then the user will get created using the value returned from the [Get an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organizations_get) endpoint. The default user state for manually created users is stored in `settings.newSystemUserStateDefaults.manualEntry` These default state values can be changed in the admin portal settings or by using the [Update an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organization_put) endpoint. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"username\":\"{username}\", \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_put(id, content_type, accept, async_req=True) + >>> thread = api.systemusers_post(async_req=True) >>> result = thread.get() :param async_req bool - :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param Systemuserput body: - :param str x_org_id: + :param Systemuserputpost body: + :param str x_org_id: + :param str full_validation_details: Pass this query parameter when a client wants all validation errors to be returned with a detailed error response for the form field specified. The current form fields are allowed: * `password` #### Password validation flag Use the `password` validation flag to receive details on a possible bad request response ``` ?fullValidationDetails=password ``` Without the flag, default behavior will be a normal 400 with only a single validation string error #### Expected Behavior Clients can expect a list of validation error mappings for the validation query field in the details provided on the response: ``` { \"code\": 400, \"message\": \"Password validation fail\", \"status\": \"INVALID_ARGUMENT\", \"details\": [ { \"fieldViolationsList\": [ {\"field\": \"password\", \"description\": \"specialCharacter\"} ], '@type': 'type.googleapis.com/google.rpc.BadRequest', }, ], }, ``` :return: Systemuserreturn If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systemusers_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.systemusers_post_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systemusers_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systemusers_post_with_http_info(**kwargs) # noqa: E501 return data - def systemusers_put_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """Update a system user # noqa: E501 + def systemusers_post_with_http_info(self, **kwargs): # noqa: E501 + """Create a system user # noqa: E501 - This endpoint allows you to update a system user. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` # noqa: E501 + \"This endpoint allows you to create a new system user. #### Default User State The `state` of the user can be explicitly passed in or omitted. If `state` is omitted from the request, then the user will get created using the value returned from the [Get an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organizations_get) endpoint. The default user state for manually created users is stored in `settings.newSystemUserStateDefaults.manualEntry` These default state values can be changed in the admin portal settings or by using the [Update an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organization_put) endpoint. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"username\":\"{username}\", \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_put_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.systemusers_post_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param Systemuserput body: - :param str x_org_id: + :param Systemuserputpost body: + :param str x_org_id: + :param str full_validation_details: Pass this query parameter when a client wants all validation errors to be returned with a detailed error response for the form field specified. The current form fields are allowed: * `password` #### Password validation flag Use the `password` validation flag to receive details on a possible bad request response ``` ?fullValidationDetails=password ``` Without the flag, default behavior will be a normal 400 with only a single validation string error #### Expected Behavior Clients can expect a list of validation error mappings for the validation query field in the details provided on the response: ``` { \"code\": 400, \"message\": \"Password validation fail\", \"status\": \"INVALID_ARGUMENT\", \"details\": [ { \"fieldViolationsList\": [ {\"field\": \"password\", \"description\": \"specialCharacter\"} ], '@type': 'type.googleapis.com/google.rpc.BadRequest', }, ], }, ``` :return: Systemuserreturn If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['body', 'x_org_id', 'full_validation_details'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -955,36 +917,20 @@ def systemusers_put_with_http_info(self, id, content_type, accept, **kwargs): # if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systemusers_put" % key + " to method systemusers_post" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `systemusers_put`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systemusers_put`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systemusers_put`") # noqa: E501 collection_formats = {} path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 query_params = [] + if 'full_validation_details' in params: + query_params.append(('fullValidationDetails', params['full_validation_details'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1006,7 +952,7 @@ def systemusers_put_with_http_info(self, id, content_type, accept, **kwargs): # auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systemusers/{id}', 'PUT', + '/systemusers', 'POST', path_params, query_params, header_params, @@ -1021,53 +967,51 @@ def systemusers_put_with_http_info(self, id, content_type, accept, **kwargs): # _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systemusers_resetmfa(self, id, content_type, accept, **kwargs): # noqa: E501 - """Reset a system user's MFA token # noqa: E501 + def systemusers_put(self, id, **kwargs): # noqa: E501 + """Update a system user # noqa: E501 - This endpoint allows you to reset the TOTP key for a specified system user and put them in an TOTP MFA enrollment period. This will result in the user being prompted to setup TOTP MFA when logging into userportal. Please be aware that if the user does not complete TOTP MFA setup before the `exclusionUntil` date, they will be locked out of any resources that require TOTP MFA. Please refer to our [Knowledge Base Article](https://support.jumpcloud.com/customer/en/portal/articles/2959138-using-multifactor-authentication-with-jumpcloud) on setting up MFA for more information. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systemusers/{UserID}/resetmfa \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"exclusion\": true, \"exclusionUntil\": \"{date-time}\"}' ``` # noqa: E501 + This endpoint allows you to update a system user. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_resetmfa(id, content_type, accept, async_req=True) + >>> thread = api.systemusers_put(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param Body1 body: - :param str x_org_id: - :return: None + :param Systemuserput body: + :param str x_org_id: + :param str full_validation_details: This endpoint can take in a query when a client wants all validation errors to be returned with error response for the form field specified, i.e. 'password' #### Password validation flag Use the \"password\" validation flag to receive details on a possible bad request response Without the `password` flag, default behavior will be a normal 400 with only a validation string message ``` ?fullValidationDetails=password ``` #### Expected Behavior Clients can expect a list of validation error mappings for the validation query field in the details provided on the response: ``` { \"code\": 400, \"message\": \"Password validation fail\", \"status\": \"INVALID_ARGUMENT\", \"details\": [ { \"fieldViolationsList\": [{ \"field\": \"password\", \"description\": \"passwordHistory\" }], '@type': 'type.googleapis.com/google.rpc.BadRequest', }, ], }, ``` + :return: Systemuserreturn If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systemusers_resetmfa_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.systemusers_put_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.systemusers_resetmfa_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systemusers_put_with_http_info(id, **kwargs) # noqa: E501 return data - def systemusers_resetmfa_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """Reset a system user's MFA token # noqa: E501 + def systemusers_put_with_http_info(self, id, **kwargs): # noqa: E501 + """Update a system user # noqa: E501 - This endpoint allows you to reset the TOTP key for a specified system user and put them in an TOTP MFA enrollment period. This will result in the user being prompted to setup TOTP MFA when logging into userportal. Please be aware that if the user does not complete TOTP MFA setup before the `exclusionUntil` date, they will be locked out of any resources that require TOTP MFA. Please refer to our [Knowledge Base Article](https://support.jumpcloud.com/customer/en/portal/articles/2959138-using-multifactor-authentication-with-jumpcloud) on setting up MFA for more information. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systemusers/{UserID}/resetmfa \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"exclusion\": true, \"exclusionUntil\": \"{date-time}\"}' ``` # noqa: E501 + This endpoint allows you to update a system user. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_resetmfa_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.systemusers_put_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param Body1 body: - :param str x_org_id: - :return: None + :param Systemuserput body: + :param str x_org_id: + :param str full_validation_details: This endpoint can take in a query when a client wants all validation errors to be returned with error response for the form field specified, i.e. 'password' #### Password validation flag Use the \"password\" validation flag to receive details on a possible bad request response Without the `password` flag, default behavior will be a normal 400 with only a validation string message ``` ?fullValidationDetails=password ``` #### Expected Behavior Clients can expect a list of validation error mappings for the validation query field in the details provided on the response: ``` { \"code\": 400, \"message\": \"Password validation fail\", \"status\": \"INVALID_ARGUMENT\", \"details\": [ { \"fieldViolationsList\": [{ \"field\": \"password\", \"description\": \"passwordHistory\" }], '@type': 'type.googleapis.com/google.rpc.BadRequest', }, ], }, ``` + :return: Systemuserreturn If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['id', 'body', 'x_org_id', 'full_validation_details'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1078,22 +1022,14 @@ def systemusers_resetmfa_with_http_info(self, id, content_type, accept, **kwargs if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systemusers_resetmfa" % key + " to method systemusers_put" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `systemusers_resetmfa`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systemusers_resetmfa`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systemusers_resetmfa`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `systemusers_put`") # noqa: E501 collection_formats = {} @@ -1102,12 +1038,10 @@ def systemusers_resetmfa_with_http_info(self, id, content_type, accept, **kwargs path_params['id'] = params['id'] # noqa: E501 query_params = [] + if 'full_validation_details' in params: + query_params.append(('fullValidationDetails', params['full_validation_details'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1129,14 +1063,14 @@ def systemusers_resetmfa_with_http_info(self, id, content_type, accept, **kwargs auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systemusers/{id}/resetmfa', 'POST', + '/systemusers/{id}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='Systemuserreturn', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1144,61 +1078,49 @@ def systemusers_resetmfa_with_http_info(self, id, content_type, accept, **kwargs _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systemusers_systems_binding_list(self, id, content_type, accept, **kwargs): # noqa: E501 - """List system user binding # noqa: E501 + def systemusers_resetmfa(self, id, **kwargs): # noqa: E501 + """Reset a system user's MFA token # noqa: E501 - Hidden as Tags is deprecated Adds or removes a system binding for a user. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). List system bindings for a specific system user in a system and user binding format. ### Examples #### List system bindings for specific system user ``` curl \\ -H 'Content-Type: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/systemusers/[SYSTEM_USER_ID_HERE]/systems\" ``` # noqa: E501 + This endpoint allows you to reset the TOTP key for a specified system user and put them in an TOTP MFA enrollment period. This will result in the user being prompted to setup TOTP MFA when logging into userportal. Please be aware that if the user does not complete TOTP MFA setup before the `exclusionUntil` date, they will be locked out of any resources that require TOTP MFA. Please refer to our [Knowledge Base Article](https://support.jumpcloud.com/customer/en/portal/articles/2959138-using-multifactor-authentication-with-jumpcloud) on setting up MFA for more information. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systemusers/{UserID}/resetmfa \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"exclusion\": true, \"exclusionUntil\": \"{date-time}\"}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_systems_binding_list(id, content_type, accept, async_req=True) + >>> thread = api.systemusers_resetmfa(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str filter: A filter to apply to the query. - :param str x_org_id: - :return: object + :param IdResetmfaBody body: + :param str x_org_id: + :return: str If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systemusers_systems_binding_list_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.systemusers_resetmfa_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.systemusers_systems_binding_list_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systemusers_resetmfa_with_http_info(id, **kwargs) # noqa: E501 return data - def systemusers_systems_binding_list_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """List system user binding # noqa: E501 + def systemusers_resetmfa_with_http_info(self, id, **kwargs): # noqa: E501 + """Reset a system user's MFA token # noqa: E501 - Hidden as Tags is deprecated Adds or removes a system binding for a user. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). List system bindings for a specific system user in a system and user binding format. ### Examples #### List system bindings for specific system user ``` curl \\ -H 'Content-Type: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/systemusers/[SYSTEM_USER_ID_HERE]/systems\" ``` # noqa: E501 + This endpoint allows you to reset the TOTP key for a specified system user and put them in an TOTP MFA enrollment period. This will result in the user being prompted to setup TOTP MFA when logging into userportal. Please be aware that if the user does not complete TOTP MFA setup before the `exclusionUntil` date, they will be locked out of any resources that require TOTP MFA. Please refer to our [Knowledge Base Article](https://support.jumpcloud.com/customer/en/portal/articles/2959138-using-multifactor-authentication-with-jumpcloud) on setting up MFA for more information. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systemusers/{UserID}/resetmfa \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"exclusion\": true, \"exclusionUntil\": \"{date-time}\"}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_systems_binding_list_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.systemusers_resetmfa_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str filter: A filter to apply to the query. - :param str x_org_id: - :return: object + :param IdResetmfaBody body: + :param str x_org_id: + :return: str If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'fields', 'limit', 'skip', 'sort', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1209,25 +1131,15 @@ def systemusers_systems_binding_list_with_http_info(self, id, content_type, acce if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systemusers_systems_binding_list" % key + " to method systemusers_resetmfa" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `systemusers_systems_binding_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systemusers_systems_binding_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systemusers_systems_binding_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systemusers_systems_binding_list`, must be a value greater than or equal to `0`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `systemusers_resetmfa`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1235,22 +1147,8 @@ def systemusers_systems_binding_list_with_http_info(self, id, content_type, acce path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'fields' in params: - query_params.append(('fields', params['fields'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1258,9 +1156,11 @@ def systemusers_systems_binding_list_with_http_info(self, id, content_type, acce local_var_files = {} body_params = None + if 'body' in params: + body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + ['application/json', 'text/plain']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 @@ -1270,14 +1170,14 @@ def systemusers_systems_binding_list_with_http_info(self, id, content_type, acce auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systemusers/{id}/systems', 'GET', + '/systemusers/{id}/resetmfa', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='object', # noqa: E501 + response_type='str', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1285,53 +1185,47 @@ def systemusers_systems_binding_list_with_http_info(self, id, content_type, acce _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systemusers_systems_binding_put(self, id, content_type, accept, **kwargs): # noqa: E501 - """Update a system user binding # noqa: E501 + def systemusers_state_activate(self, id, **kwargs): # noqa: E501 + """Activate System User # noqa: E501 - Hidden as Tags is deprecated Adds or removes a system binding for a user. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). ### Example #### Add (or remove) system to system user ``` curl \\ -d '{ \"add\": [\"[SYSTEM_ID_TO_ADD_HERE]\"], \"remove\": [\"[SYSTEM_ID_TO_REMOVE_HERE]\"] }' \\ -X PUT \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/systemusers/[SYSTEM_USER_ID_HERE]/systems\" ``` # noqa: E501 + This endpoint changes the state of a STAGED user to ACTIVATED. #### Email Flag Use the \"email\" flag to determine whether or not to send a Welcome or Activation email to the newly activated user. Sending an empty body without the `email` flag, will send an email with default behavior (see the \"Behavior\" section below) ``` {} ``` Sending `email=true` flag will send an email with default behavior (see `Behavior` below) ``` { \"email\": true } ``` Populated email will override the default behavior and send to the specified email value ``` { \"email\": \"example@example.com\" } ``` Sending `email=false` will suppress sending the email ``` { \"email\": false } ``` #### Behavior Users with a password will be sent a Welcome email to: - The address specified in `email` flag in the request - If no `email` flag, the user's primary email address (default behavior) Users without a password will be sent an Activation email to: - The address specified in `email` flag in the request - If no `email` flag, the user's alternate email address (default behavior) - If no alternate email address, the user's primary email address (default behavior) #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/systemusers/{id}/state/activate \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: ' \\ -d '{ \"email\": \"alternate-activation-email@email.com\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_systems_binding_put(id, content_type, accept, async_req=True) + >>> thread = api.systemusers_state_activate(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param Usersystembindingsput body: - :param str x_org_id: - :return: Usersystembinding + :param StateActivateBody body: + :return: str If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systemusers_systems_binding_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.systemusers_state_activate_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.systemusers_systems_binding_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systemusers_state_activate_with_http_info(id, **kwargs) # noqa: E501 return data - def systemusers_systems_binding_put_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """Update a system user binding # noqa: E501 + def systemusers_state_activate_with_http_info(self, id, **kwargs): # noqa: E501 + """Activate System User # noqa: E501 - Hidden as Tags is deprecated Adds or removes a system binding for a user. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). ### Example #### Add (or remove) system to system user ``` curl \\ -d '{ \"add\": [\"[SYSTEM_ID_TO_ADD_HERE]\"], \"remove\": [\"[SYSTEM_ID_TO_REMOVE_HERE]\"] }' \\ -X PUT \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/systemusers/[SYSTEM_USER_ID_HERE]/systems\" ``` # noqa: E501 + This endpoint changes the state of a STAGED user to ACTIVATED. #### Email Flag Use the \"email\" flag to determine whether or not to send a Welcome or Activation email to the newly activated user. Sending an empty body without the `email` flag, will send an email with default behavior (see the \"Behavior\" section below) ``` {} ``` Sending `email=true` flag will send an email with default behavior (see `Behavior` below) ``` { \"email\": true } ``` Populated email will override the default behavior and send to the specified email value ``` { \"email\": \"example@example.com\" } ``` Sending `email=false` will suppress sending the email ``` { \"email\": false } ``` #### Behavior Users with a password will be sent a Welcome email to: - The address specified in `email` flag in the request - If no `email` flag, the user's primary email address (default behavior) Users without a password will be sent an Activation email to: - The address specified in `email` flag in the request - If no `email` flag, the user's alternate email address (default behavior) - If no alternate email address, the user's primary email address (default behavior) #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/systemusers/{id}/state/activate \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: ' \\ -d '{ \"email\": \"alternate-activation-email@email.com\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_systems_binding_put_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.systemusers_state_activate_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param Usersystembindingsput body: - :param str x_org_id: - :return: Usersystembinding + :param StateActivateBody body: + :return: str If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['id', 'body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1342,22 +1236,14 @@ def systemusers_systems_binding_put_with_http_info(self, id, content_type, accep if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systemusers_systems_binding_put" % key + " to method systemusers_state_activate" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `systemusers_systems_binding_put`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systemusers_systems_binding_put`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systemusers_systems_binding_put`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `systemusers_state_activate`") # noqa: E501 collection_formats = {} @@ -1368,12 +1254,6 @@ def systemusers_systems_binding_put_with_http_info(self, id, content_type, accep query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - if 'x_org_id' in params: - header_params['x-org-id'] = params['x_org_id'] # noqa: E501 form_params = [] local_var_files = {} @@ -1393,14 +1273,14 @@ def systemusers_systems_binding_put_with_http_info(self, id, content_type, accep auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systemusers/{id}/systems', 'PUT', + '/systemusers/{id}/state/activate', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Usersystembinding', # noqa: E501 + response_type='str', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1408,51 +1288,47 @@ def systemusers_systems_binding_put_with_http_info(self, id, content_type, accep _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systemusers_unlock(self, id, content_type, accept, **kwargs): # noqa: E501 + def systemusers_unlock(self, id, **kwargs): # noqa: E501 """Unlock a system user # noqa: E501 This endpoint allows you to unlock a user's account. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_unlock(id, content_type, accept, async_req=True) + >>> thread = api.systemusers_unlock(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: None + :param str x_org_id: + :return: str If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systemusers_unlock_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.systemusers_unlock_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.systemusers_unlock_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systemusers_unlock_with_http_info(id, **kwargs) # noqa: E501 return data - def systemusers_unlock_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def systemusers_unlock_with_http_info(self, id, **kwargs): # noqa: E501 """Unlock a system user # noqa: E501 This endpoint allows you to unlock a user's account. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systemusers_unlock_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.systemusers_unlock_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: None + :param str x_org_id: + :return: str If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1471,14 +1347,6 @@ def systemusers_unlock_with_http_info(self, id, content_type, accept, **kwargs): if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `systemusers_unlock`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systemusers_unlock`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systemusers_unlock`") # noqa: E501 collection_formats = {} @@ -1491,10 +1359,6 @@ def systemusers_unlock_with_http_info(self, id, content_type, accept, **kwargs): header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1502,11 +1366,7 @@ def systemusers_unlock_with_http_info(self, id, content_type, accept, **kwargs): body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + ['application/json', 'text/plain']) # noqa: E501 # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1519,7 +1379,7 @@ def systemusers_unlock_with_http_info(self, id, content_type, accept, **kwargs): body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='str', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/jcapiv1/jcapiv1/api/tags_api.py b/jcapiv1/jcapiv1/api/tags_api.py deleted file mode 100644 index b7bfa0c..0000000 --- a/jcapiv1/jcapiv1/api/tags_api.py +++ /dev/null @@ -1,645 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from jcapiv1.api_client import ApiClient - - -class TagsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def tags_delete(self, name, content_type, accept, **kwargs): # noqa: E501 - """Delete a Tag # noqa: E501 - - Hidden as Tags is deprecated Delete a Tag. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.tags_delete(name, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param str content_type: (required) - :param str accept: (required) - :return: Tag - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.tags_delete_with_http_info(name, content_type, accept, **kwargs) # noqa: E501 - else: - (data) = self.tags_delete_with_http_info(name, content_type, accept, **kwargs) # noqa: E501 - return data - - def tags_delete_with_http_info(self, name, content_type, accept, **kwargs): # noqa: E501 - """Delete a Tag # noqa: E501 - - Hidden as Tags is deprecated Delete a Tag. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.tags_delete_with_http_info(name, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param str content_type: (required) - :param str accept: (required) - :return: Tag - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'content_type', 'accept'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method tags_delete" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `tags_delete`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `tags_delete`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `tags_delete`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/tags/{name}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Tag', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def tags_get(self, name, content_type, accept, **kwargs): # noqa: E501 - """List a Tag # noqa: E501 - - Hidden as Tags is deprecated Returns a specific tag. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.tags_get(name, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param str content_type: (required) - :param str accept: (required) - :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str filter: A filter to apply to the query. - :return: Tag - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.tags_get_with_http_info(name, content_type, accept, **kwargs) # noqa: E501 - else: - (data) = self.tags_get_with_http_info(name, content_type, accept, **kwargs) # noqa: E501 - return data - - def tags_get_with_http_info(self, name, content_type, accept, **kwargs): # noqa: E501 - """List a Tag # noqa: E501 - - Hidden as Tags is deprecated Returns a specific tag. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.tags_get_with_http_info(name, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param str content_type: (required) - :param str accept: (required) - :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str filter: A filter to apply to the query. - :return: Tag - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'content_type', 'accept', 'fields', 'limit', 'skip', 'sort', 'filter'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method tags_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `tags_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `tags_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `tags_get`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `tags_get`, must be a value greater than or equal to `0`") # noqa: E501 - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - if 'fields' in params: - query_params.append(('fields', params['fields'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 - - header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/Tags/{name}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Tag', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def tags_list(self, content_type, accept, **kwargs): # noqa: E501 - """List All Tags # noqa: E501 - - Hidden as Tags is deprecated Returns all Tags. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.tags_list(content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str filter: A filter to apply to the query. - :return: Tagslist - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.tags_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 - else: - (data) = self.tags_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 - return data - - def tags_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List All Tags # noqa: E501 - - Hidden as Tags is deprecated Returns all Tags. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.tags_list_with_http_info(content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param str fields: Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param str sort: Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - :param str filter: A filter to apply to the query. - :return: Tagslist - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['content_type', 'accept', 'fields', 'limit', 'skip', 'sort', 'filter'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method tags_list" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `tags_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `tags_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `tags_list`, must be a value greater than or equal to `0`") # noqa: E501 - collection_formats = {} - - path_params = {} - - query_params = [] - if 'fields' in params: - query_params.append(('fields', params['fields'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 - - header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/tags', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Tagslist', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def tags_post(self, content_type, accept, **kwargs): # noqa: E501 - """Create a Tag # noqa: E501 - - Hidden as Tags is deprecated Create a tag. ### Examples #### Create a new Tag ``` curl \\ -d '{\"name\" : \"Developers\"}' \\ -X 'POST' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/tags\" ``` # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.tags_post(content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param Tagpost body: - :return: Tag - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.tags_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 - else: - (data) = self.tags_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 - return data - - def tags_post_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """Create a Tag # noqa: E501 - - Hidden as Tags is deprecated Create a tag. ### Examples #### Create a new Tag ``` curl \\ -d '{\"name\" : \"Developers\"}' \\ -X 'POST' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/tags\" ``` # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.tags_post_with_http_info(content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param Tagpost body: - :return: Tag - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['content_type', 'accept', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method tags_post" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `tags_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `tags_post`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/tags', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Tag', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def tags_put(self, name, content_type, accept, **kwargs): # noqa: E501 - """Update a Tag # noqa: E501 - - Hidden as Tags is deprecated Update a specific tag. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.tags_put(name, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param str content_type: (required) - :param str accept: (required) - :param Tagput body: - :return: Tag - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.tags_put_with_http_info(name, content_type, accept, **kwargs) # noqa: E501 - else: - (data) = self.tags_put_with_http_info(name, content_type, accept, **kwargs) # noqa: E501 - return data - - def tags_put_with_http_info(self, name, content_type, accept, **kwargs): # noqa: E501 - """Update a Tag # noqa: E501 - - Hidden as Tags is deprecated Update a specific tag. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.tags_put_with_http_info(name, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str name: (required) - :param str content_type: (required) - :param str accept: (required) - :param Tagput body: - :return: Tag - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['name', 'content_type', 'accept', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method tags_put" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'name' is set - if ('name' not in params or - params['name'] is None): - raise ValueError("Missing the required parameter `name` when calling `tags_put`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `tags_put`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `tags_put`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'name' in params: - path_params['name'] = params['name'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/Tag/{name}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Tag', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/jcapiv1/jcapiv1/api/users_api.py b/jcapiv1/jcapiv1/api/users_api.py new file mode 100644 index 0000000..5ff71de --- /dev/null +++ b/jcapiv1/jcapiv1/api/users_api.py @@ -0,0 +1,330 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv1.api_client import ApiClient + + +class UsersApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def admin_totpreset_begin(self, id, **kwargs): # noqa: E501 + """Administrator TOTP Reset Initiation # noqa: E501 + + This endpoint initiates a TOTP reset for an admin. This request does not accept a body. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.admin_totpreset_begin(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.admin_totpreset_begin_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.admin_totpreset_begin_with_http_info(id, **kwargs) # noqa: E501 + return data + + def admin_totpreset_begin_with_http_info(self, id, **kwargs): # noqa: E501 + """Administrator TOTP Reset Initiation # noqa: E501 + + This endpoint initiates a TOTP reset for an admin. This request does not accept a body. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.admin_totpreset_begin_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method admin_totpreset_begin" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `admin_totpreset_begin`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/users/resettotp/{id}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def users_put(self, id, **kwargs): # noqa: E501 + """Update a user # noqa: E501 + + This endpoint allows you to update a user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.users_put(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param Userput body: + :param str x_org_id: + :return: Userreturn + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.users_put_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.users_put_with_http_info(id, **kwargs) # noqa: E501 + return data + + def users_put_with_http_info(self, id, **kwargs): # noqa: E501 + """Update a user # noqa: E501 + + This endpoint allows you to update a user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.users_put_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param Userput body: + :param str x_org_id: + :return: Userreturn + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method users_put" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `users_put`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/users/{id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Userreturn', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def users_reactivate_get(self, id, **kwargs): # noqa: E501 + """Administrator Password Reset Initiation # noqa: E501 + + This endpoint triggers the sending of a reactivation e-mail to an administrator. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.users_reactivate_get(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.users_reactivate_get_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.users_reactivate_get_with_http_info(id, **kwargs) # noqa: E501 + return data + + def users_reactivate_get_with_http_info(self, id, **kwargs): # noqa: E501 + """Administrator Password Reset Initiation # noqa: E501 + + This endpoint triggers the sending of a reactivation e-mail to an administrator. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.users_reactivate_get_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method users_reactivate_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `users_reactivate_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/users/reactivate/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv1/jcapiv1/api_client.py b/jcapiv1/jcapiv1/api_client.py index 673ef8d..b9d3289 100644 --- a/jcapiv1/jcapiv1/api_client.py +++ b/jcapiv1/jcapiv1/api_client.py @@ -1,14 +1,13 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import datetime @@ -73,7 +72,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'Swagger-Codegen/4.0.0/python' + self.user_agent = 'Swagger-Codegen/5.0.0/python' def __del__(self): self.pool.close() @@ -524,10 +523,14 @@ def __deserialize_file(self, response): filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).group(1) path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - f.write(response.data) - + response_data = response.data + with open(path, "wb") as f: + if isinstance(response_data, str): + # change str to bytes so we can write it + response_data = response_data.encode('utf-8') + f.write(response_data) + else: + f.write(response_data) return path def __deserialize_primitive(self, data, klass): @@ -592,7 +595,7 @@ def __deserialize_datatime(self, string): ) def __hasattr(self, object, name): - return name in object.__class__.__dict__ + return name in object.__class__.__dict__ def __deserialize_model(self, data, klass): """Deserializes list or dict to model. @@ -602,8 +605,7 @@ def __deserialize_model(self, data, klass): :return: model object. """ - if (not klass.swagger_types and - not self.__hasattr(klass, 'get_real_child_model')): + if not klass.swagger_types and not self.__hasattr(klass, 'get_real_child_model'): return data kwargs = {} diff --git a/jcapiv1/jcapiv1/configuration.py b/jcapiv1/jcapiv1/configuration.py index b79a37e..39a381a 100644 --- a/jcapiv1/jcapiv1/configuration.py +++ b/jcapiv1/jcapiv1/configuration.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import copy @@ -23,22 +22,29 @@ from six.moves import http_client as httplib -class Configuration(object): +class TypeWithDefault(type): + def __init__(cls, name, bases, dct): + super(TypeWithDefault, cls).__init__(name, bases, dct) + cls._default = None + + def __call__(cls): + if cls._default is None: + cls._default = type.__call__(cls) + return copy.copy(cls._default) + + def set_default(cls, default): + cls._default = copy.copy(default) + + +class Configuration(six.with_metaclass(TypeWithDefault, object)): """NOTE: This class is auto generated by the swagger code generator program. Ref: https://github.com/swagger-api/swagger-codegen Do not edit the class manually. """ - _default = None - def __init__(self): """Constructor""" - if self._default: - for key in self._default.__dict__.keys(): - self.__dict__[key] = copy.copy(self._default.__dict__[key]) - return - # Default Base url self.host = "https://console.jumpcloud.com/api" # Temp file folder for downloading files @@ -49,11 +55,12 @@ def __init__(self): self.api_key = {} # dict to store API prefix (e.g. Bearer) self.api_key_prefix = {} + # function to refresh API key if expired + self.refresh_api_key_hook = None # Username for HTTP basic authentication self.username = "" # Password for HTTP basic authentication self.password = "" - # Logging Settings self.logger = {} self.logger["package_logger"] = logging.getLogger("jcapiv1") @@ -94,10 +101,6 @@ def __init__(self): # Safe chars for path_param self.safe_chars_for_path_param = '' - @classmethod - def set_default(cls, default): - cls._default = default - @property def logger_file(self): """The logger file. @@ -200,11 +203,16 @@ def get_api_key_with_prefix(self, identifier): :param identifier: The identifier of apiKey. :return: The token for api key authentication. """ - if (self.api_key.get(identifier) and - self.api_key_prefix.get(identifier)): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 - elif self.api_key.get(identifier): - return self.api_key[identifier] + if self.refresh_api_key_hook: + self.refresh_api_key_hook(self) + + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key def get_basic_auth_token(self): """Gets HTTP basic authentication header (string). @@ -228,7 +236,6 @@ def auth_settings(self): 'key': 'x-api-key', 'value': self.get_api_key_with_prefix('x-api-key') }, - } def to_debug_report(self): @@ -240,5 +247,5 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 1.0\n"\ - "SDK Package Version: 4.0.0".\ + "SDK Package Version: 5.0.0".\ format(env=sys.platform, pyversion=sys.version) diff --git a/jcapiv1/jcapiv1/models/__init__.py b/jcapiv1/jcapiv1/models/__init__.py index beba1cc..ae68549 100644 --- a/jcapiv1/jcapiv1/models/__init__.py +++ b/jcapiv1/jcapiv1/models/__init__.py @@ -2,16 +2,15 @@ # flake8: noqa """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import # import models into model package @@ -23,12 +22,14 @@ from jcapiv1.models.application_config_constant_attributes import ApplicationConfigConstantAttributes from jcapiv1.models.application_config_constant_attributes_value import ApplicationConfigConstantAttributesValue from jcapiv1.models.application_config_database_attributes import ApplicationConfigDatabaseAttributes +from jcapiv1.models.application_logo import ApplicationLogo from jcapiv1.models.applicationslist import Applicationslist from jcapiv1.models.applicationtemplate import Applicationtemplate from jcapiv1.models.applicationtemplate_jit import ApplicationtemplateJit +from jcapiv1.models.applicationtemplate_logo import ApplicationtemplateLogo +from jcapiv1.models.applicationtemplate_oidc import ApplicationtemplateOidc +from jcapiv1.models.applicationtemplate_provision import ApplicationtemplateProvision from jcapiv1.models.applicationtemplateslist import Applicationtemplateslist -from jcapiv1.models.body import Body -from jcapiv1.models.body1 import Body1 from jcapiv1.models.command import Command from jcapiv1.models.commandfilereturn import Commandfilereturn from jcapiv1.models.commandfilereturn_results import CommandfilereturnResults @@ -36,43 +37,83 @@ from jcapiv1.models.commandresult_response import CommandresultResponse from jcapiv1.models.commandresult_response_data import CommandresultResponseData from jcapiv1.models.commandresultslist import Commandresultslist +from jcapiv1.models.commandresultslist_results import CommandresultslistResults from jcapiv1.models.commandslist import Commandslist from jcapiv1.models.commandslist_results import CommandslistResults -from jcapiv1.models.errorresponse import Errorresponse +from jcapiv1.models.error import Error +from jcapiv1.models.error_details import ErrorDetails from jcapiv1.models.fde import Fde +from jcapiv1.models.id_resetmfa_body import IdResetmfaBody from jcapiv1.models.mfa import Mfa +from jcapiv1.models.mfa_enrollment import MfaEnrollment +from jcapiv1.models.mfa_enrollment_status import MfaEnrollmentStatus +from jcapiv1.models.organization import Organization +from jcapiv1.models.organizationentitlement import Organizationentitlement +from jcapiv1.models.organizationentitlement_entitlement_products import OrganizationentitlementEntitlementProducts +from jcapiv1.models.organizations_id_body import OrganizationsIdBody +from jcapiv1.models.organizationsettings import Organizationsettings +from jcapiv1.models.organizationsettings_display_preferences import OrganizationsettingsDisplayPreferences +from jcapiv1.models.organizationsettings_display_preferences_org_insights import OrganizationsettingsDisplayPreferencesOrgInsights +from jcapiv1.models.organizationsettings_display_preferences_org_insights_applications_usage import OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage +from jcapiv1.models.organizationsettings_display_preferences_org_insights_console_stats import OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats +from jcapiv1.models.organizationsettings_display_preferences_org_insights_device_notifications import OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications +from jcapiv1.models.organizationsettings_display_preferences_org_insights_user_notifications import OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications +from jcapiv1.models.organizationsettings_features import OrganizationsettingsFeatures +from jcapiv1.models.organizationsettings_features_directory_insights import OrganizationsettingsFeaturesDirectoryInsights +from jcapiv1.models.organizationsettings_features_directory_insights_premium import OrganizationsettingsFeaturesDirectoryInsightsPremium +from jcapiv1.models.organizationsettings_features_system_insights import OrganizationsettingsFeaturesSystemInsights +from jcapiv1.models.organizationsettings_new_system_user_state_defaults import OrganizationsettingsNewSystemUserStateDefaults +from jcapiv1.models.organizationsettings_password_policy import OrganizationsettingsPasswordPolicy +from jcapiv1.models.organizationsettings_user_portal import OrganizationsettingsUserPortal +from jcapiv1.models.organizationsettingsput import Organizationsettingsput +from jcapiv1.models.organizationsettingsput_new_system_user_state_defaults import OrganizationsettingsputNewSystemUserStateDefaults +from jcapiv1.models.organizationsettingsput_password_policy import OrganizationsettingsputPasswordPolicy from jcapiv1.models.organizationslist import Organizationslist from jcapiv1.models.organizationslist_results import OrganizationslistResults from jcapiv1.models.radiusserver import Radiusserver from jcapiv1.models.radiusserverpost import Radiusserverpost from jcapiv1.models.radiusserverput import Radiusserverput +from jcapiv1.models.radiusservers_id_body import RadiusserversIdBody from jcapiv1.models.radiusserverslist import Radiusserverslist from jcapiv1.models.search import Search from jcapiv1.models.sshkeylist import Sshkeylist from jcapiv1.models.sshkeypost import Sshkeypost +from jcapiv1.models.sso import Sso +from jcapiv1.models.state_activate_body import StateActivateBody from jcapiv1.models.system import System +from jcapiv1.models.system_built_in_commands import SystemBuiltInCommands +from jcapiv1.models.system_domain_info import SystemDomainInfo +from jcapiv1.models.system_mdm import SystemMdm +from jcapiv1.models.system_mdm_internal import SystemMdmInternal from jcapiv1.models.system_network_interfaces import SystemNetworkInterfaces +from jcapiv1.models.system_os_version_detail import SystemOsVersionDetail +from jcapiv1.models.system_provision_metadata import SystemProvisionMetadata +from jcapiv1.models.system_provision_metadata_provisioner import SystemProvisionMetadataProvisioner +from jcapiv1.models.system_service_account_state import SystemServiceAccountState from jcapiv1.models.system_sshd_params import SystemSshdParams from jcapiv1.models.system_system_insights import SystemSystemInsights +from jcapiv1.models.system_user_metrics import SystemUserMetrics from jcapiv1.models.systemput import Systemput from jcapiv1.models.systemput_agent_bound_messages import SystemputAgentBoundMessages from jcapiv1.models.systemslist import Systemslist -from jcapiv1.models.systemuser import Systemuser -from jcapiv1.models.systemuserbinding import Systemuserbinding -from jcapiv1.models.systemuserbindingsput import Systemuserbindingsput from jcapiv1.models.systemuserput import Systemuserput from jcapiv1.models.systemuserput_addresses import SystemuserputAddresses +from jcapiv1.models.systemuserput_attributes import SystemuserputAttributes from jcapiv1.models.systemuserput_phone_numbers import SystemuserputPhoneNumbers +from jcapiv1.models.systemuserput_relationships import SystemuserputRelationships from jcapiv1.models.systemuserputpost import Systemuserputpost from jcapiv1.models.systemuserputpost_addresses import SystemuserputpostAddresses from jcapiv1.models.systemuserputpost_phone_numbers import SystemuserputpostPhoneNumbers +from jcapiv1.models.systemuserputpost_recovery_email import SystemuserputpostRecoveryEmail from jcapiv1.models.systemuserreturn import Systemuserreturn from jcapiv1.models.systemuserreturn_addresses import SystemuserreturnAddresses from jcapiv1.models.systemuserreturn_phone_numbers import SystemuserreturnPhoneNumbers +from jcapiv1.models.systemuserreturn_recovery_email import SystemuserreturnRecoveryEmail from jcapiv1.models.systemuserslist import Systemuserslist -from jcapiv1.models.tag import Tag -from jcapiv1.models.tagpost import Tagpost -from jcapiv1.models.tagput import Tagput -from jcapiv1.models.tagslist import Tagslist -from jcapiv1.models.usersystembinding import Usersystembinding -from jcapiv1.models.usersystembindingsput import Usersystembindingsput +from jcapiv1.models.triggerreturn import Triggerreturn +from jcapiv1.models.trustedapp_config_get import TrustedappConfigGet +from jcapiv1.models.trustedapp_config_get_trusted_apps import TrustedappConfigGetTrustedApps +from jcapiv1.models.trustedapp_config_put import TrustedappConfigPut +from jcapiv1.models.userput import Userput +from jcapiv1.models.userreturn import Userreturn +from jcapiv1.models.userreturn_growth_data import UserreturnGrowthData diff --git a/jcapiv1/jcapiv1/models/application.py b/jcapiv1/jcapiv1/models/application.py index 68fc75e..9280a87 100644 --- a/jcapiv1/jcapiv1/models/application.py +++ b/jcapiv1/jcapiv1/models/application.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.application_config import ApplicationConfig # noqa: F401,E501 - - class Application(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -34,60 +29,90 @@ class Application(object): """ swagger_types = { 'id': 'str', + 'active': 'bool', 'beta': 'bool', + 'color': 'str', 'config': 'ApplicationConfig', + 'created': 'str', + 'database_attributes': 'list[object]', + 'description': 'str', 'display_label': 'str', 'display_name': 'str', 'learn_more': 'str', + 'logo': 'ApplicationLogo', 'name': 'str', 'organization': 'str', + 'sso': 'Sso', 'sso_url': 'str' } attribute_map = { 'id': '_id', + 'active': 'active', 'beta': 'beta', + 'color': 'color', 'config': 'config', + 'created': 'created', + 'database_attributes': 'databaseAttributes', + 'description': 'description', 'display_label': 'displayLabel', 'display_name': 'displayName', 'learn_more': 'learnMore', + 'logo': 'logo', 'name': 'name', 'organization': 'organization', + 'sso': 'sso', 'sso_url': 'ssoUrl' } - def __init__(self, id=None, beta=None, config=None, display_label=None, display_name=None, learn_more=None, name=None, organization=None, sso_url=None): # noqa: E501 + def __init__(self, id=None, active=None, beta=None, color=None, config=None, created=None, database_attributes=None, description=None, display_label=None, display_name=None, learn_more=None, logo=None, name=None, organization=None, sso=None, sso_url=None): # noqa: E501 """Application - a model defined in Swagger""" # noqa: E501 - self._id = None + self._active = None self._beta = None + self._color = None self._config = None + self._created = None + self._database_attributes = None + self._description = None self._display_label = None self._display_name = None self._learn_more = None + self._logo = None self._name = None self._organization = None + self._sso = None self._sso_url = None self.discriminator = None - if id is not None: self.id = id + if active is not None: + self.active = active if beta is not None: self.beta = beta - if config is not None: - self.config = config + if color is not None: + self.color = color + self.config = config + if created is not None: + self.created = created + if database_attributes is not None: + self.database_attributes = database_attributes + if description is not None: + self.description = description if display_label is not None: self.display_label = display_label if display_name is not None: self.display_name = display_name if learn_more is not None: self.learn_more = learn_more - if name is not None: - self.name = name + if logo is not None: + self.logo = logo + self.name = name if organization is not None: self.organization = organization - if sso_url is not None: - self.sso_url = sso_url + if sso is not None: + self.sso = sso + self.sso_url = sso_url @property def id(self): @@ -110,6 +135,27 @@ def id(self, id): self._id = id + @property + def active(self): + """Gets the active of this Application. # noqa: E501 + + + :return: The active of this Application. # noqa: E501 + :rtype: bool + """ + return self._active + + @active.setter + def active(self, active): + """Sets the active of this Application. + + + :param active: The active of this Application. # noqa: E501 + :type: bool + """ + + self._active = active + @property def beta(self): """Gets the beta of this Application. # noqa: E501 @@ -131,6 +177,33 @@ def beta(self, beta): self._beta = beta + @property + def color(self): + """Gets the color of this Application. # noqa: E501 + + + :return: The color of this Application. # noqa: E501 + :rtype: str + """ + return self._color + + @color.setter + def color(self, color): + """Sets the color of this Application. + + + :param color: The color of this Application. # noqa: E501 + :type: str + """ + allowed_values = ["", "#202D38", "#005466", "#3E8696", "#006CAC", "#0617AC", "#7C6ADA", "#D5779D", "#9E2F00", "#FFB000", "#58C469", "#57C49F", "#FF6C03"] # noqa: E501 + if color not in allowed_values: + raise ValueError( + "Invalid value for `color` ({0}), must be one of {1}" # noqa: E501 + .format(color, allowed_values) + ) + + self._color = color + @property def config(self): """Gets the config of this Application. # noqa: E501 @@ -149,9 +222,74 @@ def config(self, config): :param config: The config of this Application. # noqa: E501 :type: ApplicationConfig """ + if config is None: + raise ValueError("Invalid value for `config`, must not be `None`") # noqa: E501 self._config = config + @property + def created(self): + """Gets the created of this Application. # noqa: E501 + + + :return: The created of this Application. # noqa: E501 + :rtype: str + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this Application. + + + :param created: The created of this Application. # noqa: E501 + :type: str + """ + + self._created = created + + @property + def database_attributes(self): + """Gets the database_attributes of this Application. # noqa: E501 + + + :return: The database_attributes of this Application. # noqa: E501 + :rtype: list[object] + """ + return self._database_attributes + + @database_attributes.setter + def database_attributes(self, database_attributes): + """Sets the database_attributes of this Application. + + + :param database_attributes: The database_attributes of this Application. # noqa: E501 + :type: list[object] + """ + + self._database_attributes = database_attributes + + @property + def description(self): + """Gets the description of this Application. # noqa: E501 + + + :return: The description of this Application. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this Application. + + + :param description: The description of this Application. # noqa: E501 + :type: str + """ + + self._description = description + @property def display_label(self): """Gets the display_label of this Application. # noqa: E501 @@ -215,6 +353,27 @@ def learn_more(self, learn_more): self._learn_more = learn_more + @property + def logo(self): + """Gets the logo of this Application. # noqa: E501 + + + :return: The logo of this Application. # noqa: E501 + :rtype: ApplicationLogo + """ + return self._logo + + @logo.setter + def logo(self, logo): + """Sets the logo of this Application. + + + :param logo: The logo of this Application. # noqa: E501 + :type: ApplicationLogo + """ + + self._logo = logo + @property def name(self): """Gets the name of this Application. # noqa: E501 @@ -233,6 +392,8 @@ def name(self, name): :param name: The name of this Application. # noqa: E501 :type: str """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -257,6 +418,27 @@ def organization(self, organization): self._organization = organization + @property + def sso(self): + """Gets the sso of this Application. # noqa: E501 + + + :return: The sso of this Application. # noqa: E501 + :rtype: Sso + """ + return self._sso + + @sso.setter + def sso(self, sso): + """Sets the sso of this Application. + + + :param sso: The sso of this Application. # noqa: E501 + :type: Sso + """ + + self._sso = sso + @property def sso_url(self): """Gets the sso_url of this Application. # noqa: E501 @@ -275,6 +457,8 @@ def sso_url(self, sso_url): :param sso_url: The sso_url of this Application. # noqa: E501 :type: str """ + if sso_url is None: + raise ValueError("Invalid value for `sso_url`, must not be `None`") # noqa: E501 self._sso_url = sso_url diff --git a/jcapiv1/jcapiv1/models/application_config.py b/jcapiv1/jcapiv1/models/application_config.py index 06586d1..854e10e 100644 --- a/jcapiv1/jcapiv1/models/application_config.py +++ b/jcapiv1/jcapiv1/models/application_config.py @@ -1,32 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.application_config_acs_url import ApplicationConfigAcsUrl # noqa: F401,E501 -from jcapiv1.models.application_config_constant_attributes import ApplicationConfigConstantAttributes # noqa: F401,E501 -from jcapiv1.models.application_config_database_attributes import ApplicationConfigDatabaseAttributes # noqa: F401,E501 - - class ApplicationConfig(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -56,7 +49,6 @@ class ApplicationConfig(object): def __init__(self, acs_url=None, constant_attributes=None, database_attributes=None, idp_certificate=None, idp_entity_id=None, idp_private_key=None, sp_entity_id=None): # noqa: E501 """ApplicationConfig - a model defined in Swagger""" # noqa: E501 - self._acs_url = None self._constant_attributes = None self._database_attributes = None @@ -65,7 +57,6 @@ def __init__(self, acs_url=None, constant_attributes=None, database_attributes=N self._idp_private_key = None self._sp_entity_id = None self.discriminator = None - if acs_url is not None: self.acs_url = acs_url if constant_attributes is not None: diff --git a/jcapiv1/jcapiv1/models/application_config_acs_url.py b/jcapiv1/jcapiv1/models/application_config_acs_url.py index cf13b41..f9e206c 100644 --- a/jcapiv1/jcapiv1/models/application_config_acs_url.py +++ b/jcapiv1/jcapiv1/models/application_config_acs_url.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.application_config_acs_url_tooltip import ApplicationConfigAcsUrlTooltip # noqa: F401,E501 - - class ApplicationConfigAcsUrl(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -34,9 +29,11 @@ class ApplicationConfigAcsUrl(object): """ swagger_types = { 'label': 'str', + 'options': 'str', 'position': 'int', 'read_only': 'bool', 'required': 'bool', + 'toggle': 'str', 'tooltip': 'ApplicationConfigAcsUrlTooltip', 'type': 'str', 'value': 'str', @@ -45,36 +42,42 @@ class ApplicationConfigAcsUrl(object): attribute_map = { 'label': 'label', + 'options': 'options', 'position': 'position', 'read_only': 'readOnly', 'required': 'required', + 'toggle': 'toggle', 'tooltip': 'tooltip', 'type': 'type', 'value': 'value', 'visible': 'visible' } - def __init__(self, label=None, position=None, read_only=None, required=None, tooltip=None, type=None, value=None, visible=None): # noqa: E501 + def __init__(self, label=None, options=None, position=None, read_only=None, required=None, toggle=None, tooltip=None, type=None, value=None, visible=None): # noqa: E501 """ApplicationConfigAcsUrl - a model defined in Swagger""" # noqa: E501 - self._label = None + self._options = None self._position = None self._read_only = None self._required = None + self._toggle = None self._tooltip = None self._type = None self._value = None self._visible = None self.discriminator = None - if label is not None: self.label = label + if options is not None: + self.options = options if position is not None: self.position = position if read_only is not None: self.read_only = read_only if required is not None: self.required = required + if toggle is not None: + self.toggle = toggle if tooltip is not None: self.tooltip = tooltip if type is not None: @@ -105,6 +108,27 @@ def label(self, label): self._label = label + @property + def options(self): + """Gets the options of this ApplicationConfigAcsUrl. # noqa: E501 + + + :return: The options of this ApplicationConfigAcsUrl. # noqa: E501 + :rtype: str + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this ApplicationConfigAcsUrl. + + + :param options: The options of this ApplicationConfigAcsUrl. # noqa: E501 + :type: str + """ + + self._options = options + @property def position(self): """Gets the position of this ApplicationConfigAcsUrl. # noqa: E501 @@ -168,6 +192,27 @@ def required(self, required): self._required = required + @property + def toggle(self): + """Gets the toggle of this ApplicationConfigAcsUrl. # noqa: E501 + + + :return: The toggle of this ApplicationConfigAcsUrl. # noqa: E501 + :rtype: str + """ + return self._toggle + + @toggle.setter + def toggle(self, toggle): + """Sets the toggle of this ApplicationConfigAcsUrl. + + + :param toggle: The toggle of this ApplicationConfigAcsUrl. # noqa: E501 + :type: str + """ + + self._toggle = toggle + @property def tooltip(self): """Gets the tooltip of this ApplicationConfigAcsUrl. # noqa: E501 diff --git a/jcapiv1/jcapiv1/models/application_config_acs_url_tooltip.py b/jcapiv1/jcapiv1/models/application_config_acs_url_tooltip.py index f37dc74..d7fcd93 100644 --- a/jcapiv1/jcapiv1/models/application_config_acs_url_tooltip.py +++ b/jcapiv1/jcapiv1/models/application_config_acs_url_tooltip.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.application_config_acs_url_tooltip_variables import ApplicationConfigAcsUrlTooltipVariables # noqa: F401,E501 - - class ApplicationConfigAcsUrlTooltip(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,11 +39,9 @@ class ApplicationConfigAcsUrlTooltip(object): def __init__(self, template=None, variables=None): # noqa: E501 """ApplicationConfigAcsUrlTooltip - a model defined in Swagger""" # noqa: E501 - self._template = None self._variables = None self.discriminator = None - if template is not None: self.template = template if variables is not None: diff --git a/jcapiv1/jcapiv1/models/application_config_acs_url_tooltip_variables.py b/jcapiv1/jcapiv1/models/application_config_acs_url_tooltip_variables.py index b88291a..869b094 100644 --- a/jcapiv1/jcapiv1/models/application_config_acs_url_tooltip_variables.py +++ b/jcapiv1/jcapiv1/models/application_config_acs_url_tooltip_variables.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class ApplicationConfigAcsUrlTooltipVariables(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,11 +39,9 @@ class ApplicationConfigAcsUrlTooltipVariables(object): def __init__(self, icon=None, message=None): # noqa: E501 """ApplicationConfigAcsUrlTooltipVariables - a model defined in Swagger""" # noqa: E501 - self._icon = None self._message = None self.discriminator = None - if icon is not None: self.icon = icon if message is not None: diff --git a/jcapiv1/jcapiv1/models/application_config_constant_attributes.py b/jcapiv1/jcapiv1/models/application_config_constant_attributes.py index 66e3be7..8b8dca7 100644 --- a/jcapiv1/jcapiv1/models/application_config_constant_attributes.py +++ b/jcapiv1/jcapiv1/models/application_config_constant_attributes.py @@ -1,31 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.application_config_acs_url_tooltip import ApplicationConfigAcsUrlTooltip # noqa: F401,E501 -from jcapiv1.models.application_config_constant_attributes_value import ApplicationConfigConstantAttributesValue # noqa: F401,E501 - - class ApplicationConfigConstantAttributes(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -59,7 +53,6 @@ class ApplicationConfigConstantAttributes(object): def __init__(self, label=None, mutable=None, position=None, read_only=None, required=None, tooltip=None, type=None, value=None, visible=None): # noqa: E501 """ApplicationConfigConstantAttributes - a model defined in Swagger""" # noqa: E501 - self._label = None self._mutable = None self._position = None @@ -70,7 +63,6 @@ def __init__(self, label=None, mutable=None, position=None, read_only=None, requ self._value = None self._visible = None self.discriminator = None - if label is not None: self.label = label if mutable is not None: diff --git a/jcapiv1/jcapiv1/models/application_config_constant_attributes_value.py b/jcapiv1/jcapiv1/models/application_config_constant_attributes_value.py index d5512b6..6505ea3 100644 --- a/jcapiv1/jcapiv1/models/application_config_constant_attributes_value.py +++ b/jcapiv1/jcapiv1/models/application_config_constant_attributes_value.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class ApplicationConfigConstantAttributesValue(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -48,14 +45,12 @@ class ApplicationConfigConstantAttributesValue(object): def __init__(self, name=None, read_only=None, required=None, value=None, visible=None): # noqa: E501 """ApplicationConfigConstantAttributesValue - a model defined in Swagger""" # noqa: E501 - self._name = None self._read_only = None self._required = None self._value = None self._visible = None self.discriminator = None - if name is not None: self.name = name if read_only is not None: diff --git a/jcapiv1/jcapiv1/models/application_config_database_attributes.py b/jcapiv1/jcapiv1/models/application_config_database_attributes.py index e31c684..23aad87 100644 --- a/jcapiv1/jcapiv1/models/application_config_database_attributes.py +++ b/jcapiv1/jcapiv1/models/application_config_database_attributes.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class ApplicationConfigDatabaseAttributes(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,10 +37,8 @@ class ApplicationConfigDatabaseAttributes(object): def __init__(self, position=None): # noqa: E501 """ApplicationConfigDatabaseAttributes - a model defined in Swagger""" # noqa: E501 - self._position = None self.discriminator = None - if position is not None: self.position = position diff --git a/jcapiv1/jcapiv1/models/application_logo.py b/jcapiv1/jcapiv1/models/application_logo.py new file mode 100644 index 0000000..f2d5570 --- /dev/null +++ b/jcapiv1/jcapiv1/models/application_logo.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ApplicationLogo(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'color': 'str', + 'url': 'str' + } + + attribute_map = { + 'color': 'color', + 'url': 'url' + } + + def __init__(self, color=None, url=None): # noqa: E501 + """ApplicationLogo - a model defined in Swagger""" # noqa: E501 + self._color = None + self._url = None + self.discriminator = None + if color is not None: + self.color = color + if url is not None: + self.url = url + + @property + def color(self): + """Gets the color of this ApplicationLogo. # noqa: E501 + + + :return: The color of this ApplicationLogo. # noqa: E501 + :rtype: str + """ + return self._color + + @color.setter + def color(self, color): + """Sets the color of this ApplicationLogo. + + + :param color: The color of this ApplicationLogo. # noqa: E501 + :type: str + """ + allowed_values = ["", "#202D38", "#005466", "#3E8696", "#006CAC", "#0617AC", "#7C6ADA", "#D5779D", "#9E2F00", "#FFB000", "#58C469", "#57C49F", "#FF6C03"] # noqa: E501 + if color not in allowed_values: + raise ValueError( + "Invalid value for `color` ({0}), must be one of {1}" # noqa: E501 + .format(color, allowed_values) + ) + + self._color = color + + @property + def url(self): + """Gets the url of this ApplicationLogo. # noqa: E501 + + + :return: The url of this ApplicationLogo. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this ApplicationLogo. + + + :param url: The url of this ApplicationLogo. # noqa: E501 + :type: str + """ + + self._url = url + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ApplicationLogo, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApplicationLogo): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/applicationslist.py b/jcapiv1/jcapiv1/models/applicationslist.py index 249bf9b..39795b2 100644 --- a/jcapiv1/jcapiv1/models/applicationslist.py +++ b/jcapiv1/jcapiv1/models/applicationslist.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.application import Application # noqa: F401,E501 - - class Applicationslist(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,27 +28,51 @@ class Applicationslist(object): and the value is json key in definition. """ swagger_types = { + 'name': 'str', 'results': 'list[Application]', 'total_count': 'int' } attribute_map = { + 'name': 'name', 'results': 'results', 'total_count': 'totalCount' } - def __init__(self, results=None, total_count=None): # noqa: E501 + def __init__(self, name=None, results=None, total_count=None): # noqa: E501 """Applicationslist - a model defined in Swagger""" # noqa: E501 - + self._name = None self._results = None self._total_count = None self.discriminator = None - + if name is not None: + self.name = name if results is not None: self.results = results if total_count is not None: self.total_count = total_count + @property + def name(self): + """Gets the name of this Applicationslist. # noqa: E501 + + + :return: The name of this Applicationslist. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Applicationslist. + + + :param name: The name of this Applicationslist. # noqa: E501 + :type: str + """ + + self._name = name + @property def results(self): """Gets the results of this Applicationslist. # noqa: E501 diff --git a/jcapiv1/jcapiv1/models/applicationtemplate.py b/jcapiv1/jcapiv1/models/applicationtemplate.py index 0001c2c..aa2081b 100644 --- a/jcapiv1/jcapiv1/models/applicationtemplate.py +++ b/jcapiv1/jcapiv1/models/applicationtemplate.py @@ -1,31 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.application_config import ApplicationConfig # noqa: F401,E501 -from jcapiv1.models.applicationtemplate_jit import ApplicationtemplateJit # noqa: F401,E501 - - class Applicationtemplate(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -35,6 +29,7 @@ class Applicationtemplate(object): """ swagger_types = { 'id': 'str', + 'active': 'bool', 'beta': 'bool', 'color': 'str', 'config': 'ApplicationConfig', @@ -42,13 +37,21 @@ class Applicationtemplate(object): 'display_name': 'str', 'is_configured': 'bool', 'jit': 'ApplicationtemplateJit', + 'keywords': 'list[str]', 'learn_more': 'str', + 'logo': 'ApplicationtemplateLogo', 'name': 'str', - 'sso_url': 'str' + 'oidc': 'ApplicationtemplateOidc', + 'provision': 'ApplicationtemplateProvision', + 'sso': 'Sso', + 'sso_url': 'str', + 'status': 'str', + 'test': 'str' } attribute_map = { 'id': '_id', + 'active': 'active', 'beta': 'beta', 'color': 'color', 'config': 'config', @@ -56,15 +59,22 @@ class Applicationtemplate(object): 'display_name': 'displayName', 'is_configured': 'isConfigured', 'jit': 'jit', + 'keywords': 'keywords', 'learn_more': 'learnMore', + 'logo': 'logo', 'name': 'name', - 'sso_url': 'ssoUrl' + 'oidc': 'oidc', + 'provision': 'provision', + 'sso': 'sso', + 'sso_url': 'ssoUrl', + 'status': 'status', + 'test': 'test' } - def __init__(self, id=None, beta=None, color=None, config=None, display_label=None, display_name=None, is_configured=None, jit=None, learn_more=None, name=None, sso_url=None): # noqa: E501 + def __init__(self, id=None, active=None, beta=None, color=None, config=None, display_label=None, display_name=None, is_configured=None, jit=None, keywords=None, learn_more=None, logo=None, name=None, oidc=None, provision=None, sso=None, sso_url=None, status=None, test=None): # noqa: E501 """Applicationtemplate - a model defined in Swagger""" # noqa: E501 - self._id = None + self._active = None self._beta = None self._color = None self._config = None @@ -72,13 +82,21 @@ def __init__(self, id=None, beta=None, color=None, config=None, display_label=No self._display_name = None self._is_configured = None self._jit = None + self._keywords = None self._learn_more = None + self._logo = None self._name = None + self._oidc = None + self._provision = None + self._sso = None self._sso_url = None + self._status = None + self._test = None self.discriminator = None - if id is not None: self.id = id + if active is not None: + self.active = active if beta is not None: self.beta = beta if color is not None: @@ -93,12 +111,26 @@ def __init__(self, id=None, beta=None, color=None, config=None, display_label=No self.is_configured = is_configured if jit is not None: self.jit = jit + if keywords is not None: + self.keywords = keywords if learn_more is not None: self.learn_more = learn_more + if logo is not None: + self.logo = logo if name is not None: self.name = name + if oidc is not None: + self.oidc = oidc + if provision is not None: + self.provision = provision + if sso is not None: + self.sso = sso if sso_url is not None: self.sso_url = sso_url + if status is not None: + self.status = status + if test is not None: + self.test = test @property def id(self): @@ -121,6 +153,27 @@ def id(self, id): self._id = id + @property + def active(self): + """Gets the active of this Applicationtemplate. # noqa: E501 + + + :return: The active of this Applicationtemplate. # noqa: E501 + :rtype: bool + """ + return self._active + + @active.setter + def active(self, active): + """Sets the active of this Applicationtemplate. + + + :param active: The active of this Applicationtemplate. # noqa: E501 + :type: bool + """ + + self._active = active + @property def beta(self): """Gets the beta of this Applicationtemplate. # noqa: E501 @@ -160,6 +213,12 @@ def color(self, color): :param color: The color of this Applicationtemplate. # noqa: E501 :type: str """ + allowed_values = ["", "#202D38", "#005466", "#3E8696", "#006CAC", "#0617AC", "#7C6ADA", "#D5779D", "#9E2F00", "#FFB000", "#58C469", "#57C49F", "#FF6C03"] # noqa: E501 + if color not in allowed_values: + raise ValueError( + "Invalid value for `color` ({0}), must be one of {1}" # noqa: E501 + .format(color, allowed_values) + ) self._color = color @@ -268,6 +327,27 @@ def jit(self, jit): self._jit = jit + @property + def keywords(self): + """Gets the keywords of this Applicationtemplate. # noqa: E501 + + + :return: The keywords of this Applicationtemplate. # noqa: E501 + :rtype: list[str] + """ + return self._keywords + + @keywords.setter + def keywords(self, keywords): + """Sets the keywords of this Applicationtemplate. + + + :param keywords: The keywords of this Applicationtemplate. # noqa: E501 + :type: list[str] + """ + + self._keywords = keywords + @property def learn_more(self): """Gets the learn_more of this Applicationtemplate. # noqa: E501 @@ -289,6 +369,27 @@ def learn_more(self, learn_more): self._learn_more = learn_more + @property + def logo(self): + """Gets the logo of this Applicationtemplate. # noqa: E501 + + + :return: The logo of this Applicationtemplate. # noqa: E501 + :rtype: ApplicationtemplateLogo + """ + return self._logo + + @logo.setter + def logo(self, logo): + """Sets the logo of this Applicationtemplate. + + + :param logo: The logo of this Applicationtemplate. # noqa: E501 + :type: ApplicationtemplateLogo + """ + + self._logo = logo + @property def name(self): """Gets the name of this Applicationtemplate. # noqa: E501 @@ -310,6 +411,69 @@ def name(self, name): self._name = name + @property + def oidc(self): + """Gets the oidc of this Applicationtemplate. # noqa: E501 + + + :return: The oidc of this Applicationtemplate. # noqa: E501 + :rtype: ApplicationtemplateOidc + """ + return self._oidc + + @oidc.setter + def oidc(self, oidc): + """Sets the oidc of this Applicationtemplate. + + + :param oidc: The oidc of this Applicationtemplate. # noqa: E501 + :type: ApplicationtemplateOidc + """ + + self._oidc = oidc + + @property + def provision(self): + """Gets the provision of this Applicationtemplate. # noqa: E501 + + + :return: The provision of this Applicationtemplate. # noqa: E501 + :rtype: ApplicationtemplateProvision + """ + return self._provision + + @provision.setter + def provision(self, provision): + """Sets the provision of this Applicationtemplate. + + + :param provision: The provision of this Applicationtemplate. # noqa: E501 + :type: ApplicationtemplateProvision + """ + + self._provision = provision + + @property + def sso(self): + """Gets the sso of this Applicationtemplate. # noqa: E501 + + + :return: The sso of this Applicationtemplate. # noqa: E501 + :rtype: Sso + """ + return self._sso + + @sso.setter + def sso(self, sso): + """Sets the sso of this Applicationtemplate. + + + :param sso: The sso of this Applicationtemplate. # noqa: E501 + :type: Sso + """ + + self._sso = sso + @property def sso_url(self): """Gets the sso_url of this Applicationtemplate. # noqa: E501 @@ -331,6 +495,54 @@ def sso_url(self, sso_url): self._sso_url = sso_url + @property + def status(self): + """Gets the status of this Applicationtemplate. # noqa: E501 + + + :return: The status of this Applicationtemplate. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this Applicationtemplate. + + + :param status: The status of this Applicationtemplate. # noqa: E501 + :type: str + """ + allowed_values = ["", "end_of_life", "end_of_support", "beta"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def test(self): + """Gets the test of this Applicationtemplate. # noqa: E501 + + + :return: The test of this Applicationtemplate. # noqa: E501 + :rtype: str + """ + return self._test + + @test.setter + def test(self, test): + """Sets the test of this Applicationtemplate. + + + :param test: The test of this Applicationtemplate. # noqa: E501 + :type: str + """ + + self._test = test + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/jcapiv1/jcapiv1/models/applicationtemplate_jit.py b/jcapiv1/jcapiv1/models/applicationtemplate_jit.py index faf6042..fa1d8b5 100644 --- a/jcapiv1/jcapiv1/models/applicationtemplate_jit.py +++ b/jcapiv1/jcapiv1/models/applicationtemplate_jit.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class ApplicationtemplateJit(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,11 +39,9 @@ class ApplicationtemplateJit(object): def __init__(self, attributes=None, create_only=None): # noqa: E501 """ApplicationtemplateJit - a model defined in Swagger""" # noqa: E501 - self._attributes = None self._create_only = None self.discriminator = None - if attributes is not None: self.attributes = attributes if create_only is not None: diff --git a/jcapiv1/jcapiv1/models/applicationtemplate_logo.py b/jcapiv1/jcapiv1/models/applicationtemplate_logo.py new file mode 100644 index 0000000..ca91d32 --- /dev/null +++ b/jcapiv1/jcapiv1/models/applicationtemplate_logo.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ApplicationtemplateLogo(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'url': 'str' + } + + attribute_map = { + 'url': 'url' + } + + def __init__(self, url=None): # noqa: E501 + """ApplicationtemplateLogo - a model defined in Swagger""" # noqa: E501 + self._url = None + self.discriminator = None + if url is not None: + self.url = url + + @property + def url(self): + """Gets the url of this ApplicationtemplateLogo. # noqa: E501 + + + :return: The url of this ApplicationtemplateLogo. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this ApplicationtemplateLogo. + + + :param url: The url of this ApplicationtemplateLogo. # noqa: E501 + :type: str + """ + + self._url = url + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ApplicationtemplateLogo, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApplicationtemplateLogo): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/applicationtemplate_oidc.py b/jcapiv1/jcapiv1/models/applicationtemplate_oidc.py new file mode 100644 index 0000000..7fa926e --- /dev/null +++ b/jcapiv1/jcapiv1/models/applicationtemplate_oidc.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ApplicationtemplateOidc(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'grant_types': 'list[str]', + 'redirect_uris': 'list[str]', + 'sso_url': 'str', + 'token_endpoint_auth_method': 'str' + } + + attribute_map = { + 'grant_types': 'grantTypes', + 'redirect_uris': 'redirectUris', + 'sso_url': 'ssoUrl', + 'token_endpoint_auth_method': 'tokenEndpointAuthMethod' + } + + def __init__(self, grant_types=None, redirect_uris=None, sso_url=None, token_endpoint_auth_method=None): # noqa: E501 + """ApplicationtemplateOidc - a model defined in Swagger""" # noqa: E501 + self._grant_types = None + self._redirect_uris = None + self._sso_url = None + self._token_endpoint_auth_method = None + self.discriminator = None + if grant_types is not None: + self.grant_types = grant_types + if redirect_uris is not None: + self.redirect_uris = redirect_uris + if sso_url is not None: + self.sso_url = sso_url + if token_endpoint_auth_method is not None: + self.token_endpoint_auth_method = token_endpoint_auth_method + + @property + def grant_types(self): + """Gets the grant_types of this ApplicationtemplateOidc. # noqa: E501 + + The grant types allowed. Currently only authorization_code is allowed. # noqa: E501 + + :return: The grant_types of this ApplicationtemplateOidc. # noqa: E501 + :rtype: list[str] + """ + return self._grant_types + + @grant_types.setter + def grant_types(self, grant_types): + """Sets the grant_types of this ApplicationtemplateOidc. + + The grant types allowed. Currently only authorization_code is allowed. # noqa: E501 + + :param grant_types: The grant_types of this ApplicationtemplateOidc. # noqa: E501 + :type: list[str] + """ + allowed_values = ["authorization_code"] # noqa: E501 + if not set(grant_types).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `grant_types` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(grant_types) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._grant_types = grant_types + + @property + def redirect_uris(self): + """Gets the redirect_uris of this ApplicationtemplateOidc. # noqa: E501 + + List of allowed redirectUris # noqa: E501 + + :return: The redirect_uris of this ApplicationtemplateOidc. # noqa: E501 + :rtype: list[str] + """ + return self._redirect_uris + + @redirect_uris.setter + def redirect_uris(self, redirect_uris): + """Sets the redirect_uris of this ApplicationtemplateOidc. + + List of allowed redirectUris # noqa: E501 + + :param redirect_uris: The redirect_uris of this ApplicationtemplateOidc. # noqa: E501 + :type: list[str] + """ + + self._redirect_uris = redirect_uris + + @property + def sso_url(self): + """Gets the sso_url of this ApplicationtemplateOidc. # noqa: E501 + + The relying party url to trigger an oidc login. # noqa: E501 + + :return: The sso_url of this ApplicationtemplateOidc. # noqa: E501 + :rtype: str + """ + return self._sso_url + + @sso_url.setter + def sso_url(self, sso_url): + """Sets the sso_url of this ApplicationtemplateOidc. + + The relying party url to trigger an oidc login. # noqa: E501 + + :param sso_url: The sso_url of this ApplicationtemplateOidc. # noqa: E501 + :type: str + """ + + self._sso_url = sso_url + + @property + def token_endpoint_auth_method(self): + """Gets the token_endpoint_auth_method of this ApplicationtemplateOidc. # noqa: E501 + + Method that the client uses to authenticate when requesting a token. If 'none', then the client must use PKCE. If 'client_secret_post', then the secret is passed in the post body when requesting the token. # noqa: E501 + + :return: The token_endpoint_auth_method of this ApplicationtemplateOidc. # noqa: E501 + :rtype: str + """ + return self._token_endpoint_auth_method + + @token_endpoint_auth_method.setter + def token_endpoint_auth_method(self, token_endpoint_auth_method): + """Sets the token_endpoint_auth_method of this ApplicationtemplateOidc. + + Method that the client uses to authenticate when requesting a token. If 'none', then the client must use PKCE. If 'client_secret_post', then the secret is passed in the post body when requesting the token. # noqa: E501 + + :param token_endpoint_auth_method: The token_endpoint_auth_method of this ApplicationtemplateOidc. # noqa: E501 + :type: str + """ + allowed_values = ["none", "client_secret_post"] # noqa: E501 + if token_endpoint_auth_method not in allowed_values: + raise ValueError( + "Invalid value for `token_endpoint_auth_method` ({0}), must be one of {1}" # noqa: E501 + .format(token_endpoint_auth_method, allowed_values) + ) + + self._token_endpoint_auth_method = token_endpoint_auth_method + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ApplicationtemplateOidc, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApplicationtemplateOidc): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/applicationtemplate_provision.py b/jcapiv1/jcapiv1/models/applicationtemplate_provision.py new file mode 100644 index 0000000..5f5cb85 --- /dev/null +++ b/jcapiv1/jcapiv1/models/applicationtemplate_provision.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ApplicationtemplateProvision(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'beta': 'bool', + 'groups_supported': 'bool', + 'type': 'str' + } + + attribute_map = { + 'beta': 'beta', + 'groups_supported': 'groups_supported', + 'type': 'type' + } + + def __init__(self, beta=None, groups_supported=None, type=None): # noqa: E501 + """ApplicationtemplateProvision - a model defined in Swagger""" # noqa: E501 + self._beta = None + self._groups_supported = None + self._type = None + self.discriminator = None + if beta is not None: + self.beta = beta + if groups_supported is not None: + self.groups_supported = groups_supported + if type is not None: + self.type = type + + @property + def beta(self): + """Gets the beta of this ApplicationtemplateProvision. # noqa: E501 + + + :return: The beta of this ApplicationtemplateProvision. # noqa: E501 + :rtype: bool + """ + return self._beta + + @beta.setter + def beta(self, beta): + """Sets the beta of this ApplicationtemplateProvision. + + + :param beta: The beta of this ApplicationtemplateProvision. # noqa: E501 + :type: bool + """ + + self._beta = beta + + @property + def groups_supported(self): + """Gets the groups_supported of this ApplicationtemplateProvision. # noqa: E501 + + + :return: The groups_supported of this ApplicationtemplateProvision. # noqa: E501 + :rtype: bool + """ + return self._groups_supported + + @groups_supported.setter + def groups_supported(self, groups_supported): + """Sets the groups_supported of this ApplicationtemplateProvision. + + + :param groups_supported: The groups_supported of this ApplicationtemplateProvision. # noqa: E501 + :type: bool + """ + + self._groups_supported = groups_supported + + @property + def type(self): + """Gets the type of this ApplicationtemplateProvision. # noqa: E501 + + + :return: The type of this ApplicationtemplateProvision. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ApplicationtemplateProvision. + + + :param type: The type of this ApplicationtemplateProvision. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ApplicationtemplateProvision, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApplicationtemplateProvision): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/applicationtemplateslist.py b/jcapiv1/jcapiv1/models/applicationtemplateslist.py index 3b971eb..d19ee46 100644 --- a/jcapiv1/jcapiv1/models/applicationtemplateslist.py +++ b/jcapiv1/jcapiv1/models/applicationtemplateslist.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.applicationtemplate import Applicationtemplate # noqa: F401,E501 - - class Applicationtemplateslist(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,11 +39,9 @@ class Applicationtemplateslist(object): def __init__(self, results=None, total_count=None): # noqa: E501 """Applicationtemplateslist - a model defined in Swagger""" # noqa: E501 - self._results = None self._total_count = None self.discriminator = None - if results is not None: self.results = results if total_count is not None: diff --git a/jcapiv1/jcapiv1/models/body.py b/jcapiv1/jcapiv1/models/body.py deleted file mode 100644 index 9b8b994..0000000 --- a/jcapiv1/jcapiv1/models/body.py +++ /dev/null @@ -1,253 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Body(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'mfa': 'str', - 'name': 'str', - 'network_source_ip': 'str', - 'tags': 'list[str]', - 'user_lockout_action': 'str', - 'user_password_expiration_action': 'str' - } - - attribute_map = { - 'mfa': 'mfa', - 'name': 'name', - 'network_source_ip': 'networkSourceIp', - 'tags': 'tags', - 'user_lockout_action': 'userLockoutAction', - 'user_password_expiration_action': 'userPasswordExpirationAction' - } - - def __init__(self, mfa=None, name=None, network_source_ip=None, tags=None, user_lockout_action=None, user_password_expiration_action=None): # noqa: E501 - """Body - a model defined in Swagger""" # noqa: E501 - - self._mfa = None - self._name = None - self._network_source_ip = None - self._tags = None - self._user_lockout_action = None - self._user_password_expiration_action = None - self.discriminator = None - - if mfa is not None: - self.mfa = mfa - self.name = name - self.network_source_ip = network_source_ip - if tags is not None: - self.tags = tags - if user_lockout_action is not None: - self.user_lockout_action = user_lockout_action - if user_password_expiration_action is not None: - self.user_password_expiration_action = user_password_expiration_action - - @property - def mfa(self): - """Gets the mfa of this Body. # noqa: E501 - - - :return: The mfa of this Body. # noqa: E501 - :rtype: str - """ - return self._mfa - - @mfa.setter - def mfa(self, mfa): - """Sets the mfa of this Body. - - - :param mfa: The mfa of this Body. # noqa: E501 - :type: str - """ - allowed_values = ["DISABLED", "ENABLED", "REQUIRED", "ALWAYS"] # noqa: E501 - if mfa not in allowed_values: - raise ValueError( - "Invalid value for `mfa` ({0}), must be one of {1}" # noqa: E501 - .format(mfa, allowed_values) - ) - - self._mfa = mfa - - @property - def name(self): - """Gets the name of this Body. # noqa: E501 - - - :return: The name of this Body. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Body. - - - :param name: The name of this Body. # noqa: E501 - :type: str - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def network_source_ip(self): - """Gets the network_source_ip of this Body. # noqa: E501 - - - :return: The network_source_ip of this Body. # noqa: E501 - :rtype: str - """ - return self._network_source_ip - - @network_source_ip.setter - def network_source_ip(self, network_source_ip): - """Sets the network_source_ip of this Body. - - - :param network_source_ip: The network_source_ip of this Body. # noqa: E501 - :type: str - """ - if network_source_ip is None: - raise ValueError("Invalid value for `network_source_ip`, must not be `None`") # noqa: E501 - - self._network_source_ip = network_source_ip - - @property - def tags(self): - """Gets the tags of this Body. # noqa: E501 - - - :return: The tags of this Body. # noqa: E501 - :rtype: list[str] - """ - return self._tags - - @tags.setter - def tags(self, tags): - """Sets the tags of this Body. - - - :param tags: The tags of this Body. # noqa: E501 - :type: list[str] - """ - - self._tags = tags - - @property - def user_lockout_action(self): - """Gets the user_lockout_action of this Body. # noqa: E501 - - - :return: The user_lockout_action of this Body. # noqa: E501 - :rtype: str - """ - return self._user_lockout_action - - @user_lockout_action.setter - def user_lockout_action(self, user_lockout_action): - """Sets the user_lockout_action of this Body. - - - :param user_lockout_action: The user_lockout_action of this Body. # noqa: E501 - :type: str - """ - - self._user_lockout_action = user_lockout_action - - @property - def user_password_expiration_action(self): - """Gets the user_password_expiration_action of this Body. # noqa: E501 - - - :return: The user_password_expiration_action of this Body. # noqa: E501 - :rtype: str - """ - return self._user_password_expiration_action - - @user_password_expiration_action.setter - def user_password_expiration_action(self, user_password_expiration_action): - """Sets the user_password_expiration_action of this Body. - - - :param user_password_expiration_action: The user_password_expiration_action of this Body. # noqa: E501 - :type: str - """ - - self._user_password_expiration_action = user_password_expiration_action - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Body, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Body): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv1/jcapiv1/models/body1.py b/jcapiv1/jcapiv1/models/body1.py deleted file mode 100644 index 9ed45c3..0000000 --- a/jcapiv1/jcapiv1/models/body1.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Body1(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'exclusion': 'bool', - 'exclusion_until': 'datetime' - } - - attribute_map = { - 'exclusion': 'exclusion', - 'exclusion_until': 'exclusionUntil' - } - - def __init__(self, exclusion=None, exclusion_until=None): # noqa: E501 - """Body1 - a model defined in Swagger""" # noqa: E501 - - self._exclusion = None - self._exclusion_until = None - self.discriminator = None - - if exclusion is not None: - self.exclusion = exclusion - if exclusion_until is not None: - self.exclusion_until = exclusion_until - - @property - def exclusion(self): - """Gets the exclusion of this Body1. # noqa: E501 - - - :return: The exclusion of this Body1. # noqa: E501 - :rtype: bool - """ - return self._exclusion - - @exclusion.setter - def exclusion(self, exclusion): - """Sets the exclusion of this Body1. - - - :param exclusion: The exclusion of this Body1. # noqa: E501 - :type: bool - """ - - self._exclusion = exclusion - - @property - def exclusion_until(self): - """Gets the exclusion_until of this Body1. # noqa: E501 - - - :return: The exclusion_until of this Body1. # noqa: E501 - :rtype: datetime - """ - return self._exclusion_until - - @exclusion_until.setter - def exclusion_until(self, exclusion_until): - """Sets the exclusion_until of this Body1. - - - :param exclusion_until: The exclusion_until of this Body1. # noqa: E501 - :type: datetime - """ - - self._exclusion_until = exclusion_until - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Body1, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Body1): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv1/jcapiv1/models/command.py b/jcapiv1/jcapiv1/models/command.py index 97b6f26..93c1377 100644 --- a/jcapiv1/jcapiv1/models/command.py +++ b/jcapiv1/jcapiv1/models/command.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class Command(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -41,8 +38,12 @@ class Command(object): 'organization': 'str', 'schedule': 'str', 'schedule_repeat_type': 'str', + 'schedule_year': 'int', + 'shell': 'str', 'sudo': 'bool', 'systems': 'list[str]', + 'template': 'str', + 'time_to_live_seconds': 'int', 'timeout': 'str', 'trigger': 'str', 'user': 'str' @@ -59,16 +60,19 @@ class Command(object): 'organization': 'organization', 'schedule': 'schedule', 'schedule_repeat_type': 'scheduleRepeatType', + 'schedule_year': 'scheduleYear', + 'shell': 'shell', 'sudo': 'sudo', 'systems': 'systems', + 'template': 'template', + 'time_to_live_seconds': 'timeToLiveSeconds', 'timeout': 'timeout', 'trigger': 'trigger', 'user': 'user' } - def __init__(self, command=None, command_runners=None, command_type=None, files=None, launch_type=None, listens_to=None, name=None, organization=None, schedule=None, schedule_repeat_type=None, sudo=None, systems=None, timeout=None, trigger=None, user=None): # noqa: E501 + def __init__(self, command=None, command_runners=None, command_type='linux', files=None, launch_type=None, listens_to=None, name=None, organization=None, schedule=None, schedule_repeat_type=None, schedule_year=None, shell=None, sudo=None, systems=None, template=None, time_to_live_seconds=None, timeout=None, trigger=None, user=None): # noqa: E501 """Command - a model defined in Swagger""" # noqa: E501 - self._command = None self._command_runners = None self._command_type = None @@ -79,36 +83,45 @@ def __init__(self, command=None, command_runners=None, command_type=None, files= self._organization = None self._schedule = None self._schedule_repeat_type = None + self._schedule_year = None + self._shell = None self._sudo = None self._systems = None + self._template = None + self._time_to_live_seconds = None self._timeout = None self._trigger = None self._user = None self.discriminator = None - self.command = command if command_runners is not None: self.command_runners = command_runners - if command_type is not None: - self.command_type = command_type + self.command_type = command_type if files is not None: self.files = files if launch_type is not None: self.launch_type = launch_type if listens_to is not None: self.listens_to = listens_to - if name is not None: - self.name = name + self.name = name if organization is not None: self.organization = organization if schedule is not None: self.schedule = schedule if schedule_repeat_type is not None: self.schedule_repeat_type = schedule_repeat_type + if schedule_year is not None: + self.schedule_year = schedule_year + if shell is not None: + self.shell = shell if sudo is not None: self.sudo = sudo if systems is not None: self.systems = systems + if template is not None: + self.template = template + if time_to_live_seconds is not None: + self.time_to_live_seconds = time_to_live_seconds if timeout is not None: self.timeout = timeout if trigger is not None: @@ -184,6 +197,8 @@ def command_type(self, command_type): :param command_type: The command_type of this Command. # noqa: E501 :type: str """ + if command_type is None: + raise ValueError("Invalid value for `command_type`, must not be `None`") # noqa: E501 self._command_type = command_type @@ -237,7 +252,6 @@ def launch_type(self, launch_type): def listens_to(self): """Gets the listens_to of this Command. # noqa: E501 - # noqa: E501 :return: The listens_to of this Command. # noqa: E501 :rtype: str @@ -248,7 +262,6 @@ def listens_to(self): def listens_to(self, listens_to): """Sets the listens_to of this Command. - # noqa: E501 :param listens_to: The listens_to of this Command. # noqa: E501 :type: str @@ -274,6 +287,8 @@ def name(self, name): :param name: The name of this Command. # noqa: E501 :type: str """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -346,11 +361,56 @@ def schedule_repeat_type(self, schedule_repeat_type): self._schedule_repeat_type = schedule_repeat_type + @property + def schedule_year(self): + """Gets the schedule_year of this Command. # noqa: E501 + + The year that a scheduled command will launch in. # noqa: E501 + + :return: The schedule_year of this Command. # noqa: E501 + :rtype: int + """ + return self._schedule_year + + @schedule_year.setter + def schedule_year(self, schedule_year): + """Sets the schedule_year of this Command. + + The year that a scheduled command will launch in. # noqa: E501 + + :param schedule_year: The schedule_year of this Command. # noqa: E501 + :type: int + """ + + self._schedule_year = schedule_year + + @property + def shell(self): + """Gets the shell of this Command. # noqa: E501 + + The shell used to run the command. # noqa: E501 + + :return: The shell of this Command. # noqa: E501 + :rtype: str + """ + return self._shell + + @shell.setter + def shell(self, shell): + """Sets the shell of this Command. + + The shell used to run the command. # noqa: E501 + + :param shell: The shell of this Command. # noqa: E501 + :type: str + """ + + self._shell = shell + @property def sudo(self): """Gets the sudo of this Command. # noqa: E501 - # noqa: E501 :return: The sudo of this Command. # noqa: E501 :rtype: bool @@ -361,7 +421,6 @@ def sudo(self): def sudo(self, sudo): """Sets the sudo of this Command. - # noqa: E501 :param sudo: The sudo of this Command. # noqa: E501 :type: bool @@ -392,6 +451,52 @@ def systems(self, systems): self._systems = systems + @property + def template(self): + """Gets the template of this Command. # noqa: E501 + + The template this command was created from # noqa: E501 + + :return: The template of this Command. # noqa: E501 + :rtype: str + """ + return self._template + + @template.setter + def template(self, template): + """Sets the template of this Command. + + The template this command was created from # noqa: E501 + + :param template: The template of this Command. # noqa: E501 + :type: str + """ + + self._template = template + + @property + def time_to_live_seconds(self): + """Gets the time_to_live_seconds of this Command. # noqa: E501 + + Time in seconds a command can wait in the queue to be run before timing out # noqa: E501 + + :return: The time_to_live_seconds of this Command. # noqa: E501 + :rtype: int + """ + return self._time_to_live_seconds + + @time_to_live_seconds.setter + def time_to_live_seconds(self, time_to_live_seconds): + """Sets the time_to_live_seconds of this Command. + + Time in seconds a command can wait in the queue to be run before timing out # noqa: E501 + + :param time_to_live_seconds: The time_to_live_seconds of this Command. # noqa: E501 + :type: int + """ + + self._time_to_live_seconds = time_to_live_seconds + @property def timeout(self): """Gets the timeout of this Command. # noqa: E501 diff --git a/jcapiv1/jcapiv1/models/commandfilereturn.py b/jcapiv1/jcapiv1/models/commandfilereturn.py index 94cb61d..b40333d 100644 --- a/jcapiv1/jcapiv1/models/commandfilereturn.py +++ b/jcapiv1/jcapiv1/models/commandfilereturn.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.commandfilereturn_results import CommandfilereturnResults # noqa: F401,E501 - - class Commandfilereturn(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,7 +28,7 @@ class Commandfilereturn(object): and the value is json key in definition. """ swagger_types = { - 'results': 'CommandfilereturnResults', + 'results': 'list[CommandfilereturnResults]', 'total_count': 'int' } @@ -44,11 +39,9 @@ class Commandfilereturn(object): def __init__(self, results=None, total_count=None): # noqa: E501 """Commandfilereturn - a model defined in Swagger""" # noqa: E501 - self._results = None self._total_count = None self.discriminator = None - if results is not None: self.results = results if total_count is not None: @@ -60,7 +53,7 @@ def results(self): :return: The results of this Commandfilereturn. # noqa: E501 - :rtype: CommandfilereturnResults + :rtype: list[CommandfilereturnResults] """ return self._results @@ -70,7 +63,7 @@ def results(self, results): :param results: The results of this Commandfilereturn. # noqa: E501 - :type: CommandfilereturnResults + :type: list[CommandfilereturnResults] """ self._results = results diff --git a/jcapiv1/jcapiv1/models/commandfilereturn_results.py b/jcapiv1/jcapiv1/models/commandfilereturn_results.py index 0ac18da..cec492a 100644 --- a/jcapiv1/jcapiv1/models/commandfilereturn_results.py +++ b/jcapiv1/jcapiv1/models/commandfilereturn_results.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class CommandfilereturnResults(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,12 +41,10 @@ class CommandfilereturnResults(object): def __init__(self, id=None, destination=None, name=None): # noqa: E501 """CommandfilereturnResults - a model defined in Swagger""" # noqa: E501 - self._id = None self._destination = None self._name = None self.discriminator = None - if id is not None: self.id = id if destination is not None: diff --git a/jcapiv1/jcapiv1/models/commandresult.py b/jcapiv1/jcapiv1/models/commandresult.py index b4b75fe..db93af0 100644 --- a/jcapiv1/jcapiv1/models/commandresult.py +++ b/jcapiv1/jcapiv1/models/commandresult.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.commandresult_response import CommandresultResponse # noqa: F401,E501 - - class Commandresult(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,9 +33,9 @@ class Commandresult(object): 'files': 'list[str]', 'name': 'str', 'organization': 'str', - 'request_time': 'str', + 'request_time': 'datetime', 'response': 'CommandresultResponse', - 'response_time': 'str', + 'response_time': 'datetime', 'sudo': 'bool', 'system': 'str', 'system_id': 'str', @@ -68,7 +63,6 @@ class Commandresult(object): def __init__(self, id=None, command=None, files=None, name=None, organization=None, request_time=None, response=None, response_time=None, sudo=None, system=None, system_id=None, user=None, workflow_id=None, workflow_instance_id=None): # noqa: E501 """Commandresult - a model defined in Swagger""" # noqa: E501 - self._id = None self._command = None self._files = None @@ -84,7 +78,6 @@ def __init__(self, id=None, command=None, files=None, name=None, organization=No self._workflow_id = None self._workflow_instance_id = None self.discriminator = None - if id is not None: self.id = id if command is not None: @@ -236,7 +229,7 @@ def request_time(self): The time that the command was sent. # noqa: E501 :return: The request_time of this Commandresult. # noqa: E501 - :rtype: str + :rtype: datetime """ return self._request_time @@ -247,7 +240,7 @@ def request_time(self, request_time): The time that the command was sent. # noqa: E501 :param request_time: The request_time of this Commandresult. # noqa: E501 - :type: str + :type: datetime """ self._request_time = request_time @@ -280,7 +273,7 @@ def response_time(self): The time that the command was completed. # noqa: E501 :return: The response_time of this Commandresult. # noqa: E501 - :rtype: str + :rtype: datetime """ return self._response_time @@ -291,7 +284,7 @@ def response_time(self, response_time): The time that the command was completed. # noqa: E501 :param response_time: The response_time of this Commandresult. # noqa: E501 - :type: str + :type: datetime """ self._response_time = response_time diff --git a/jcapiv1/jcapiv1/models/commandresult_response.py b/jcapiv1/jcapiv1/models/commandresult_response.py index e5c480c..6798e4a 100644 --- a/jcapiv1/jcapiv1/models/commandresult_response.py +++ b/jcapiv1/jcapiv1/models/commandresult_response.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.commandresult_response_data import CommandresultResponseData # noqa: F401,E501 - - class CommandresultResponse(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -46,12 +41,10 @@ class CommandresultResponse(object): def __init__(self, data=None, error=None, id=None): # noqa: E501 """CommandresultResponse - a model defined in Swagger""" # noqa: E501 - self._data = None self._error = None self._id = None self.discriminator = None - if data is not None: self.data = data if error is not None: diff --git a/jcapiv1/jcapiv1/models/commandresult_response_data.py b/jcapiv1/jcapiv1/models/commandresult_response_data.py index 5ba28b9..9438c18 100644 --- a/jcapiv1/jcapiv1/models/commandresult_response_data.py +++ b/jcapiv1/jcapiv1/models/commandresult_response_data.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class CommandresultResponseData(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,11 +39,9 @@ class CommandresultResponseData(object): def __init__(self, exit_code=None, output=None): # noqa: E501 """CommandresultResponseData - a model defined in Swagger""" # noqa: E501 - self._exit_code = None self._output = None self.discriminator = None - if exit_code is not None: self.exit_code = exit_code if output is not None: diff --git a/jcapiv1/jcapiv1/models/commandresultslist.py b/jcapiv1/jcapiv1/models/commandresultslist.py index db3d42a..31c522a 100644 --- a/jcapiv1/jcapiv1/models/commandresultslist.py +++ b/jcapiv1/jcapiv1/models/commandresultslist.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.commandresult import Commandresult # noqa: F401,E501 - - class Commandresultslist(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,7 +28,7 @@ class Commandresultslist(object): and the value is json key in definition. """ swagger_types = { - 'results': 'list[Commandresult]', + 'results': 'list[CommandresultslistResults]', 'total_count': 'int' } @@ -44,11 +39,9 @@ class Commandresultslist(object): def __init__(self, results=None, total_count=None): # noqa: E501 """Commandresultslist - a model defined in Swagger""" # noqa: E501 - self._results = None self._total_count = None self.discriminator = None - if results is not None: self.results = results if total_count is not None: @@ -58,10 +51,9 @@ def __init__(self, results=None, total_count=None): # noqa: E501 def results(self): """Gets the results of this Commandresultslist. # noqa: E501 - The list of command results # noqa: E501 :return: The results of this Commandresultslist. # noqa: E501 - :rtype: list[Commandresult] + :rtype: list[CommandresultslistResults] """ return self._results @@ -69,10 +61,9 @@ def results(self): def results(self, results): """Sets the results of this Commandresultslist. - The list of command results # noqa: E501 :param results: The results of this Commandresultslist. # noqa: E501 - :type: list[Commandresult] + :type: list[CommandresultslistResults] """ self._results = results @@ -81,7 +72,7 @@ def results(self, results): def total_count(self): """Gets the total_count of this Commandresultslist. # noqa: E501 - The total number of command results # noqa: E501 + The total number of command results. # noqa: E501 :return: The total_count of this Commandresultslist. # noqa: E501 :rtype: int @@ -92,7 +83,7 @@ def total_count(self): def total_count(self, total_count): """Sets the total_count of this Commandresultslist. - The total number of command results # noqa: E501 + The total number of command results. # noqa: E501 :param total_count: The total_count of this Commandresultslist. # noqa: E501 :type: int diff --git a/jcapiv1/jcapiv1/models/commandresultslist_results.py b/jcapiv1/jcapiv1/models/commandresultslist_results.py new file mode 100644 index 0000000..63d61a1 --- /dev/null +++ b/jcapiv1/jcapiv1/models/commandresultslist_results.py @@ -0,0 +1,392 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class CommandresultslistResults(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'command': 'str', + 'exit_code': 'int', + 'name': 'str', + 'request_time': 'datetime', + 'response_time': 'datetime', + 'sudo': 'bool', + 'system': 'str', + 'system_id': 'str', + 'user': 'str', + 'workflow_id': 'str' + } + + attribute_map = { + 'id': '_id', + 'command': 'command', + 'exit_code': 'exitCode', + 'name': 'name', + 'request_time': 'requestTime', + 'response_time': 'responseTime', + 'sudo': 'sudo', + 'system': 'system', + 'system_id': 'systemId', + 'user': 'user', + 'workflow_id': 'workflowId' + } + + def __init__(self, id=None, command=None, exit_code=None, name=None, request_time=None, response_time=None, sudo=None, system=None, system_id=None, user=None, workflow_id=None): # noqa: E501 + """CommandresultslistResults - a model defined in Swagger""" # noqa: E501 + self._id = None + self._command = None + self._exit_code = None + self._name = None + self._request_time = None + self._response_time = None + self._sudo = None + self._system = None + self._system_id = None + self._user = None + self._workflow_id = None + self.discriminator = None + if id is not None: + self.id = id + if command is not None: + self.command = command + if exit_code is not None: + self.exit_code = exit_code + if name is not None: + self.name = name + if request_time is not None: + self.request_time = request_time + if response_time is not None: + self.response_time = response_time + if sudo is not None: + self.sudo = sudo + if system is not None: + self.system = system + if system_id is not None: + self.system_id = system_id + if user is not None: + self.user = user + if workflow_id is not None: + self.workflow_id = workflow_id + + @property + def id(self): + """Gets the id of this CommandresultslistResults. # noqa: E501 + + The ID of the command result. # noqa: E501 + + :return: The id of this CommandresultslistResults. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CommandresultslistResults. + + The ID of the command result. # noqa: E501 + + :param id: The id of this CommandresultslistResults. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def command(self): + """Gets the command of this CommandresultslistResults. # noqa: E501 + + The command that was executed on the system. # noqa: E501 + + :return: The command of this CommandresultslistResults. # noqa: E501 + :rtype: str + """ + return self._command + + @command.setter + def command(self, command): + """Sets the command of this CommandresultslistResults. + + The command that was executed on the system. # noqa: E501 + + :param command: The command of this CommandresultslistResults. # noqa: E501 + :type: str + """ + + self._command = command + + @property + def exit_code(self): + """Gets the exit_code of this CommandresultslistResults. # noqa: E501 + + The stderr output from the command that ran. # noqa: E501 + + :return: The exit_code of this CommandresultslistResults. # noqa: E501 + :rtype: int + """ + return self._exit_code + + @exit_code.setter + def exit_code(self, exit_code): + """Sets the exit_code of this CommandresultslistResults. + + The stderr output from the command that ran. # noqa: E501 + + :param exit_code: The exit_code of this CommandresultslistResults. # noqa: E501 + :type: int + """ + + self._exit_code = exit_code + + @property + def name(self): + """Gets the name of this CommandresultslistResults. # noqa: E501 + + The name of the command. # noqa: E501 + + :return: The name of this CommandresultslistResults. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CommandresultslistResults. + + The name of the command. # noqa: E501 + + :param name: The name of this CommandresultslistResults. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def request_time(self): + """Gets the request_time of this CommandresultslistResults. # noqa: E501 + + The time (UTC) that the command was sent. # noqa: E501 + + :return: The request_time of this CommandresultslistResults. # noqa: E501 + :rtype: datetime + """ + return self._request_time + + @request_time.setter + def request_time(self, request_time): + """Sets the request_time of this CommandresultslistResults. + + The time (UTC) that the command was sent. # noqa: E501 + + :param request_time: The request_time of this CommandresultslistResults. # noqa: E501 + :type: datetime + """ + + self._request_time = request_time + + @property + def response_time(self): + """Gets the response_time of this CommandresultslistResults. # noqa: E501 + + The time (UTC) that the command was completed. # noqa: E501 + + :return: The response_time of this CommandresultslistResults. # noqa: E501 + :rtype: datetime + """ + return self._response_time + + @response_time.setter + def response_time(self, response_time): + """Sets the response_time of this CommandresultslistResults. + + The time (UTC) that the command was completed. # noqa: E501 + + :param response_time: The response_time of this CommandresultslistResults. # noqa: E501 + :type: datetime + """ + + self._response_time = response_time + + @property + def sudo(self): + """Gets the sudo of this CommandresultslistResults. # noqa: E501 + + If the user had sudo rights. # noqa: E501 + + :return: The sudo of this CommandresultslistResults. # noqa: E501 + :rtype: bool + """ + return self._sudo + + @sudo.setter + def sudo(self, sudo): + """Sets the sudo of this CommandresultslistResults. + + If the user had sudo rights. # noqa: E501 + + :param sudo: The sudo of this CommandresultslistResults. # noqa: E501 + :type: bool + """ + + self._sudo = sudo + + @property + def system(self): + """Gets the system of this CommandresultslistResults. # noqa: E501 + + The display name of the system the command was executed on. # noqa: E501 + + :return: The system of this CommandresultslistResults. # noqa: E501 + :rtype: str + """ + return self._system + + @system.setter + def system(self, system): + """Sets the system of this CommandresultslistResults. + + The display name of the system the command was executed on. # noqa: E501 + + :param system: The system of this CommandresultslistResults. # noqa: E501 + :type: str + """ + + self._system = system + + @property + def system_id(self): + """Gets the system_id of this CommandresultslistResults. # noqa: E501 + + The id of the system the command was executed on. # noqa: E501 + + :return: The system_id of this CommandresultslistResults. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this CommandresultslistResults. + + The id of the system the command was executed on. # noqa: E501 + + :param system_id: The system_id of this CommandresultslistResults. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def user(self): + """Gets the user of this CommandresultslistResults. # noqa: E501 + + The user the command ran as. # noqa: E501 + + :return: The user of this CommandresultslistResults. # noqa: E501 + :rtype: str + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this CommandresultslistResults. + + The user the command ran as. # noqa: E501 + + :param user: The user of this CommandresultslistResults. # noqa: E501 + :type: str + """ + + self._user = user + + @property + def workflow_id(self): + """Gets the workflow_id of this CommandresultslistResults. # noqa: E501 + + The id for the command that ran on the system. # noqa: E501 + + :return: The workflow_id of this CommandresultslistResults. # noqa: E501 + :rtype: str + """ + return self._workflow_id + + @workflow_id.setter + def workflow_id(self, workflow_id): + """Sets the workflow_id of this CommandresultslistResults. + + The id for the command that ran on the system. # noqa: E501 + + :param workflow_id: The workflow_id of this CommandresultslistResults. # noqa: E501 + :type: str + """ + + self._workflow_id = workflow_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CommandresultslistResults, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CommandresultslistResults): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/commandslist.py b/jcapiv1/jcapiv1/models/commandslist.py index 273c39e..c4c0e86 100644 --- a/jcapiv1/jcapiv1/models/commandslist.py +++ b/jcapiv1/jcapiv1/models/commandslist.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.commandslist_results import CommandslistResults # noqa: F401,E501 - - class Commandslist(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,11 +39,9 @@ class Commandslist(object): def __init__(self, results=None, total_count=None): # noqa: E501 """Commandslist - a model defined in Swagger""" # noqa: E501 - self._results = None self._total_count = None self.discriminator = None - if results is not None: self.results = results if total_count is not None: diff --git a/jcapiv1/jcapiv1/models/commandslist_results.py b/jcapiv1/jcapiv1/models/commandslist_results.py index b4ae8c0..6f8ee97 100644 --- a/jcapiv1/jcapiv1/models/commandslist_results.py +++ b/jcapiv1/jcapiv1/models/commandslist_results.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class CommandslistResults(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -58,7 +55,6 @@ class CommandslistResults(object): def __init__(self, id=None, command=None, command_type=None, launch_type=None, listens_to=None, name=None, organization=None, schedule=None, schedule_repeat_type=None, trigger=None): # noqa: E501 """CommandslistResults - a model defined in Swagger""" # noqa: E501 - self._id = None self._command = None self._command_type = None @@ -70,7 +66,6 @@ def __init__(self, id=None, command=None, command_type=None, launch_type=None, l self._schedule_repeat_type = None self._trigger = None self.discriminator = None - if id is not None: self.id = id if command is not None: diff --git a/jcapiv1/jcapiv1/models/error.py b/jcapiv1/jcapiv1/models/error.py new file mode 100644 index 0000000..f3fe50f --- /dev/null +++ b/jcapiv1/jcapiv1/models/error.py @@ -0,0 +1,168 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Error(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'code': 'int', + 'message': 'str', + 'status': 'str' + } + + attribute_map = { + 'code': 'code', + 'message': 'message', + 'status': 'status' + } + + def __init__(self, code=None, message=None, status=None): # noqa: E501 + """Error - a model defined in Swagger""" # noqa: E501 + self._code = None + self._message = None + self._status = None + self.discriminator = None + if code is not None: + self.code = code + if message is not None: + self.message = message + if status is not None: + self.status = status + + @property + def code(self): + """Gets the code of this Error. # noqa: E501 + + HTTP status code # noqa: E501 + + :return: The code of this Error. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this Error. + + HTTP status code # noqa: E501 + + :param code: The code of this Error. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def message(self): + """Gets the message of this Error. # noqa: E501 + + Error message # noqa: E501 + + :return: The message of this Error. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this Error. + + Error message # noqa: E501 + + :param message: The message of this Error. # noqa: E501 + :type: str + """ + + self._message = message + + @property + def status(self): + """Gets the status of this Error. # noqa: E501 + + HTTP status description # noqa: E501 + + :return: The status of this Error. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this Error. + + HTTP status description # noqa: E501 + + :param status: The status of this Error. # noqa: E501 + :type: str + """ + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Error, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Error): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/error_details.py b/jcapiv1/jcapiv1/models/error_details.py new file mode 100644 index 0000000..a7fc15f --- /dev/null +++ b/jcapiv1/jcapiv1/models/error_details.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv1.models.error import Error # noqa: F401,E501 + +class ErrorDetails(Error): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'details': 'list[object]' + } + if hasattr(Error, "swagger_types"): + swagger_types.update(Error.swagger_types) + + attribute_map = { + 'details': 'details' + } + if hasattr(Error, "attribute_map"): + attribute_map.update(Error.attribute_map) + + def __init__(self, details=None, *args, **kwargs): # noqa: E501 + """ErrorDetails - a model defined in Swagger""" # noqa: E501 + self._details = None + self.discriminator = None + if details is not None: + self.details = details + Error.__init__(self, *args, **kwargs) + + @property + def details(self): + """Gets the details of this ErrorDetails. # noqa: E501 + + Describes a list of objects with more detailed information of the given error. Each detail schema is according to one of the messages defined in Google's API: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto\" # noqa: E501 + + :return: The details of this ErrorDetails. # noqa: E501 + :rtype: list[object] + """ + return self._details + + @details.setter + def details(self, details): + """Sets the details of this ErrorDetails. + + Describes a list of objects with more detailed information of the given error. Each detail schema is according to one of the messages defined in Google's API: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto\" # noqa: E501 + + :param details: The details of this ErrorDetails. # noqa: E501 + :type: list[object] + """ + + self._details = details + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ErrorDetails, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ErrorDetails): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/errorresponse.py b/jcapiv1/jcapiv1/models/errorresponse.py deleted file mode 100644 index 8bc4d93..0000000 --- a/jcapiv1/jcapiv1/models/errorresponse.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Errorresponse(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'message': 'str' - } - - attribute_map = { - 'message': 'message' - } - - def __init__(self, message=None): # noqa: E501 - """Errorresponse - a model defined in Swagger""" # noqa: E501 - - self._message = None - self.discriminator = None - - if message is not None: - self.message = message - - @property - def message(self): - """Gets the message of this Errorresponse. # noqa: E501 - - - :return: The message of this Errorresponse. # noqa: E501 - :rtype: str - """ - return self._message - - @message.setter - def message(self, message): - """Sets the message of this Errorresponse. - - - :param message: The message of this Errorresponse. # noqa: E501 - :type: str - """ - - self._message = message - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Errorresponse, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Errorresponse): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv1/jcapiv1/models/fde.py b/jcapiv1/jcapiv1/models/fde.py index c65deb2..78caf25 100644 --- a/jcapiv1/jcapiv1/models/fde.py +++ b/jcapiv1/jcapiv1/models/fde.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class Fde(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,11 +39,9 @@ class Fde(object): def __init__(self, active=None, key_present=None): # noqa: E501 """Fde - a model defined in Swagger""" # noqa: E501 - self._active = None self._key_present = None self.discriminator = None - if active is not None: self.active = active if key_present is not None: diff --git a/jcapiv1/jcapiv1/models/id_resetmfa_body.py b/jcapiv1/jcapiv1/models/id_resetmfa_body.py new file mode 100644 index 0000000..7d94da7 --- /dev/null +++ b/jcapiv1/jcapiv1/models/id_resetmfa_body.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IdResetmfaBody(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'exclusion': 'bool', + 'exclusion_days': 'float', + 'exclusion_until': 'datetime' + } + + attribute_map = { + 'exclusion': 'exclusion', + 'exclusion_days': 'exclusionDays', + 'exclusion_until': 'exclusionUntil' + } + + def __init__(self, exclusion=None, exclusion_days=None, exclusion_until=None): # noqa: E501 + """IdResetmfaBody - a model defined in Swagger""" # noqa: E501 + self._exclusion = None + self._exclusion_days = None + self._exclusion_until = None + self.discriminator = None + if exclusion is not None: + self.exclusion = exclusion + if exclusion_days is not None: + self.exclusion_days = exclusion_days + if exclusion_until is not None: + self.exclusion_until = exclusion_until + + @property + def exclusion(self): + """Gets the exclusion of this IdResetmfaBody. # noqa: E501 + + + :return: The exclusion of this IdResetmfaBody. # noqa: E501 + :rtype: bool + """ + return self._exclusion + + @exclusion.setter + def exclusion(self, exclusion): + """Sets the exclusion of this IdResetmfaBody. + + + :param exclusion: The exclusion of this IdResetmfaBody. # noqa: E501 + :type: bool + """ + + self._exclusion = exclusion + + @property + def exclusion_days(self): + """Gets the exclusion_days of this IdResetmfaBody. # noqa: E501 + + + :return: The exclusion_days of this IdResetmfaBody. # noqa: E501 + :rtype: float + """ + return self._exclusion_days + + @exclusion_days.setter + def exclusion_days(self, exclusion_days): + """Sets the exclusion_days of this IdResetmfaBody. + + + :param exclusion_days: The exclusion_days of this IdResetmfaBody. # noqa: E501 + :type: float + """ + + self._exclusion_days = exclusion_days + + @property + def exclusion_until(self): + """Gets the exclusion_until of this IdResetmfaBody. # noqa: E501 + + + :return: The exclusion_until of this IdResetmfaBody. # noqa: E501 + :rtype: datetime + """ + return self._exclusion_until + + @exclusion_until.setter + def exclusion_until(self, exclusion_until): + """Sets the exclusion_until of this IdResetmfaBody. + + + :param exclusion_until: The exclusion_until of this IdResetmfaBody. # noqa: E501 + :type: datetime + """ + + self._exclusion_until = exclusion_until + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IdResetmfaBody, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IdResetmfaBody): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/mfa.py b/jcapiv1/jcapiv1/models/mfa.py index 7e91c0e..3f16c1b 100644 --- a/jcapiv1/jcapiv1/models/mfa.py +++ b/jcapiv1/jcapiv1/models/mfa.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class Mfa(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,27 +30,30 @@ class Mfa(object): swagger_types = { 'configured': 'bool', 'exclusion': 'bool', + 'exclusion_days': 'int', 'exclusion_until': 'datetime' } attribute_map = { 'configured': 'configured', 'exclusion': 'exclusion', + 'exclusion_days': 'exclusionDays', 'exclusion_until': 'exclusionUntil' } - def __init__(self, configured=None, exclusion=None, exclusion_until=None): # noqa: E501 + def __init__(self, configured=None, exclusion=None, exclusion_days=None, exclusion_until=None): # noqa: E501 """Mfa - a model defined in Swagger""" # noqa: E501 - self._configured = None self._exclusion = None + self._exclusion_days = None self._exclusion_until = None self.discriminator = None - if configured is not None: self.configured = configured if exclusion is not None: self.exclusion = exclusion + if exclusion_days is not None: + self.exclusion_days = exclusion_days if exclusion_until is not None: self.exclusion_until = exclusion_until @@ -99,6 +99,27 @@ def exclusion(self, exclusion): self._exclusion = exclusion + @property + def exclusion_days(self): + """Gets the exclusion_days of this Mfa. # noqa: E501 + + + :return: The exclusion_days of this Mfa. # noqa: E501 + :rtype: int + """ + return self._exclusion_days + + @exclusion_days.setter + def exclusion_days(self, exclusion_days): + """Sets the exclusion_days of this Mfa. + + + :param exclusion_days: The exclusion_days of this Mfa. # noqa: E501 + :type: int + """ + + self._exclusion_days = exclusion_days + @property def exclusion_until(self): """Gets the exclusion_until of this Mfa. # noqa: E501 diff --git a/jcapiv1/jcapiv1/models/mfa_enrollment.py b/jcapiv1/jcapiv1/models/mfa_enrollment.py new file mode 100644 index 0000000..e014379 --- /dev/null +++ b/jcapiv1/jcapiv1/models/mfa_enrollment.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MfaEnrollment(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'overall_status': 'MfaEnrollmentStatus', + 'push_status': 'MfaEnrollmentStatus', + 'totp_status': 'MfaEnrollmentStatus', + 'web_authn_status': 'MfaEnrollmentStatus' + } + + attribute_map = { + 'overall_status': 'overallStatus', + 'push_status': 'pushStatus', + 'totp_status': 'totpStatus', + 'web_authn_status': 'webAuthnStatus' + } + + def __init__(self, overall_status=None, push_status=None, totp_status=None, web_authn_status=None): # noqa: E501 + """MfaEnrollment - a model defined in Swagger""" # noqa: E501 + self._overall_status = None + self._push_status = None + self._totp_status = None + self._web_authn_status = None + self.discriminator = None + if overall_status is not None: + self.overall_status = overall_status + if push_status is not None: + self.push_status = push_status + if totp_status is not None: + self.totp_status = totp_status + if web_authn_status is not None: + self.web_authn_status = web_authn_status + + @property + def overall_status(self): + """Gets the overall_status of this MfaEnrollment. # noqa: E501 + + + :return: The overall_status of this MfaEnrollment. # noqa: E501 + :rtype: MfaEnrollmentStatus + """ + return self._overall_status + + @overall_status.setter + def overall_status(self, overall_status): + """Sets the overall_status of this MfaEnrollment. + + + :param overall_status: The overall_status of this MfaEnrollment. # noqa: E501 + :type: MfaEnrollmentStatus + """ + + self._overall_status = overall_status + + @property + def push_status(self): + """Gets the push_status of this MfaEnrollment. # noqa: E501 + + + :return: The push_status of this MfaEnrollment. # noqa: E501 + :rtype: MfaEnrollmentStatus + """ + return self._push_status + + @push_status.setter + def push_status(self, push_status): + """Sets the push_status of this MfaEnrollment. + + + :param push_status: The push_status of this MfaEnrollment. # noqa: E501 + :type: MfaEnrollmentStatus + """ + + self._push_status = push_status + + @property + def totp_status(self): + """Gets the totp_status of this MfaEnrollment. # noqa: E501 + + + :return: The totp_status of this MfaEnrollment. # noqa: E501 + :rtype: MfaEnrollmentStatus + """ + return self._totp_status + + @totp_status.setter + def totp_status(self, totp_status): + """Sets the totp_status of this MfaEnrollment. + + + :param totp_status: The totp_status of this MfaEnrollment. # noqa: E501 + :type: MfaEnrollmentStatus + """ + + self._totp_status = totp_status + + @property + def web_authn_status(self): + """Gets the web_authn_status of this MfaEnrollment. # noqa: E501 + + + :return: The web_authn_status of this MfaEnrollment. # noqa: E501 + :rtype: MfaEnrollmentStatus + """ + return self._web_authn_status + + @web_authn_status.setter + def web_authn_status(self, web_authn_status): + """Sets the web_authn_status of this MfaEnrollment. + + + :param web_authn_status: The web_authn_status of this MfaEnrollment. # noqa: E501 + :type: MfaEnrollmentStatus + """ + + self._web_authn_status = web_authn_status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MfaEnrollment, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MfaEnrollment): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/mfa_enrollment_status.py b/jcapiv1/jcapiv1/models/mfa_enrollment_status.py new file mode 100644 index 0000000..76a96e4 --- /dev/null +++ b/jcapiv1/jcapiv1/models/mfa_enrollment_status.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MfaEnrollmentStatus(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + NOT_ENROLLED = "NOT_ENROLLED" + DISABLED = "DISABLED" + PENDING_ACTIVATION = "PENDING_ACTIVATION" + ENROLLMENT_EXPIRED = "ENROLLMENT_EXPIRED" + IN_ENROLLMENT = "IN_ENROLLMENT" + PRE_ENROLLMENT = "PRE_ENROLLMENT" + ENROLLED = "ENROLLED" + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """MfaEnrollmentStatus - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MfaEnrollmentStatus, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MfaEnrollmentStatus): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organization.py b/jcapiv1/jcapiv1/models/organization.py new file mode 100644 index 0000000..5e3d347 --- /dev/null +++ b/jcapiv1/jcapiv1/models/organization.py @@ -0,0 +1,422 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Organization(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'accounts_receivable': 'str', + 'created': 'str', + 'display_name': 'str', + 'entitlement': 'Organizationentitlement', + 'has_credit_card': 'bool', + 'has_stripe_customer_id': 'bool', + 'last_estimate_calculation_time_stamp': 'str', + 'last_sfdc_sync_status': 'object', + 'logo_url': 'str', + 'provider': 'str', + 'settings': 'Organizationsettings', + 'total_billing_estimate': 'int' + } + + attribute_map = { + 'id': '_id', + 'accounts_receivable': 'accountsReceivable', + 'created': 'created', + 'display_name': 'displayName', + 'entitlement': 'entitlement', + 'has_credit_card': 'hasCreditCard', + 'has_stripe_customer_id': 'hasStripeCustomerId', + 'last_estimate_calculation_time_stamp': 'lastEstimateCalculationTimeStamp', + 'last_sfdc_sync_status': 'lastSfdcSyncStatus', + 'logo_url': 'logoUrl', + 'provider': 'provider', + 'settings': 'settings', + 'total_billing_estimate': 'totalBillingEstimate' + } + + def __init__(self, id=None, accounts_receivable=None, created=None, display_name=None, entitlement=None, has_credit_card=None, has_stripe_customer_id=None, last_estimate_calculation_time_stamp=None, last_sfdc_sync_status=None, logo_url=None, provider=None, settings=None, total_billing_estimate=None): # noqa: E501 + """Organization - a model defined in Swagger""" # noqa: E501 + self._id = None + self._accounts_receivable = None + self._created = None + self._display_name = None + self._entitlement = None + self._has_credit_card = None + self._has_stripe_customer_id = None + self._last_estimate_calculation_time_stamp = None + self._last_sfdc_sync_status = None + self._logo_url = None + self._provider = None + self._settings = None + self._total_billing_estimate = None + self.discriminator = None + if id is not None: + self.id = id + if accounts_receivable is not None: + self.accounts_receivable = accounts_receivable + if created is not None: + self.created = created + if display_name is not None: + self.display_name = display_name + if entitlement is not None: + self.entitlement = entitlement + if has_credit_card is not None: + self.has_credit_card = has_credit_card + if has_stripe_customer_id is not None: + self.has_stripe_customer_id = has_stripe_customer_id + if last_estimate_calculation_time_stamp is not None: + self.last_estimate_calculation_time_stamp = last_estimate_calculation_time_stamp + if last_sfdc_sync_status is not None: + self.last_sfdc_sync_status = last_sfdc_sync_status + if logo_url is not None: + self.logo_url = logo_url + if provider is not None: + self.provider = provider + if settings is not None: + self.settings = settings + if total_billing_estimate is not None: + self.total_billing_estimate = total_billing_estimate + + @property + def id(self): + """Gets the id of this Organization. # noqa: E501 + + + :return: The id of this Organization. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Organization. + + + :param id: The id of this Organization. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def accounts_receivable(self): + """Gets the accounts_receivable of this Organization. # noqa: E501 + + + :return: The accounts_receivable of this Organization. # noqa: E501 + :rtype: str + """ + return self._accounts_receivable + + @accounts_receivable.setter + def accounts_receivable(self, accounts_receivable): + """Sets the accounts_receivable of this Organization. + + + :param accounts_receivable: The accounts_receivable of this Organization. # noqa: E501 + :type: str + """ + + self._accounts_receivable = accounts_receivable + + @property + def created(self): + """Gets the created of this Organization. # noqa: E501 + + + :return: The created of this Organization. # noqa: E501 + :rtype: str + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this Organization. + + + :param created: The created of this Organization. # noqa: E501 + :type: str + """ + + self._created = created + + @property + def display_name(self): + """Gets the display_name of this Organization. # noqa: E501 + + + :return: The display_name of this Organization. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this Organization. + + + :param display_name: The display_name of this Organization. # noqa: E501 + :type: str + """ + + self._display_name = display_name + + @property + def entitlement(self): + """Gets the entitlement of this Organization. # noqa: E501 + + + :return: The entitlement of this Organization. # noqa: E501 + :rtype: Organizationentitlement + """ + return self._entitlement + + @entitlement.setter + def entitlement(self, entitlement): + """Sets the entitlement of this Organization. + + + :param entitlement: The entitlement of this Organization. # noqa: E501 + :type: Organizationentitlement + """ + + self._entitlement = entitlement + + @property + def has_credit_card(self): + """Gets the has_credit_card of this Organization. # noqa: E501 + + + :return: The has_credit_card of this Organization. # noqa: E501 + :rtype: bool + """ + return self._has_credit_card + + @has_credit_card.setter + def has_credit_card(self, has_credit_card): + """Sets the has_credit_card of this Organization. + + + :param has_credit_card: The has_credit_card of this Organization. # noqa: E501 + :type: bool + """ + + self._has_credit_card = has_credit_card + + @property + def has_stripe_customer_id(self): + """Gets the has_stripe_customer_id of this Organization. # noqa: E501 + + + :return: The has_stripe_customer_id of this Organization. # noqa: E501 + :rtype: bool + """ + return self._has_stripe_customer_id + + @has_stripe_customer_id.setter + def has_stripe_customer_id(self, has_stripe_customer_id): + """Sets the has_stripe_customer_id of this Organization. + + + :param has_stripe_customer_id: The has_stripe_customer_id of this Organization. # noqa: E501 + :type: bool + """ + + self._has_stripe_customer_id = has_stripe_customer_id + + @property + def last_estimate_calculation_time_stamp(self): + """Gets the last_estimate_calculation_time_stamp of this Organization. # noqa: E501 + + + :return: The last_estimate_calculation_time_stamp of this Organization. # noqa: E501 + :rtype: str + """ + return self._last_estimate_calculation_time_stamp + + @last_estimate_calculation_time_stamp.setter + def last_estimate_calculation_time_stamp(self, last_estimate_calculation_time_stamp): + """Sets the last_estimate_calculation_time_stamp of this Organization. + + + :param last_estimate_calculation_time_stamp: The last_estimate_calculation_time_stamp of this Organization. # noqa: E501 + :type: str + """ + + self._last_estimate_calculation_time_stamp = last_estimate_calculation_time_stamp + + @property + def last_sfdc_sync_status(self): + """Gets the last_sfdc_sync_status of this Organization. # noqa: E501 + + + :return: The last_sfdc_sync_status of this Organization. # noqa: E501 + :rtype: object + """ + return self._last_sfdc_sync_status + + @last_sfdc_sync_status.setter + def last_sfdc_sync_status(self, last_sfdc_sync_status): + """Sets the last_sfdc_sync_status of this Organization. + + + :param last_sfdc_sync_status: The last_sfdc_sync_status of this Organization. # noqa: E501 + :type: object + """ + + self._last_sfdc_sync_status = last_sfdc_sync_status + + @property + def logo_url(self): + """Gets the logo_url of this Organization. # noqa: E501 + + + :return: The logo_url of this Organization. # noqa: E501 + :rtype: str + """ + return self._logo_url + + @logo_url.setter + def logo_url(self, logo_url): + """Sets the logo_url of this Organization. + + + :param logo_url: The logo_url of this Organization. # noqa: E501 + :type: str + """ + + self._logo_url = logo_url + + @property + def provider(self): + """Gets the provider of this Organization. # noqa: E501 + + + :return: The provider of this Organization. # noqa: E501 + :rtype: str + """ + return self._provider + + @provider.setter + def provider(self, provider): + """Sets the provider of this Organization. + + + :param provider: The provider of this Organization. # noqa: E501 + :type: str + """ + + self._provider = provider + + @property + def settings(self): + """Gets the settings of this Organization. # noqa: E501 + + + :return: The settings of this Organization. # noqa: E501 + :rtype: Organizationsettings + """ + return self._settings + + @settings.setter + def settings(self, settings): + """Sets the settings of this Organization. + + + :param settings: The settings of this Organization. # noqa: E501 + :type: Organizationsettings + """ + + self._settings = settings + + @property + def total_billing_estimate(self): + """Gets the total_billing_estimate of this Organization. # noqa: E501 + + + :return: The total_billing_estimate of this Organization. # noqa: E501 + :rtype: int + """ + return self._total_billing_estimate + + @total_billing_estimate.setter + def total_billing_estimate(self, total_billing_estimate): + """Sets the total_billing_estimate of this Organization. + + + :param total_billing_estimate: The total_billing_estimate of this Organization. # noqa: E501 + :type: int + """ + + self._total_billing_estimate = total_billing_estimate + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Organization, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Organization): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationentitlement.py b/jcapiv1/jcapiv1/models/organizationentitlement.py new file mode 100644 index 0000000..fdc4c15 --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationentitlement.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Organizationentitlement(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'billing_model': 'str', + 'entitlement_products': 'list[OrganizationentitlementEntitlementProducts]', + 'is_manually_billed': 'bool', + 'price_per_user_sum': 'int' + } + + attribute_map = { + 'billing_model': 'billingModel', + 'entitlement_products': 'entitlementProducts', + 'is_manually_billed': 'isManuallyBilled', + 'price_per_user_sum': 'pricePerUserSum' + } + + def __init__(self, billing_model=None, entitlement_products=None, is_manually_billed=None, price_per_user_sum=None): # noqa: E501 + """Organizationentitlement - a model defined in Swagger""" # noqa: E501 + self._billing_model = None + self._entitlement_products = None + self._is_manually_billed = None + self._price_per_user_sum = None + self.discriminator = None + if billing_model is not None: + self.billing_model = billing_model + if entitlement_products is not None: + self.entitlement_products = entitlement_products + if is_manually_billed is not None: + self.is_manually_billed = is_manually_billed + if price_per_user_sum is not None: + self.price_per_user_sum = price_per_user_sum + + @property + def billing_model(self): + """Gets the billing_model of this Organizationentitlement. # noqa: E501 + + + :return: The billing_model of this Organizationentitlement. # noqa: E501 + :rtype: str + """ + return self._billing_model + + @billing_model.setter + def billing_model(self, billing_model): + """Sets the billing_model of this Organizationentitlement. + + + :param billing_model: The billing_model of this Organizationentitlement. # noqa: E501 + :type: str + """ + + self._billing_model = billing_model + + @property + def entitlement_products(self): + """Gets the entitlement_products of this Organizationentitlement. # noqa: E501 + + + :return: The entitlement_products of this Organizationentitlement. # noqa: E501 + :rtype: list[OrganizationentitlementEntitlementProducts] + """ + return self._entitlement_products + + @entitlement_products.setter + def entitlement_products(self, entitlement_products): + """Sets the entitlement_products of this Organizationentitlement. + + + :param entitlement_products: The entitlement_products of this Organizationentitlement. # noqa: E501 + :type: list[OrganizationentitlementEntitlementProducts] + """ + + self._entitlement_products = entitlement_products + + @property + def is_manually_billed(self): + """Gets the is_manually_billed of this Organizationentitlement. # noqa: E501 + + + :return: The is_manually_billed of this Organizationentitlement. # noqa: E501 + :rtype: bool + """ + return self._is_manually_billed + + @is_manually_billed.setter + def is_manually_billed(self, is_manually_billed): + """Sets the is_manually_billed of this Organizationentitlement. + + + :param is_manually_billed: The is_manually_billed of this Organizationentitlement. # noqa: E501 + :type: bool + """ + + self._is_manually_billed = is_manually_billed + + @property + def price_per_user_sum(self): + """Gets the price_per_user_sum of this Organizationentitlement. # noqa: E501 + + + :return: The price_per_user_sum of this Organizationentitlement. # noqa: E501 + :rtype: int + """ + return self._price_per_user_sum + + @price_per_user_sum.setter + def price_per_user_sum(self, price_per_user_sum): + """Sets the price_per_user_sum of this Organizationentitlement. + + + :param price_per_user_sum: The price_per_user_sum of this Organizationentitlement. # noqa: E501 + :type: int + """ + + self._price_per_user_sum = price_per_user_sum + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Organizationentitlement, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Organizationentitlement): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationentitlement_entitlement_products.py b/jcapiv1/jcapiv1/models/organizationentitlement_entitlement_products.py new file mode 100644 index 0000000..e5e0fbf --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationentitlement_entitlement_products.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationentitlementEntitlementProducts(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'committed_users': 'int', + 'contract_type': 'str', + 'max_user_count': 'int', + 'name': 'str', + 'price_per_user': 'int', + 'product_category': 'str', + 'product_code': 'str', + 'uncommitted_users': 'int' + } + + attribute_map = { + 'committed_users': 'committedUsers', + 'contract_type': 'contractType', + 'max_user_count': 'maxUserCount', + 'name': 'name', + 'price_per_user': 'pricePerUser', + 'product_category': 'productCategory', + 'product_code': 'productCode', + 'uncommitted_users': 'uncommittedUsers' + } + + def __init__(self, committed_users=None, contract_type=None, max_user_count=None, name=None, price_per_user=None, product_category=None, product_code=None, uncommitted_users=None): # noqa: E501 + """OrganizationentitlementEntitlementProducts - a model defined in Swagger""" # noqa: E501 + self._committed_users = None + self._contract_type = None + self._max_user_count = None + self._name = None + self._price_per_user = None + self._product_category = None + self._product_code = None + self._uncommitted_users = None + self.discriminator = None + if committed_users is not None: + self.committed_users = committed_users + if contract_type is not None: + self.contract_type = contract_type + if max_user_count is not None: + self.max_user_count = max_user_count + if name is not None: + self.name = name + if price_per_user is not None: + self.price_per_user = price_per_user + if product_category is not None: + self.product_category = product_category + if product_code is not None: + self.product_code = product_code + if uncommitted_users is not None: + self.uncommitted_users = uncommitted_users + + @property + def committed_users(self): + """Gets the committed_users of this OrganizationentitlementEntitlementProducts. # noqa: E501 + + + :return: The committed_users of this OrganizationentitlementEntitlementProducts. # noqa: E501 + :rtype: int + """ + return self._committed_users + + @committed_users.setter + def committed_users(self, committed_users): + """Sets the committed_users of this OrganizationentitlementEntitlementProducts. + + + :param committed_users: The committed_users of this OrganizationentitlementEntitlementProducts. # noqa: E501 + :type: int + """ + + self._committed_users = committed_users + + @property + def contract_type(self): + """Gets the contract_type of this OrganizationentitlementEntitlementProducts. # noqa: E501 + + + :return: The contract_type of this OrganizationentitlementEntitlementProducts. # noqa: E501 + :rtype: str + """ + return self._contract_type + + @contract_type.setter + def contract_type(self, contract_type): + """Sets the contract_type of this OrganizationentitlementEntitlementProducts. + + + :param contract_type: The contract_type of this OrganizationentitlementEntitlementProducts. # noqa: E501 + :type: str + """ + + self._contract_type = contract_type + + @property + def max_user_count(self): + """Gets the max_user_count of this OrganizationentitlementEntitlementProducts. # noqa: E501 + + + :return: The max_user_count of this OrganizationentitlementEntitlementProducts. # noqa: E501 + :rtype: int + """ + return self._max_user_count + + @max_user_count.setter + def max_user_count(self, max_user_count): + """Sets the max_user_count of this OrganizationentitlementEntitlementProducts. + + + :param max_user_count: The max_user_count of this OrganizationentitlementEntitlementProducts. # noqa: E501 + :type: int + """ + + self._max_user_count = max_user_count + + @property + def name(self): + """Gets the name of this OrganizationentitlementEntitlementProducts. # noqa: E501 + + + :return: The name of this OrganizationentitlementEntitlementProducts. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this OrganizationentitlementEntitlementProducts. + + + :param name: The name of this OrganizationentitlementEntitlementProducts. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def price_per_user(self): + """Gets the price_per_user of this OrganizationentitlementEntitlementProducts. # noqa: E501 + + + :return: The price_per_user of this OrganizationentitlementEntitlementProducts. # noqa: E501 + :rtype: int + """ + return self._price_per_user + + @price_per_user.setter + def price_per_user(self, price_per_user): + """Sets the price_per_user of this OrganizationentitlementEntitlementProducts. + + + :param price_per_user: The price_per_user of this OrganizationentitlementEntitlementProducts. # noqa: E501 + :type: int + """ + + self._price_per_user = price_per_user + + @property + def product_category(self): + """Gets the product_category of this OrganizationentitlementEntitlementProducts. # noqa: E501 + + + :return: The product_category of this OrganizationentitlementEntitlementProducts. # noqa: E501 + :rtype: str + """ + return self._product_category + + @product_category.setter + def product_category(self, product_category): + """Sets the product_category of this OrganizationentitlementEntitlementProducts. + + + :param product_category: The product_category of this OrganizationentitlementEntitlementProducts. # noqa: E501 + :type: str + """ + + self._product_category = product_category + + @property + def product_code(self): + """Gets the product_code of this OrganizationentitlementEntitlementProducts. # noqa: E501 + + + :return: The product_code of this OrganizationentitlementEntitlementProducts. # noqa: E501 + :rtype: str + """ + return self._product_code + + @product_code.setter + def product_code(self, product_code): + """Sets the product_code of this OrganizationentitlementEntitlementProducts. + + + :param product_code: The product_code of this OrganizationentitlementEntitlementProducts. # noqa: E501 + :type: str + """ + + self._product_code = product_code + + @property + def uncommitted_users(self): + """Gets the uncommitted_users of this OrganizationentitlementEntitlementProducts. # noqa: E501 + + + :return: The uncommitted_users of this OrganizationentitlementEntitlementProducts. # noqa: E501 + :rtype: int + """ + return self._uncommitted_users + + @uncommitted_users.setter + def uncommitted_users(self, uncommitted_users): + """Sets the uncommitted_users of this OrganizationentitlementEntitlementProducts. + + + :param uncommitted_users: The uncommitted_users of this OrganizationentitlementEntitlementProducts. # noqa: E501 + :type: int + """ + + self._uncommitted_users = uncommitted_users + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationentitlementEntitlementProducts, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationentitlementEntitlementProducts): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizations_id_body.py b/jcapiv1/jcapiv1/models/organizations_id_body.py new file mode 100644 index 0000000..f754f99 --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizations_id_body.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationsIdBody(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'settings': 'Organizationsettingsput' + } + + attribute_map = { + 'settings': 'settings' + } + + def __init__(self, settings=None): # noqa: E501 + """OrganizationsIdBody - a model defined in Swagger""" # noqa: E501 + self._settings = None + self.discriminator = None + if settings is not None: + self.settings = settings + + @property + def settings(self): + """Gets the settings of this OrganizationsIdBody. # noqa: E501 + + + :return: The settings of this OrganizationsIdBody. # noqa: E501 + :rtype: Organizationsettingsput + """ + return self._settings + + @settings.setter + def settings(self, settings): + """Sets the settings of this OrganizationsIdBody. + + + :param settings: The settings of this OrganizationsIdBody. # noqa: E501 + :type: Organizationsettingsput + """ + + self._settings = settings + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationsIdBody, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationsIdBody): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationsettings.py b/jcapiv1/jcapiv1/models/organizationsettings.py new file mode 100644 index 0000000..1db62c2 --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationsettings.py @@ -0,0 +1,872 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Organizationsettings(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'agent_version': 'str', + 'beta_features': 'object', + 'contact_email': 'str', + 'contact_name': 'str', + 'device_identification_enabled': 'bool', + 'disable_command_runner': 'bool', + 'disable_google_login': 'bool', + 'disable_ldap': 'bool', + 'disable_um': 'bool', + 'display_preferences': 'OrganizationsettingsDisplayPreferences', + 'duplicate_ldap_groups': 'bool', + 'email_disclaimer': 'str', + 'enable_google_apps': 'bool', + 'enable_managed_uid': 'bool', + 'enable_o365': 'bool', + 'enable_user_portal_agent_install': 'bool', + 'features': 'OrganizationsettingsFeatures', + 'growth_data': 'object', + 'logo': 'str', + 'name': 'str', + 'new_system_user_state_defaults': 'OrganizationsettingsNewSystemUserStateDefaults', + 'password_compliance': 'str', + 'password_policy': 'OrganizationsettingsPasswordPolicy', + 'pending_delete': 'bool', + 'show_intro': 'bool', + 'system_user_password_expiration_in_days': 'int', + 'system_users_can_edit': 'bool', + 'system_users_cap': 'int', + 'trusted_app_config': 'TrustedappConfigGet', + 'user_portal': 'OrganizationsettingsUserPortal' + } + + attribute_map = { + 'agent_version': 'agentVersion', + 'beta_features': 'betaFeatures', + 'contact_email': 'contactEmail', + 'contact_name': 'contactName', + 'device_identification_enabled': 'deviceIdentificationEnabled', + 'disable_command_runner': 'disableCommandRunner', + 'disable_google_login': 'disableGoogleLogin', + 'disable_ldap': 'disableLdap', + 'disable_um': 'disableUM', + 'display_preferences': 'displayPreferences', + 'duplicate_ldap_groups': 'duplicateLDAPGroups', + 'email_disclaimer': 'emailDisclaimer', + 'enable_google_apps': 'enableGoogleApps', + 'enable_managed_uid': 'enableManagedUID', + 'enable_o365': 'enableO365', + 'enable_user_portal_agent_install': 'enableUserPortalAgentInstall', + 'features': 'features', + 'growth_data': 'growthData', + 'logo': 'logo', + 'name': 'name', + 'new_system_user_state_defaults': 'newSystemUserStateDefaults', + 'password_compliance': 'passwordCompliance', + 'password_policy': 'passwordPolicy', + 'pending_delete': 'pendingDelete', + 'show_intro': 'showIntro', + 'system_user_password_expiration_in_days': 'systemUserPasswordExpirationInDays', + 'system_users_can_edit': 'systemUsersCanEdit', + 'system_users_cap': 'systemUsersCap', + 'trusted_app_config': 'trustedAppConfig', + 'user_portal': 'userPortal' + } + + def __init__(self, agent_version=None, beta_features=None, contact_email=None, contact_name=None, device_identification_enabled=None, disable_command_runner=None, disable_google_login=None, disable_ldap=None, disable_um=None, display_preferences=None, duplicate_ldap_groups=None, email_disclaimer=None, enable_google_apps=None, enable_managed_uid=None, enable_o365=None, enable_user_portal_agent_install=None, features=None, growth_data=None, logo=None, name=None, new_system_user_state_defaults=None, password_compliance=None, password_policy=None, pending_delete=None, show_intro=None, system_user_password_expiration_in_days=None, system_users_can_edit=None, system_users_cap=None, trusted_app_config=None, user_portal=None): # noqa: E501 + """Organizationsettings - a model defined in Swagger""" # noqa: E501 + self._agent_version = None + self._beta_features = None + self._contact_email = None + self._contact_name = None + self._device_identification_enabled = None + self._disable_command_runner = None + self._disable_google_login = None + self._disable_ldap = None + self._disable_um = None + self._display_preferences = None + self._duplicate_ldap_groups = None + self._email_disclaimer = None + self._enable_google_apps = None + self._enable_managed_uid = None + self._enable_o365 = None + self._enable_user_portal_agent_install = None + self._features = None + self._growth_data = None + self._logo = None + self._name = None + self._new_system_user_state_defaults = None + self._password_compliance = None + self._password_policy = None + self._pending_delete = None + self._show_intro = None + self._system_user_password_expiration_in_days = None + self._system_users_can_edit = None + self._system_users_cap = None + self._trusted_app_config = None + self._user_portal = None + self.discriminator = None + if agent_version is not None: + self.agent_version = agent_version + if beta_features is not None: + self.beta_features = beta_features + if contact_email is not None: + self.contact_email = contact_email + if contact_name is not None: + self.contact_name = contact_name + if device_identification_enabled is not None: + self.device_identification_enabled = device_identification_enabled + if disable_command_runner is not None: + self.disable_command_runner = disable_command_runner + if disable_google_login is not None: + self.disable_google_login = disable_google_login + if disable_ldap is not None: + self.disable_ldap = disable_ldap + if disable_um is not None: + self.disable_um = disable_um + if display_preferences is not None: + self.display_preferences = display_preferences + if duplicate_ldap_groups is not None: + self.duplicate_ldap_groups = duplicate_ldap_groups + if email_disclaimer is not None: + self.email_disclaimer = email_disclaimer + if enable_google_apps is not None: + self.enable_google_apps = enable_google_apps + if enable_managed_uid is not None: + self.enable_managed_uid = enable_managed_uid + if enable_o365 is not None: + self.enable_o365 = enable_o365 + if enable_user_portal_agent_install is not None: + self.enable_user_portal_agent_install = enable_user_portal_agent_install + if features is not None: + self.features = features + if growth_data is not None: + self.growth_data = growth_data + if logo is not None: + self.logo = logo + if name is not None: + self.name = name + if new_system_user_state_defaults is not None: + self.new_system_user_state_defaults = new_system_user_state_defaults + if password_compliance is not None: + self.password_compliance = password_compliance + if password_policy is not None: + self.password_policy = password_policy + if pending_delete is not None: + self.pending_delete = pending_delete + if show_intro is not None: + self.show_intro = show_intro + if system_user_password_expiration_in_days is not None: + self.system_user_password_expiration_in_days = system_user_password_expiration_in_days + if system_users_can_edit is not None: + self.system_users_can_edit = system_users_can_edit + if system_users_cap is not None: + self.system_users_cap = system_users_cap + if trusted_app_config is not None: + self.trusted_app_config = trusted_app_config + if user_portal is not None: + self.user_portal = user_portal + + @property + def agent_version(self): + """Gets the agent_version of this Organizationsettings. # noqa: E501 + + + :return: The agent_version of this Organizationsettings. # noqa: E501 + :rtype: str + """ + return self._agent_version + + @agent_version.setter + def agent_version(self, agent_version): + """Sets the agent_version of this Organizationsettings. + + + :param agent_version: The agent_version of this Organizationsettings. # noqa: E501 + :type: str + """ + + self._agent_version = agent_version + + @property + def beta_features(self): + """Gets the beta_features of this Organizationsettings. # noqa: E501 + + + :return: The beta_features of this Organizationsettings. # noqa: E501 + :rtype: object + """ + return self._beta_features + + @beta_features.setter + def beta_features(self, beta_features): + """Sets the beta_features of this Organizationsettings. + + + :param beta_features: The beta_features of this Organizationsettings. # noqa: E501 + :type: object + """ + + self._beta_features = beta_features + + @property + def contact_email(self): + """Gets the contact_email of this Organizationsettings. # noqa: E501 + + + :return: The contact_email of this Organizationsettings. # noqa: E501 + :rtype: str + """ + return self._contact_email + + @contact_email.setter + def contact_email(self, contact_email): + """Sets the contact_email of this Organizationsettings. + + + :param contact_email: The contact_email of this Organizationsettings. # noqa: E501 + :type: str + """ + + self._contact_email = contact_email + + @property + def contact_name(self): + """Gets the contact_name of this Organizationsettings. # noqa: E501 + + + :return: The contact_name of this Organizationsettings. # noqa: E501 + :rtype: str + """ + return self._contact_name + + @contact_name.setter + def contact_name(self, contact_name): + """Sets the contact_name of this Organizationsettings. + + + :param contact_name: The contact_name of this Organizationsettings. # noqa: E501 + :type: str + """ + + self._contact_name = contact_name + + @property + def device_identification_enabled(self): + """Gets the device_identification_enabled of this Organizationsettings. # noqa: E501 + + + :return: The device_identification_enabled of this Organizationsettings. # noqa: E501 + :rtype: bool + """ + return self._device_identification_enabled + + @device_identification_enabled.setter + def device_identification_enabled(self, device_identification_enabled): + """Sets the device_identification_enabled of this Organizationsettings. + + + :param device_identification_enabled: The device_identification_enabled of this Organizationsettings. # noqa: E501 + :type: bool + """ + + self._device_identification_enabled = device_identification_enabled + + @property + def disable_command_runner(self): + """Gets the disable_command_runner of this Organizationsettings. # noqa: E501 + + + :return: The disable_command_runner of this Organizationsettings. # noqa: E501 + :rtype: bool + """ + return self._disable_command_runner + + @disable_command_runner.setter + def disable_command_runner(self, disable_command_runner): + """Sets the disable_command_runner of this Organizationsettings. + + + :param disable_command_runner: The disable_command_runner of this Organizationsettings. # noqa: E501 + :type: bool + """ + + self._disable_command_runner = disable_command_runner + + @property + def disable_google_login(self): + """Gets the disable_google_login of this Organizationsettings. # noqa: E501 + + + :return: The disable_google_login of this Organizationsettings. # noqa: E501 + :rtype: bool + """ + return self._disable_google_login + + @disable_google_login.setter + def disable_google_login(self, disable_google_login): + """Sets the disable_google_login of this Organizationsettings. + + + :param disable_google_login: The disable_google_login of this Organizationsettings. # noqa: E501 + :type: bool + """ + + self._disable_google_login = disable_google_login + + @property + def disable_ldap(self): + """Gets the disable_ldap of this Organizationsettings. # noqa: E501 + + + :return: The disable_ldap of this Organizationsettings. # noqa: E501 + :rtype: bool + """ + return self._disable_ldap + + @disable_ldap.setter + def disable_ldap(self, disable_ldap): + """Sets the disable_ldap of this Organizationsettings. + + + :param disable_ldap: The disable_ldap of this Organizationsettings. # noqa: E501 + :type: bool + """ + + self._disable_ldap = disable_ldap + + @property + def disable_um(self): + """Gets the disable_um of this Organizationsettings. # noqa: E501 + + + :return: The disable_um of this Organizationsettings. # noqa: E501 + :rtype: bool + """ + return self._disable_um + + @disable_um.setter + def disable_um(self, disable_um): + """Sets the disable_um of this Organizationsettings. + + + :param disable_um: The disable_um of this Organizationsettings. # noqa: E501 + :type: bool + """ + + self._disable_um = disable_um + + @property + def display_preferences(self): + """Gets the display_preferences of this Organizationsettings. # noqa: E501 + + + :return: The display_preferences of this Organizationsettings. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferences + """ + return self._display_preferences + + @display_preferences.setter + def display_preferences(self, display_preferences): + """Sets the display_preferences of this Organizationsettings. + + + :param display_preferences: The display_preferences of this Organizationsettings. # noqa: E501 + :type: OrganizationsettingsDisplayPreferences + """ + + self._display_preferences = display_preferences + + @property + def duplicate_ldap_groups(self): + """Gets the duplicate_ldap_groups of this Organizationsettings. # noqa: E501 + + + :return: The duplicate_ldap_groups of this Organizationsettings. # noqa: E501 + :rtype: bool + """ + return self._duplicate_ldap_groups + + @duplicate_ldap_groups.setter + def duplicate_ldap_groups(self, duplicate_ldap_groups): + """Sets the duplicate_ldap_groups of this Organizationsettings. + + + :param duplicate_ldap_groups: The duplicate_ldap_groups of this Organizationsettings. # noqa: E501 + :type: bool + """ + + self._duplicate_ldap_groups = duplicate_ldap_groups + + @property + def email_disclaimer(self): + """Gets the email_disclaimer of this Organizationsettings. # noqa: E501 + + + :return: The email_disclaimer of this Organizationsettings. # noqa: E501 + :rtype: str + """ + return self._email_disclaimer + + @email_disclaimer.setter + def email_disclaimer(self, email_disclaimer): + """Sets the email_disclaimer of this Organizationsettings. + + + :param email_disclaimer: The email_disclaimer of this Organizationsettings. # noqa: E501 + :type: str + """ + + self._email_disclaimer = email_disclaimer + + @property + def enable_google_apps(self): + """Gets the enable_google_apps of this Organizationsettings. # noqa: E501 + + + :return: The enable_google_apps of this Organizationsettings. # noqa: E501 + :rtype: bool + """ + return self._enable_google_apps + + @enable_google_apps.setter + def enable_google_apps(self, enable_google_apps): + """Sets the enable_google_apps of this Organizationsettings. + + + :param enable_google_apps: The enable_google_apps of this Organizationsettings. # noqa: E501 + :type: bool + """ + + self._enable_google_apps = enable_google_apps + + @property + def enable_managed_uid(self): + """Gets the enable_managed_uid of this Organizationsettings. # noqa: E501 + + + :return: The enable_managed_uid of this Organizationsettings. # noqa: E501 + :rtype: bool + """ + return self._enable_managed_uid + + @enable_managed_uid.setter + def enable_managed_uid(self, enable_managed_uid): + """Sets the enable_managed_uid of this Organizationsettings. + + + :param enable_managed_uid: The enable_managed_uid of this Organizationsettings. # noqa: E501 + :type: bool + """ + + self._enable_managed_uid = enable_managed_uid + + @property + def enable_o365(self): + """Gets the enable_o365 of this Organizationsettings. # noqa: E501 + + + :return: The enable_o365 of this Organizationsettings. # noqa: E501 + :rtype: bool + """ + return self._enable_o365 + + @enable_o365.setter + def enable_o365(self, enable_o365): + """Sets the enable_o365 of this Organizationsettings. + + + :param enable_o365: The enable_o365 of this Organizationsettings. # noqa: E501 + :type: bool + """ + + self._enable_o365 = enable_o365 + + @property + def enable_user_portal_agent_install(self): + """Gets the enable_user_portal_agent_install of this Organizationsettings. # noqa: E501 + + + :return: The enable_user_portal_agent_install of this Organizationsettings. # noqa: E501 + :rtype: bool + """ + return self._enable_user_portal_agent_install + + @enable_user_portal_agent_install.setter + def enable_user_portal_agent_install(self, enable_user_portal_agent_install): + """Sets the enable_user_portal_agent_install of this Organizationsettings. + + + :param enable_user_portal_agent_install: The enable_user_portal_agent_install of this Organizationsettings. # noqa: E501 + :type: bool + """ + + self._enable_user_portal_agent_install = enable_user_portal_agent_install + + @property + def features(self): + """Gets the features of this Organizationsettings. # noqa: E501 + + + :return: The features of this Organizationsettings. # noqa: E501 + :rtype: OrganizationsettingsFeatures + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this Organizationsettings. + + + :param features: The features of this Organizationsettings. # noqa: E501 + :type: OrganizationsettingsFeatures + """ + + self._features = features + + @property + def growth_data(self): + """Gets the growth_data of this Organizationsettings. # noqa: E501 + + Object containing Optimizely experimentIds and states corresponding to them # noqa: E501 + + :return: The growth_data of this Organizationsettings. # noqa: E501 + :rtype: object + """ + return self._growth_data + + @growth_data.setter + def growth_data(self, growth_data): + """Sets the growth_data of this Organizationsettings. + + Object containing Optimizely experimentIds and states corresponding to them # noqa: E501 + + :param growth_data: The growth_data of this Organizationsettings. # noqa: E501 + :type: object + """ + + self._growth_data = growth_data + + @property + def logo(self): + """Gets the logo of this Organizationsettings. # noqa: E501 + + + :return: The logo of this Organizationsettings. # noqa: E501 + :rtype: str + """ + return self._logo + + @logo.setter + def logo(self, logo): + """Sets the logo of this Organizationsettings. + + + :param logo: The logo of this Organizationsettings. # noqa: E501 + :type: str + """ + + self._logo = logo + + @property + def name(self): + """Gets the name of this Organizationsettings. # noqa: E501 + + + :return: The name of this Organizationsettings. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Organizationsettings. + + + :param name: The name of this Organizationsettings. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def new_system_user_state_defaults(self): + """Gets the new_system_user_state_defaults of this Organizationsettings. # noqa: E501 + + + :return: The new_system_user_state_defaults of this Organizationsettings. # noqa: E501 + :rtype: OrganizationsettingsNewSystemUserStateDefaults + """ + return self._new_system_user_state_defaults + + @new_system_user_state_defaults.setter + def new_system_user_state_defaults(self, new_system_user_state_defaults): + """Sets the new_system_user_state_defaults of this Organizationsettings. + + + :param new_system_user_state_defaults: The new_system_user_state_defaults of this Organizationsettings. # noqa: E501 + :type: OrganizationsettingsNewSystemUserStateDefaults + """ + + self._new_system_user_state_defaults = new_system_user_state_defaults + + @property + def password_compliance(self): + """Gets the password_compliance of this Organizationsettings. # noqa: E501 + + + :return: The password_compliance of this Organizationsettings. # noqa: E501 + :rtype: str + """ + return self._password_compliance + + @password_compliance.setter + def password_compliance(self, password_compliance): + """Sets the password_compliance of this Organizationsettings. + + + :param password_compliance: The password_compliance of this Organizationsettings. # noqa: E501 + :type: str + """ + allowed_values = ["custom", "pci3", "windows"] # noqa: E501 + if password_compliance not in allowed_values: + raise ValueError( + "Invalid value for `password_compliance` ({0}), must be one of {1}" # noqa: E501 + .format(password_compliance, allowed_values) + ) + + self._password_compliance = password_compliance + + @property + def password_policy(self): + """Gets the password_policy of this Organizationsettings. # noqa: E501 + + + :return: The password_policy of this Organizationsettings. # noqa: E501 + :rtype: OrganizationsettingsPasswordPolicy + """ + return self._password_policy + + @password_policy.setter + def password_policy(self, password_policy): + """Sets the password_policy of this Organizationsettings. + + + :param password_policy: The password_policy of this Organizationsettings. # noqa: E501 + :type: OrganizationsettingsPasswordPolicy + """ + + self._password_policy = password_policy + + @property + def pending_delete(self): + """Gets the pending_delete of this Organizationsettings. # noqa: E501 + + + :return: The pending_delete of this Organizationsettings. # noqa: E501 + :rtype: bool + """ + return self._pending_delete + + @pending_delete.setter + def pending_delete(self, pending_delete): + """Sets the pending_delete of this Organizationsettings. + + + :param pending_delete: The pending_delete of this Organizationsettings. # noqa: E501 + :type: bool + """ + + self._pending_delete = pending_delete + + @property + def show_intro(self): + """Gets the show_intro of this Organizationsettings. # noqa: E501 + + + :return: The show_intro of this Organizationsettings. # noqa: E501 + :rtype: bool + """ + return self._show_intro + + @show_intro.setter + def show_intro(self, show_intro): + """Sets the show_intro of this Organizationsettings. + + + :param show_intro: The show_intro of this Organizationsettings. # noqa: E501 + :type: bool + """ + + self._show_intro = show_intro + + @property + def system_user_password_expiration_in_days(self): + """Gets the system_user_password_expiration_in_days of this Organizationsettings. # noqa: E501 + + + :return: The system_user_password_expiration_in_days of this Organizationsettings. # noqa: E501 + :rtype: int + """ + return self._system_user_password_expiration_in_days + + @system_user_password_expiration_in_days.setter + def system_user_password_expiration_in_days(self, system_user_password_expiration_in_days): + """Sets the system_user_password_expiration_in_days of this Organizationsettings. + + + :param system_user_password_expiration_in_days: The system_user_password_expiration_in_days of this Organizationsettings. # noqa: E501 + :type: int + """ + + self._system_user_password_expiration_in_days = system_user_password_expiration_in_days + + @property + def system_users_can_edit(self): + """Gets the system_users_can_edit of this Organizationsettings. # noqa: E501 + + + :return: The system_users_can_edit of this Organizationsettings. # noqa: E501 + :rtype: bool + """ + return self._system_users_can_edit + + @system_users_can_edit.setter + def system_users_can_edit(self, system_users_can_edit): + """Sets the system_users_can_edit of this Organizationsettings. + + + :param system_users_can_edit: The system_users_can_edit of this Organizationsettings. # noqa: E501 + :type: bool + """ + + self._system_users_can_edit = system_users_can_edit + + @property + def system_users_cap(self): + """Gets the system_users_cap of this Organizationsettings. # noqa: E501 + + + :return: The system_users_cap of this Organizationsettings. # noqa: E501 + :rtype: int + """ + return self._system_users_cap + + @system_users_cap.setter + def system_users_cap(self, system_users_cap): + """Sets the system_users_cap of this Organizationsettings. + + + :param system_users_cap: The system_users_cap of this Organizationsettings. # noqa: E501 + :type: int + """ + + self._system_users_cap = system_users_cap + + @property + def trusted_app_config(self): + """Gets the trusted_app_config of this Organizationsettings. # noqa: E501 + + + :return: The trusted_app_config of this Organizationsettings. # noqa: E501 + :rtype: TrustedappConfigGet + """ + return self._trusted_app_config + + @trusted_app_config.setter + def trusted_app_config(self, trusted_app_config): + """Sets the trusted_app_config of this Organizationsettings. + + + :param trusted_app_config: The trusted_app_config of this Organizationsettings. # noqa: E501 + :type: TrustedappConfigGet + """ + + self._trusted_app_config = trusted_app_config + + @property + def user_portal(self): + """Gets the user_portal of this Organizationsettings. # noqa: E501 + + + :return: The user_portal of this Organizationsettings. # noqa: E501 + :rtype: OrganizationsettingsUserPortal + """ + return self._user_portal + + @user_portal.setter + def user_portal(self, user_portal): + """Sets the user_portal of this Organizationsettings. + + + :param user_portal: The user_portal of this Organizationsettings. # noqa: E501 + :type: OrganizationsettingsUserPortal + """ + + self._user_portal = user_portal + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Organizationsettings, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Organizationsettings): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationsettings_display_preferences.py b/jcapiv1/jcapiv1/models/organizationsettings_display_preferences.py new file mode 100644 index 0000000..43dee9a --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationsettings_display_preferences.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationsettingsDisplayPreferences(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'org_insights': 'OrganizationsettingsDisplayPreferencesOrgInsights' + } + + attribute_map = { + 'org_insights': 'orgInsights' + } + + def __init__(self, org_insights=None): # noqa: E501 + """OrganizationsettingsDisplayPreferences - a model defined in Swagger""" # noqa: E501 + self._org_insights = None + self.discriminator = None + if org_insights is not None: + self.org_insights = org_insights + + @property + def org_insights(self): + """Gets the org_insights of this OrganizationsettingsDisplayPreferences. # noqa: E501 + + + :return: The org_insights of this OrganizationsettingsDisplayPreferences. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsights + """ + return self._org_insights + + @org_insights.setter + def org_insights(self, org_insights): + """Sets the org_insights of this OrganizationsettingsDisplayPreferences. + + + :param org_insights: The org_insights of this OrganizationsettingsDisplayPreferences. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsights + """ + + self._org_insights = org_insights + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationsettingsDisplayPreferences, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationsettingsDisplayPreferences): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights.py b/jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights.py new file mode 100644 index 0000000..c6cb8fc --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights.py @@ -0,0 +1,578 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationsettingsDisplayPreferencesOrgInsights(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'applications_usage': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'console_stats': 'OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats', + 'device_notifications': 'OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications', + 'disk_encryption': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'expired_passwords': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'failed_commands': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'failed_configurations': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'fundamentals': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'jc_university': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'learning_center': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'mdm_certificate_expirations': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'mfa_enrolled_devices': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'new_os_releases': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'new_users': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'office_hours': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'pending_commands': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'upcoming_password_expiration': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'user_lockouts': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'user_notifications': 'OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications' + } + + attribute_map = { + 'applications_usage': 'applicationsUsage', + 'console_stats': 'consoleStats', + 'device_notifications': 'deviceNotifications', + 'disk_encryption': 'diskEncryption', + 'expired_passwords': 'expiredPasswords', + 'failed_commands': 'failedCommands', + 'failed_configurations': 'failedConfigurations', + 'fundamentals': 'fundamentals', + 'jc_university': 'jcUniversity', + 'learning_center': 'learningCenter', + 'mdm_certificate_expirations': 'mdmCertificateExpirations', + 'mfa_enrolled_devices': 'mfaEnrolledDevices', + 'new_os_releases': 'newOSReleases', + 'new_users': 'newUsers', + 'office_hours': 'officeHours', + 'pending_commands': 'pendingCommands', + 'upcoming_password_expiration': 'upcomingPasswordExpiration', + 'user_lockouts': 'userLockouts', + 'user_notifications': 'userNotifications' + } + + def __init__(self, applications_usage=None, console_stats=None, device_notifications=None, disk_encryption=None, expired_passwords=None, failed_commands=None, failed_configurations=None, fundamentals=None, jc_university=None, learning_center=None, mdm_certificate_expirations=None, mfa_enrolled_devices=None, new_os_releases=None, new_users=None, office_hours=None, pending_commands=None, upcoming_password_expiration=None, user_lockouts=None, user_notifications=None): # noqa: E501 + """OrganizationsettingsDisplayPreferencesOrgInsights - a model defined in Swagger""" # noqa: E501 + self._applications_usage = None + self._console_stats = None + self._device_notifications = None + self._disk_encryption = None + self._expired_passwords = None + self._failed_commands = None + self._failed_configurations = None + self._fundamentals = None + self._jc_university = None + self._learning_center = None + self._mdm_certificate_expirations = None + self._mfa_enrolled_devices = None + self._new_os_releases = None + self._new_users = None + self._office_hours = None + self._pending_commands = None + self._upcoming_password_expiration = None + self._user_lockouts = None + self._user_notifications = None + self.discriminator = None + if applications_usage is not None: + self.applications_usage = applications_usage + if console_stats is not None: + self.console_stats = console_stats + if device_notifications is not None: + self.device_notifications = device_notifications + if disk_encryption is not None: + self.disk_encryption = disk_encryption + if expired_passwords is not None: + self.expired_passwords = expired_passwords + if failed_commands is not None: + self.failed_commands = failed_commands + if failed_configurations is not None: + self.failed_configurations = failed_configurations + if fundamentals is not None: + self.fundamentals = fundamentals + if jc_university is not None: + self.jc_university = jc_university + if learning_center is not None: + self.learning_center = learning_center + if mdm_certificate_expirations is not None: + self.mdm_certificate_expirations = mdm_certificate_expirations + if mfa_enrolled_devices is not None: + self.mfa_enrolled_devices = mfa_enrolled_devices + if new_os_releases is not None: + self.new_os_releases = new_os_releases + if new_users is not None: + self.new_users = new_users + if office_hours is not None: + self.office_hours = office_hours + if pending_commands is not None: + self.pending_commands = pending_commands + if upcoming_password_expiration is not None: + self.upcoming_password_expiration = upcoming_password_expiration + if user_lockouts is not None: + self.user_lockouts = user_lockouts + if user_notifications is not None: + self.user_notifications = user_notifications + + @property + def applications_usage(self): + """Gets the applications_usage of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The applications_usage of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._applications_usage + + @applications_usage.setter + def applications_usage(self, applications_usage): + """Sets the applications_usage of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param applications_usage: The applications_usage of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._applications_usage = applications_usage + + @property + def console_stats(self): + """Gets the console_stats of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The console_stats of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats + """ + return self._console_stats + + @console_stats.setter + def console_stats(self, console_stats): + """Sets the console_stats of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param console_stats: The console_stats of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats + """ + + self._console_stats = console_stats + + @property + def device_notifications(self): + """Gets the device_notifications of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The device_notifications of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications + """ + return self._device_notifications + + @device_notifications.setter + def device_notifications(self, device_notifications): + """Sets the device_notifications of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param device_notifications: The device_notifications of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications + """ + + self._device_notifications = device_notifications + + @property + def disk_encryption(self): + """Gets the disk_encryption of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The disk_encryption of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._disk_encryption + + @disk_encryption.setter + def disk_encryption(self, disk_encryption): + """Sets the disk_encryption of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param disk_encryption: The disk_encryption of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._disk_encryption = disk_encryption + + @property + def expired_passwords(self): + """Gets the expired_passwords of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The expired_passwords of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._expired_passwords + + @expired_passwords.setter + def expired_passwords(self, expired_passwords): + """Sets the expired_passwords of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param expired_passwords: The expired_passwords of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._expired_passwords = expired_passwords + + @property + def failed_commands(self): + """Gets the failed_commands of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The failed_commands of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._failed_commands + + @failed_commands.setter + def failed_commands(self, failed_commands): + """Sets the failed_commands of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param failed_commands: The failed_commands of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._failed_commands = failed_commands + + @property + def failed_configurations(self): + """Gets the failed_configurations of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The failed_configurations of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._failed_configurations + + @failed_configurations.setter + def failed_configurations(self, failed_configurations): + """Sets the failed_configurations of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param failed_configurations: The failed_configurations of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._failed_configurations = failed_configurations + + @property + def fundamentals(self): + """Gets the fundamentals of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The fundamentals of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._fundamentals + + @fundamentals.setter + def fundamentals(self, fundamentals): + """Sets the fundamentals of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param fundamentals: The fundamentals of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._fundamentals = fundamentals + + @property + def jc_university(self): + """Gets the jc_university of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The jc_university of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._jc_university + + @jc_university.setter + def jc_university(self, jc_university): + """Sets the jc_university of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param jc_university: The jc_university of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._jc_university = jc_university + + @property + def learning_center(self): + """Gets the learning_center of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The learning_center of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._learning_center + + @learning_center.setter + def learning_center(self, learning_center): + """Sets the learning_center of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param learning_center: The learning_center of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._learning_center = learning_center + + @property + def mdm_certificate_expirations(self): + """Gets the mdm_certificate_expirations of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The mdm_certificate_expirations of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._mdm_certificate_expirations + + @mdm_certificate_expirations.setter + def mdm_certificate_expirations(self, mdm_certificate_expirations): + """Sets the mdm_certificate_expirations of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param mdm_certificate_expirations: The mdm_certificate_expirations of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._mdm_certificate_expirations = mdm_certificate_expirations + + @property + def mfa_enrolled_devices(self): + """Gets the mfa_enrolled_devices of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The mfa_enrolled_devices of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._mfa_enrolled_devices + + @mfa_enrolled_devices.setter + def mfa_enrolled_devices(self, mfa_enrolled_devices): + """Sets the mfa_enrolled_devices of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param mfa_enrolled_devices: The mfa_enrolled_devices of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._mfa_enrolled_devices = mfa_enrolled_devices + + @property + def new_os_releases(self): + """Gets the new_os_releases of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The new_os_releases of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._new_os_releases + + @new_os_releases.setter + def new_os_releases(self, new_os_releases): + """Sets the new_os_releases of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param new_os_releases: The new_os_releases of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._new_os_releases = new_os_releases + + @property + def new_users(self): + """Gets the new_users of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The new_users of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._new_users + + @new_users.setter + def new_users(self, new_users): + """Sets the new_users of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param new_users: The new_users of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._new_users = new_users + + @property + def office_hours(self): + """Gets the office_hours of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The office_hours of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._office_hours + + @office_hours.setter + def office_hours(self, office_hours): + """Sets the office_hours of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param office_hours: The office_hours of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._office_hours = office_hours + + @property + def pending_commands(self): + """Gets the pending_commands of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The pending_commands of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._pending_commands + + @pending_commands.setter + def pending_commands(self, pending_commands): + """Sets the pending_commands of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param pending_commands: The pending_commands of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._pending_commands = pending_commands + + @property + def upcoming_password_expiration(self): + """Gets the upcoming_password_expiration of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The upcoming_password_expiration of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._upcoming_password_expiration + + @upcoming_password_expiration.setter + def upcoming_password_expiration(self, upcoming_password_expiration): + """Sets the upcoming_password_expiration of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param upcoming_password_expiration: The upcoming_password_expiration of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._upcoming_password_expiration = upcoming_password_expiration + + @property + def user_lockouts(self): + """Gets the user_lockouts of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The user_lockouts of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._user_lockouts + + @user_lockouts.setter + def user_lockouts(self, user_lockouts): + """Sets the user_lockouts of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param user_lockouts: The user_lockouts of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._user_lockouts = user_lockouts + + @property + def user_notifications(self): + """Gets the user_notifications of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + + + :return: The user_notifications of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications + """ + return self._user_notifications + + @user_notifications.setter + def user_notifications(self, user_notifications): + """Sets the user_notifications of this OrganizationsettingsDisplayPreferencesOrgInsights. + + + :param user_notifications: The user_notifications of this OrganizationsettingsDisplayPreferencesOrgInsights. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications + """ + + self._user_notifications = user_notifications + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationsettingsDisplayPreferencesOrgInsights, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationsettingsDisplayPreferencesOrgInsights): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights_applications_usage.py b/jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights_applications_usage.py new file mode 100644 index 0000000..2da8ea7 --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights_applications_usage.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'visible': 'bool' + } + + attribute_map = { + 'visible': 'visible' + } + + def __init__(self, visible=None): # noqa: E501 + """OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage - a model defined in Swagger""" # noqa: E501 + self._visible = None + self.discriminator = None + if visible is not None: + self.visible = visible + + @property + def visible(self): + """Gets the visible of this OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage. # noqa: E501 + + + :return: The visible of this OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage. # noqa: E501 + :rtype: bool + """ + return self._visible + + @visible.setter + def visible(self, visible): + """Sets the visible of this OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage. + + + :param visible: The visible of this OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage. # noqa: E501 + :type: bool + """ + + self._visible = visible + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights_console_stats.py b/jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights_console_stats.py new file mode 100644 index 0000000..ffe9a52 --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights_console_stats.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'total_applications': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'total_configurations': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'total_devices': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'total_groups': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'total_users': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage' + } + + attribute_map = { + 'total_applications': 'totalApplications', + 'total_configurations': 'totalConfigurations', + 'total_devices': 'totalDevices', + 'total_groups': 'totalGroups', + 'total_users': 'totalUsers' + } + + def __init__(self, total_applications=None, total_configurations=None, total_devices=None, total_groups=None, total_users=None): # noqa: E501 + """OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats - a model defined in Swagger""" # noqa: E501 + self._total_applications = None + self._total_configurations = None + self._total_devices = None + self._total_groups = None + self._total_users = None + self.discriminator = None + if total_applications is not None: + self.total_applications = total_applications + if total_configurations is not None: + self.total_configurations = total_configurations + if total_devices is not None: + self.total_devices = total_devices + if total_groups is not None: + self.total_groups = total_groups + if total_users is not None: + self.total_users = total_users + + @property + def total_applications(self): + """Gets the total_applications of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. # noqa: E501 + + + :return: The total_applications of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._total_applications + + @total_applications.setter + def total_applications(self, total_applications): + """Sets the total_applications of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. + + + :param total_applications: The total_applications of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._total_applications = total_applications + + @property + def total_configurations(self): + """Gets the total_configurations of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. # noqa: E501 + + + :return: The total_configurations of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._total_configurations + + @total_configurations.setter + def total_configurations(self, total_configurations): + """Sets the total_configurations of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. + + + :param total_configurations: The total_configurations of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._total_configurations = total_configurations + + @property + def total_devices(self): + """Gets the total_devices of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. # noqa: E501 + + + :return: The total_devices of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._total_devices + + @total_devices.setter + def total_devices(self, total_devices): + """Sets the total_devices of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. + + + :param total_devices: The total_devices of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._total_devices = total_devices + + @property + def total_groups(self): + """Gets the total_groups of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. # noqa: E501 + + + :return: The total_groups of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._total_groups + + @total_groups.setter + def total_groups(self, total_groups): + """Sets the total_groups of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. + + + :param total_groups: The total_groups of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._total_groups = total_groups + + @property + def total_users(self): + """Gets the total_users of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. # noqa: E501 + + + :return: The total_users of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._total_users + + @total_users.setter + def total_users(self, total_users): + """Sets the total_users of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. + + + :param total_users: The total_users of this OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._total_users = total_users + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights_device_notifications.py b/jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights_device_notifications.py new file mode 100644 index 0000000..fdd1f7d --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights_device_notifications.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'agent_out_of_date_metric': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'inactive_metric': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'uptime_metric': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'visible': 'bool', + 'without_policies_metric': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'without_users_metric': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage' + } + + attribute_map = { + 'agent_out_of_date_metric': 'agentOutOfDateMetric', + 'inactive_metric': 'inactiveMetric', + 'uptime_metric': 'uptimeMetric', + 'visible': 'visible', + 'without_policies_metric': 'withoutPoliciesMetric', + 'without_users_metric': 'withoutUsersMetric' + } + + def __init__(self, agent_out_of_date_metric=None, inactive_metric=None, uptime_metric=None, visible=None, without_policies_metric=None, without_users_metric=None): # noqa: E501 + """OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications - a model defined in Swagger""" # noqa: E501 + self._agent_out_of_date_metric = None + self._inactive_metric = None + self._uptime_metric = None + self._visible = None + self._without_policies_metric = None + self._without_users_metric = None + self.discriminator = None + if agent_out_of_date_metric is not None: + self.agent_out_of_date_metric = agent_out_of_date_metric + if inactive_metric is not None: + self.inactive_metric = inactive_metric + if uptime_metric is not None: + self.uptime_metric = uptime_metric + if visible is not None: + self.visible = visible + if without_policies_metric is not None: + self.without_policies_metric = without_policies_metric + if without_users_metric is not None: + self.without_users_metric = without_users_metric + + @property + def agent_out_of_date_metric(self): + """Gets the agent_out_of_date_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + + + :return: The agent_out_of_date_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._agent_out_of_date_metric + + @agent_out_of_date_metric.setter + def agent_out_of_date_metric(self, agent_out_of_date_metric): + """Sets the agent_out_of_date_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. + + + :param agent_out_of_date_metric: The agent_out_of_date_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._agent_out_of_date_metric = agent_out_of_date_metric + + @property + def inactive_metric(self): + """Gets the inactive_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + + + :return: The inactive_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._inactive_metric + + @inactive_metric.setter + def inactive_metric(self, inactive_metric): + """Sets the inactive_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. + + + :param inactive_metric: The inactive_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._inactive_metric = inactive_metric + + @property + def uptime_metric(self): + """Gets the uptime_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + + + :return: The uptime_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._uptime_metric + + @uptime_metric.setter + def uptime_metric(self, uptime_metric): + """Sets the uptime_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. + + + :param uptime_metric: The uptime_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._uptime_metric = uptime_metric + + @property + def visible(self): + """Gets the visible of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + + + :return: The visible of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + :rtype: bool + """ + return self._visible + + @visible.setter + def visible(self, visible): + """Sets the visible of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. + + + :param visible: The visible of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + :type: bool + """ + + self._visible = visible + + @property + def without_policies_metric(self): + """Gets the without_policies_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + + + :return: The without_policies_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._without_policies_metric + + @without_policies_metric.setter + def without_policies_metric(self, without_policies_metric): + """Sets the without_policies_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. + + + :param without_policies_metric: The without_policies_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._without_policies_metric = without_policies_metric + + @property + def without_users_metric(self): + """Gets the without_users_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + + + :return: The without_users_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._without_users_metric + + @without_users_metric.setter + def without_users_metric(self, without_users_metric): + """Sets the without_users_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. + + + :param without_users_metric: The without_users_metric of this OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._without_users_metric = without_users_metric + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights_user_notifications.py b/jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights_user_notifications.py new file mode 100644 index 0000000..cbabc6c --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationsettings_display_preferences_org_insights_user_notifications.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'user_with_admin_sudo_passwordless_access': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'users_with_admin_sudo_access': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'users_with_samba_access': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'users_without_devices': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'users_without_password': 'OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage', + 'visible': 'bool' + } + + attribute_map = { + 'user_with_admin_sudo_passwordless_access': 'userWithAdminSudoPasswordlessAccess', + 'users_with_admin_sudo_access': 'usersWithAdminSudoAccess', + 'users_with_samba_access': 'usersWithSambaAccess', + 'users_without_devices': 'usersWithoutDevices', + 'users_without_password': 'usersWithoutPassword', + 'visible': 'visible' + } + + def __init__(self, user_with_admin_sudo_passwordless_access=None, users_with_admin_sudo_access=None, users_with_samba_access=None, users_without_devices=None, users_without_password=None, visible=None): # noqa: E501 + """OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications - a model defined in Swagger""" # noqa: E501 + self._user_with_admin_sudo_passwordless_access = None + self._users_with_admin_sudo_access = None + self._users_with_samba_access = None + self._users_without_devices = None + self._users_without_password = None + self._visible = None + self.discriminator = None + if user_with_admin_sudo_passwordless_access is not None: + self.user_with_admin_sudo_passwordless_access = user_with_admin_sudo_passwordless_access + if users_with_admin_sudo_access is not None: + self.users_with_admin_sudo_access = users_with_admin_sudo_access + if users_with_samba_access is not None: + self.users_with_samba_access = users_with_samba_access + if users_without_devices is not None: + self.users_without_devices = users_without_devices + if users_without_password is not None: + self.users_without_password = users_without_password + if visible is not None: + self.visible = visible + + @property + def user_with_admin_sudo_passwordless_access(self): + """Gets the user_with_admin_sudo_passwordless_access of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + + + :return: The user_with_admin_sudo_passwordless_access of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._user_with_admin_sudo_passwordless_access + + @user_with_admin_sudo_passwordless_access.setter + def user_with_admin_sudo_passwordless_access(self, user_with_admin_sudo_passwordless_access): + """Sets the user_with_admin_sudo_passwordless_access of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. + + + :param user_with_admin_sudo_passwordless_access: The user_with_admin_sudo_passwordless_access of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._user_with_admin_sudo_passwordless_access = user_with_admin_sudo_passwordless_access + + @property + def users_with_admin_sudo_access(self): + """Gets the users_with_admin_sudo_access of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + + + :return: The users_with_admin_sudo_access of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._users_with_admin_sudo_access + + @users_with_admin_sudo_access.setter + def users_with_admin_sudo_access(self, users_with_admin_sudo_access): + """Sets the users_with_admin_sudo_access of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. + + + :param users_with_admin_sudo_access: The users_with_admin_sudo_access of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._users_with_admin_sudo_access = users_with_admin_sudo_access + + @property + def users_with_samba_access(self): + """Gets the users_with_samba_access of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + + + :return: The users_with_samba_access of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._users_with_samba_access + + @users_with_samba_access.setter + def users_with_samba_access(self, users_with_samba_access): + """Sets the users_with_samba_access of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. + + + :param users_with_samba_access: The users_with_samba_access of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._users_with_samba_access = users_with_samba_access + + @property + def users_without_devices(self): + """Gets the users_without_devices of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + + + :return: The users_without_devices of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._users_without_devices + + @users_without_devices.setter + def users_without_devices(self, users_without_devices): + """Sets the users_without_devices of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. + + + :param users_without_devices: The users_without_devices of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._users_without_devices = users_without_devices + + @property + def users_without_password(self): + """Gets the users_without_password of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + + + :return: The users_without_password of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + :rtype: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + return self._users_without_password + + @users_without_password.setter + def users_without_password(self, users_without_password): + """Sets the users_without_password of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. + + + :param users_without_password: The users_without_password of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + :type: OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + """ + + self._users_without_password = users_without_password + + @property + def visible(self): + """Gets the visible of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + + + :return: The visible of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + :rtype: bool + """ + return self._visible + + @visible.setter + def visible(self, visible): + """Sets the visible of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. + + + :param visible: The visible of this OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications. # noqa: E501 + :type: bool + """ + + self._visible = visible + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationsettings_features.py b/jcapiv1/jcapiv1/models/organizationsettings_features.py new file mode 100644 index 0000000..a02f3c3 --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationsettings_features.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationsettingsFeatures(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'directory_insights': 'OrganizationsettingsFeaturesDirectoryInsights', + 'directory_insights_premium': 'OrganizationsettingsFeaturesDirectoryInsightsPremium', + 'system_insights': 'OrganizationsettingsFeaturesSystemInsights' + } + + attribute_map = { + 'directory_insights': 'directoryInsights', + 'directory_insights_premium': 'directoryInsightsPremium', + 'system_insights': 'systemInsights' + } + + def __init__(self, directory_insights=None, directory_insights_premium=None, system_insights=None): # noqa: E501 + """OrganizationsettingsFeatures - a model defined in Swagger""" # noqa: E501 + self._directory_insights = None + self._directory_insights_premium = None + self._system_insights = None + self.discriminator = None + if directory_insights is not None: + self.directory_insights = directory_insights + if directory_insights_premium is not None: + self.directory_insights_premium = directory_insights_premium + if system_insights is not None: + self.system_insights = system_insights + + @property + def directory_insights(self): + """Gets the directory_insights of this OrganizationsettingsFeatures. # noqa: E501 + + + :return: The directory_insights of this OrganizationsettingsFeatures. # noqa: E501 + :rtype: OrganizationsettingsFeaturesDirectoryInsights + """ + return self._directory_insights + + @directory_insights.setter + def directory_insights(self, directory_insights): + """Sets the directory_insights of this OrganizationsettingsFeatures. + + + :param directory_insights: The directory_insights of this OrganizationsettingsFeatures. # noqa: E501 + :type: OrganizationsettingsFeaturesDirectoryInsights + """ + + self._directory_insights = directory_insights + + @property + def directory_insights_premium(self): + """Gets the directory_insights_premium of this OrganizationsettingsFeatures. # noqa: E501 + + + :return: The directory_insights_premium of this OrganizationsettingsFeatures. # noqa: E501 + :rtype: OrganizationsettingsFeaturesDirectoryInsightsPremium + """ + return self._directory_insights_premium + + @directory_insights_premium.setter + def directory_insights_premium(self, directory_insights_premium): + """Sets the directory_insights_premium of this OrganizationsettingsFeatures. + + + :param directory_insights_premium: The directory_insights_premium of this OrganizationsettingsFeatures. # noqa: E501 + :type: OrganizationsettingsFeaturesDirectoryInsightsPremium + """ + + self._directory_insights_premium = directory_insights_premium + + @property + def system_insights(self): + """Gets the system_insights of this OrganizationsettingsFeatures. # noqa: E501 + + + :return: The system_insights of this OrganizationsettingsFeatures. # noqa: E501 + :rtype: OrganizationsettingsFeaturesSystemInsights + """ + return self._system_insights + + @system_insights.setter + def system_insights(self, system_insights): + """Sets the system_insights of this OrganizationsettingsFeatures. + + + :param system_insights: The system_insights of this OrganizationsettingsFeatures. # noqa: E501 + :type: OrganizationsettingsFeaturesSystemInsights + """ + + self._system_insights = system_insights + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationsettingsFeatures, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationsettingsFeatures): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationsettings_features_directory_insights.py b/jcapiv1/jcapiv1/models/organizationsettings_features_directory_insights.py new file mode 100644 index 0000000..f268846 --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationsettings_features_directory_insights.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationsettingsFeaturesDirectoryInsights(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'enabled': 'bool' + } + + attribute_map = { + 'enabled': 'enabled' + } + + def __init__(self, enabled=None): # noqa: E501 + """OrganizationsettingsFeaturesDirectoryInsights - a model defined in Swagger""" # noqa: E501 + self._enabled = None + self.discriminator = None + if enabled is not None: + self.enabled = enabled + + @property + def enabled(self): + """Gets the enabled of this OrganizationsettingsFeaturesDirectoryInsights. # noqa: E501 + + + :return: The enabled of this OrganizationsettingsFeaturesDirectoryInsights. # noqa: E501 + :rtype: bool + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled): + """Sets the enabled of this OrganizationsettingsFeaturesDirectoryInsights. + + + :param enabled: The enabled of this OrganizationsettingsFeaturesDirectoryInsights. # noqa: E501 + :type: bool + """ + + self._enabled = enabled + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationsettingsFeaturesDirectoryInsights, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationsettingsFeaturesDirectoryInsights): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationsettings_features_directory_insights_premium.py b/jcapiv1/jcapiv1/models/organizationsettings_features_directory_insights_premium.py new file mode 100644 index 0000000..6ff9cad --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationsettings_features_directory_insights_premium.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationsettingsFeaturesDirectoryInsightsPremium(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'str', + 'enabled': 'bool', + 'updated_at': 'str' + } + + attribute_map = { + 'created_at': 'createdAt', + 'enabled': 'enabled', + 'updated_at': 'updatedAt' + } + + def __init__(self, created_at=None, enabled=None, updated_at=None): # noqa: E501 + """OrganizationsettingsFeaturesDirectoryInsightsPremium - a model defined in Swagger""" # noqa: E501 + self._created_at = None + self._enabled = None + self._updated_at = None + self.discriminator = None + if created_at is not None: + self.created_at = created_at + if enabled is not None: + self.enabled = enabled + if updated_at is not None: + self.updated_at = updated_at + + @property + def created_at(self): + """Gets the created_at of this OrganizationsettingsFeaturesDirectoryInsightsPremium. # noqa: E501 + + + :return: The created_at of this OrganizationsettingsFeaturesDirectoryInsightsPremium. # noqa: E501 + :rtype: str + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this OrganizationsettingsFeaturesDirectoryInsightsPremium. + + + :param created_at: The created_at of this OrganizationsettingsFeaturesDirectoryInsightsPremium. # noqa: E501 + :type: str + """ + + self._created_at = created_at + + @property + def enabled(self): + """Gets the enabled of this OrganizationsettingsFeaturesDirectoryInsightsPremium. # noqa: E501 + + + :return: The enabled of this OrganizationsettingsFeaturesDirectoryInsightsPremium. # noqa: E501 + :rtype: bool + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled): + """Sets the enabled of this OrganizationsettingsFeaturesDirectoryInsightsPremium. + + + :param enabled: The enabled of this OrganizationsettingsFeaturesDirectoryInsightsPremium. # noqa: E501 + :type: bool + """ + + self._enabled = enabled + + @property + def updated_at(self): + """Gets the updated_at of this OrganizationsettingsFeaturesDirectoryInsightsPremium. # noqa: E501 + + + :return: The updated_at of this OrganizationsettingsFeaturesDirectoryInsightsPremium. # noqa: E501 + :rtype: str + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this OrganizationsettingsFeaturesDirectoryInsightsPremium. + + + :param updated_at: The updated_at of this OrganizationsettingsFeaturesDirectoryInsightsPremium. # noqa: E501 + :type: str + """ + + self._updated_at = updated_at + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationsettingsFeaturesDirectoryInsightsPremium, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationsettingsFeaturesDirectoryInsightsPremium): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationsettings_features_system_insights.py b/jcapiv1/jcapiv1/models/organizationsettings_features_system_insights.py new file mode 100644 index 0000000..8d70874 --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationsettings_features_system_insights.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationsettingsFeaturesSystemInsights(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'str', + 'enable_new_darwin': 'bool', + 'enable_new_linux': 'bool', + 'enable_new_windows': 'bool', + 'enabled': 'bool', + 'updated_at': 'str' + } + + attribute_map = { + 'created_at': 'createdAt', + 'enable_new_darwin': 'enableNewDarwin', + 'enable_new_linux': 'enableNewLinux', + 'enable_new_windows': 'enableNewWindows', + 'enabled': 'enabled', + 'updated_at': 'updatedAt' + } + + def __init__(self, created_at=None, enable_new_darwin=None, enable_new_linux=None, enable_new_windows=None, enabled=None, updated_at=None): # noqa: E501 + """OrganizationsettingsFeaturesSystemInsights - a model defined in Swagger""" # noqa: E501 + self._created_at = None + self._enable_new_darwin = None + self._enable_new_linux = None + self._enable_new_windows = None + self._enabled = None + self._updated_at = None + self.discriminator = None + if created_at is not None: + self.created_at = created_at + if enable_new_darwin is not None: + self.enable_new_darwin = enable_new_darwin + if enable_new_linux is not None: + self.enable_new_linux = enable_new_linux + if enable_new_windows is not None: + self.enable_new_windows = enable_new_windows + if enabled is not None: + self.enabled = enabled + if updated_at is not None: + self.updated_at = updated_at + + @property + def created_at(self): + """Gets the created_at of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + + + :return: The created_at of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + :rtype: str + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this OrganizationsettingsFeaturesSystemInsights. + + + :param created_at: The created_at of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + :type: str + """ + + self._created_at = created_at + + @property + def enable_new_darwin(self): + """Gets the enable_new_darwin of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + + + :return: The enable_new_darwin of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + :rtype: bool + """ + return self._enable_new_darwin + + @enable_new_darwin.setter + def enable_new_darwin(self, enable_new_darwin): + """Sets the enable_new_darwin of this OrganizationsettingsFeaturesSystemInsights. + + + :param enable_new_darwin: The enable_new_darwin of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + :type: bool + """ + + self._enable_new_darwin = enable_new_darwin + + @property + def enable_new_linux(self): + """Gets the enable_new_linux of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + + + :return: The enable_new_linux of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + :rtype: bool + """ + return self._enable_new_linux + + @enable_new_linux.setter + def enable_new_linux(self, enable_new_linux): + """Sets the enable_new_linux of this OrganizationsettingsFeaturesSystemInsights. + + + :param enable_new_linux: The enable_new_linux of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + :type: bool + """ + + self._enable_new_linux = enable_new_linux + + @property + def enable_new_windows(self): + """Gets the enable_new_windows of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + + + :return: The enable_new_windows of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + :rtype: bool + """ + return self._enable_new_windows + + @enable_new_windows.setter + def enable_new_windows(self, enable_new_windows): + """Sets the enable_new_windows of this OrganizationsettingsFeaturesSystemInsights. + + + :param enable_new_windows: The enable_new_windows of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + :type: bool + """ + + self._enable_new_windows = enable_new_windows + + @property + def enabled(self): + """Gets the enabled of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + + + :return: The enabled of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + :rtype: bool + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled): + """Sets the enabled of this OrganizationsettingsFeaturesSystemInsights. + + + :param enabled: The enabled of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + :type: bool + """ + + self._enabled = enabled + + @property + def updated_at(self): + """Gets the updated_at of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + + + :return: The updated_at of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + :rtype: str + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this OrganizationsettingsFeaturesSystemInsights. + + + :param updated_at: The updated_at of this OrganizationsettingsFeaturesSystemInsights. # noqa: E501 + :type: str + """ + + self._updated_at = updated_at + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationsettingsFeaturesSystemInsights, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationsettingsFeaturesSystemInsights): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationsettings_new_system_user_state_defaults.py b/jcapiv1/jcapiv1/models/organizationsettings_new_system_user_state_defaults.py new file mode 100644 index 0000000..fef7ce0 --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationsettings_new_system_user_state_defaults.py @@ -0,0 +1,186 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationsettingsNewSystemUserStateDefaults(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'application_import': 'str', + 'csv_import': 'str', + 'manual_entry': 'str' + } + + attribute_map = { + 'application_import': 'applicationImport', + 'csv_import': 'csvImport', + 'manual_entry': 'manualEntry' + } + + def __init__(self, application_import=None, csv_import=None, manual_entry=None): # noqa: E501 + """OrganizationsettingsNewSystemUserStateDefaults - a model defined in Swagger""" # noqa: E501 + self._application_import = None + self._csv_import = None + self._manual_entry = None + self.discriminator = None + if application_import is not None: + self.application_import = application_import + if csv_import is not None: + self.csv_import = csv_import + if manual_entry is not None: + self.manual_entry = manual_entry + + @property + def application_import(self): + """Gets the application_import of this OrganizationsettingsNewSystemUserStateDefaults. # noqa: E501 + + The default user state for a user created using the [Bulk Users Create](https://docs.jumpcloud.com/api/2.0/index.html#operation/bulk_usersCreate) endpoint. See endpoint documentation for more details. # noqa: E501 + + :return: The application_import of this OrganizationsettingsNewSystemUserStateDefaults. # noqa: E501 + :rtype: str + """ + return self._application_import + + @application_import.setter + def application_import(self, application_import): + """Sets the application_import of this OrganizationsettingsNewSystemUserStateDefaults. + + The default user state for a user created using the [Bulk Users Create](https://docs.jumpcloud.com/api/2.0/index.html#operation/bulk_usersCreate) endpoint. See endpoint documentation for more details. # noqa: E501 + + :param application_import: The application_import of this OrganizationsettingsNewSystemUserStateDefaults. # noqa: E501 + :type: str + """ + allowed_values = ["ACTIVATED", "STAGED"] # noqa: E501 + if application_import not in allowed_values: + raise ValueError( + "Invalid value for `application_import` ({0}), must be one of {1}" # noqa: E501 + .format(application_import, allowed_values) + ) + + self._application_import = application_import + + @property + def csv_import(self): + """Gets the csv_import of this OrganizationsettingsNewSystemUserStateDefaults. # noqa: E501 + + The default user state for a user created using the [Bulk Users Create](https://docs.jumpcloud.com/api/2.0/index.html#operation/bulk_usersCreate) endpoint. See endpoint documentation for more details. # noqa: E501 + + :return: The csv_import of this OrganizationsettingsNewSystemUserStateDefaults. # noqa: E501 + :rtype: str + """ + return self._csv_import + + @csv_import.setter + def csv_import(self, csv_import): + """Sets the csv_import of this OrganizationsettingsNewSystemUserStateDefaults. + + The default user state for a user created using the [Bulk Users Create](https://docs.jumpcloud.com/api/2.0/index.html#operation/bulk_usersCreate) endpoint. See endpoint documentation for more details. # noqa: E501 + + :param csv_import: The csv_import of this OrganizationsettingsNewSystemUserStateDefaults. # noqa: E501 + :type: str + """ + allowed_values = ["ACTIVATED", "STAGED"] # noqa: E501 + if csv_import not in allowed_values: + raise ValueError( + "Invalid value for `csv_import` ({0}), must be one of {1}" # noqa: E501 + .format(csv_import, allowed_values) + ) + + self._csv_import = csv_import + + @property + def manual_entry(self): + """Gets the manual_entry of this OrganizationsettingsNewSystemUserStateDefaults. # noqa: E501 + + The default state for a user that is created using the [Create a system user](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_post) endpoint. See endpoint documentation for more details. # noqa: E501 + + :return: The manual_entry of this OrganizationsettingsNewSystemUserStateDefaults. # noqa: E501 + :rtype: str + """ + return self._manual_entry + + @manual_entry.setter + def manual_entry(self, manual_entry): + """Sets the manual_entry of this OrganizationsettingsNewSystemUserStateDefaults. + + The default state for a user that is created using the [Create a system user](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_post) endpoint. See endpoint documentation for more details. # noqa: E501 + + :param manual_entry: The manual_entry of this OrganizationsettingsNewSystemUserStateDefaults. # noqa: E501 + :type: str + """ + allowed_values = ["ACTIVATED", "STAGED"] # noqa: E501 + if manual_entry not in allowed_values: + raise ValueError( + "Invalid value for `manual_entry` ({0}), must be one of {1}" # noqa: E501 + .format(manual_entry, allowed_values) + ) + + self._manual_entry = manual_entry + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationsettingsNewSystemUserStateDefaults, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationsettingsNewSystemUserStateDefaults): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationsettings_password_policy.py b/jcapiv1/jcapiv1/models/organizationsettings_password_policy.py new file mode 100644 index 0000000..9710fcb --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationsettings_password_policy.py @@ -0,0 +1,762 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationsettingsPasswordPolicy(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'allow_username_substring': 'bool', + 'days_after_expiration_to_self_recover': 'int', + 'days_before_expiration_to_force_reset': 'int', + 'effective_date': 'str', + 'enable_days_after_expiration_to_self_recover': 'bool', + 'enable_days_before_expiration_to_force_reset': 'bool', + 'enable_lockout_time_in_seconds': 'bool', + 'enable_max_history': 'bool', + 'enable_max_login_attempts': 'bool', + 'enable_min_change_period_in_days': 'bool', + 'enable_min_length': 'bool', + 'enable_password_expiration_in_days': 'bool', + 'enable_recovery_email': 'bool', + 'enable_reset_lockout_counter': 'bool', + 'grace_period_date': 'str', + 'lockout_time_in_seconds': 'int', + 'max_history': 'int', + 'max_login_attempts': 'int', + 'min_change_period_in_days': 'int', + 'min_length': 'int', + 'needs_lowercase': 'bool', + 'needs_numeric': 'bool', + 'needs_symbolic': 'bool', + 'needs_uppercase': 'bool', + 'password_expiration_in_days': 'int', + 'reset_lockout_counter_minutes': 'int' + } + + attribute_map = { + 'allow_username_substring': 'allowUsernameSubstring', + 'days_after_expiration_to_self_recover': 'daysAfterExpirationToSelfRecover', + 'days_before_expiration_to_force_reset': 'daysBeforeExpirationToForceReset', + 'effective_date': 'effectiveDate', + 'enable_days_after_expiration_to_self_recover': 'enableDaysAfterExpirationToSelfRecover', + 'enable_days_before_expiration_to_force_reset': 'enableDaysBeforeExpirationToForceReset', + 'enable_lockout_time_in_seconds': 'enableLockoutTimeInSeconds', + 'enable_max_history': 'enableMaxHistory', + 'enable_max_login_attempts': 'enableMaxLoginAttempts', + 'enable_min_change_period_in_days': 'enableMinChangePeriodInDays', + 'enable_min_length': 'enableMinLength', + 'enable_password_expiration_in_days': 'enablePasswordExpirationInDays', + 'enable_recovery_email': 'enableRecoveryEmail', + 'enable_reset_lockout_counter': 'enableResetLockoutCounter', + 'grace_period_date': 'gracePeriodDate', + 'lockout_time_in_seconds': 'lockoutTimeInSeconds', + 'max_history': 'maxHistory', + 'max_login_attempts': 'maxLoginAttempts', + 'min_change_period_in_days': 'minChangePeriodInDays', + 'min_length': 'minLength', + 'needs_lowercase': 'needsLowercase', + 'needs_numeric': 'needsNumeric', + 'needs_symbolic': 'needsSymbolic', + 'needs_uppercase': 'needsUppercase', + 'password_expiration_in_days': 'passwordExpirationInDays', + 'reset_lockout_counter_minutes': 'resetLockoutCounterMinutes' + } + + def __init__(self, allow_username_substring=None, days_after_expiration_to_self_recover=None, days_before_expiration_to_force_reset=None, effective_date=None, enable_days_after_expiration_to_self_recover=None, enable_days_before_expiration_to_force_reset=None, enable_lockout_time_in_seconds=None, enable_max_history=None, enable_max_login_attempts=None, enable_min_change_period_in_days=None, enable_min_length=None, enable_password_expiration_in_days=None, enable_recovery_email=None, enable_reset_lockout_counter=None, grace_period_date=None, lockout_time_in_seconds=None, max_history=None, max_login_attempts=None, min_change_period_in_days=None, min_length=None, needs_lowercase=None, needs_numeric=None, needs_symbolic=None, needs_uppercase=None, password_expiration_in_days=None, reset_lockout_counter_minutes=None): # noqa: E501 + """OrganizationsettingsPasswordPolicy - a model defined in Swagger""" # noqa: E501 + self._allow_username_substring = None + self._days_after_expiration_to_self_recover = None + self._days_before_expiration_to_force_reset = None + self._effective_date = None + self._enable_days_after_expiration_to_self_recover = None + self._enable_days_before_expiration_to_force_reset = None + self._enable_lockout_time_in_seconds = None + self._enable_max_history = None + self._enable_max_login_attempts = None + self._enable_min_change_period_in_days = None + self._enable_min_length = None + self._enable_password_expiration_in_days = None + self._enable_recovery_email = None + self._enable_reset_lockout_counter = None + self._grace_period_date = None + self._lockout_time_in_seconds = None + self._max_history = None + self._max_login_attempts = None + self._min_change_period_in_days = None + self._min_length = None + self._needs_lowercase = None + self._needs_numeric = None + self._needs_symbolic = None + self._needs_uppercase = None + self._password_expiration_in_days = None + self._reset_lockout_counter_minutes = None + self.discriminator = None + if allow_username_substring is not None: + self.allow_username_substring = allow_username_substring + if days_after_expiration_to_self_recover is not None: + self.days_after_expiration_to_self_recover = days_after_expiration_to_self_recover + if days_before_expiration_to_force_reset is not None: + self.days_before_expiration_to_force_reset = days_before_expiration_to_force_reset + if effective_date is not None: + self.effective_date = effective_date + if enable_days_after_expiration_to_self_recover is not None: + self.enable_days_after_expiration_to_self_recover = enable_days_after_expiration_to_self_recover + if enable_days_before_expiration_to_force_reset is not None: + self.enable_days_before_expiration_to_force_reset = enable_days_before_expiration_to_force_reset + if enable_lockout_time_in_seconds is not None: + self.enable_lockout_time_in_seconds = enable_lockout_time_in_seconds + if enable_max_history is not None: + self.enable_max_history = enable_max_history + if enable_max_login_attempts is not None: + self.enable_max_login_attempts = enable_max_login_attempts + if enable_min_change_period_in_days is not None: + self.enable_min_change_period_in_days = enable_min_change_period_in_days + if enable_min_length is not None: + self.enable_min_length = enable_min_length + if enable_password_expiration_in_days is not None: + self.enable_password_expiration_in_days = enable_password_expiration_in_days + if enable_recovery_email is not None: + self.enable_recovery_email = enable_recovery_email + if enable_reset_lockout_counter is not None: + self.enable_reset_lockout_counter = enable_reset_lockout_counter + if grace_period_date is not None: + self.grace_period_date = grace_period_date + if lockout_time_in_seconds is not None: + self.lockout_time_in_seconds = lockout_time_in_seconds + if max_history is not None: + self.max_history = max_history + if max_login_attempts is not None: + self.max_login_attempts = max_login_attempts + if min_change_period_in_days is not None: + self.min_change_period_in_days = min_change_period_in_days + if min_length is not None: + self.min_length = min_length + if needs_lowercase is not None: + self.needs_lowercase = needs_lowercase + if needs_numeric is not None: + self.needs_numeric = needs_numeric + if needs_symbolic is not None: + self.needs_symbolic = needs_symbolic + if needs_uppercase is not None: + self.needs_uppercase = needs_uppercase + if password_expiration_in_days is not None: + self.password_expiration_in_days = password_expiration_in_days + if reset_lockout_counter_minutes is not None: + self.reset_lockout_counter_minutes = reset_lockout_counter_minutes + + @property + def allow_username_substring(self): + """Gets the allow_username_substring of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The allow_username_substring of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._allow_username_substring + + @allow_username_substring.setter + def allow_username_substring(self, allow_username_substring): + """Sets the allow_username_substring of this OrganizationsettingsPasswordPolicy. + + + :param allow_username_substring: The allow_username_substring of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._allow_username_substring = allow_username_substring + + @property + def days_after_expiration_to_self_recover(self): + """Gets the days_after_expiration_to_self_recover of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + Deprecated field used for the legacy grace period feature. # noqa: E501 + + :return: The days_after_expiration_to_self_recover of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: int + """ + return self._days_after_expiration_to_self_recover + + @days_after_expiration_to_self_recover.setter + def days_after_expiration_to_self_recover(self, days_after_expiration_to_self_recover): + """Sets the days_after_expiration_to_self_recover of this OrganizationsettingsPasswordPolicy. + + Deprecated field used for the legacy grace period feature. # noqa: E501 + + :param days_after_expiration_to_self_recover: The days_after_expiration_to_self_recover of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: int + """ + + self._days_after_expiration_to_self_recover = days_after_expiration_to_self_recover + + @property + def days_before_expiration_to_force_reset(self): + """Gets the days_before_expiration_to_force_reset of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The days_before_expiration_to_force_reset of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: int + """ + return self._days_before_expiration_to_force_reset + + @days_before_expiration_to_force_reset.setter + def days_before_expiration_to_force_reset(self, days_before_expiration_to_force_reset): + """Sets the days_before_expiration_to_force_reset of this OrganizationsettingsPasswordPolicy. + + + :param days_before_expiration_to_force_reset: The days_before_expiration_to_force_reset of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: int + """ + + self._days_before_expiration_to_force_reset = days_before_expiration_to_force_reset + + @property + def effective_date(self): + """Gets the effective_date of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The effective_date of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: str + """ + return self._effective_date + + @effective_date.setter + def effective_date(self, effective_date): + """Sets the effective_date of this OrganizationsettingsPasswordPolicy. + + + :param effective_date: The effective_date of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: str + """ + + self._effective_date = effective_date + + @property + def enable_days_after_expiration_to_self_recover(self): + """Gets the enable_days_after_expiration_to_self_recover of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The enable_days_after_expiration_to_self_recover of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_days_after_expiration_to_self_recover + + @enable_days_after_expiration_to_self_recover.setter + def enable_days_after_expiration_to_self_recover(self, enable_days_after_expiration_to_self_recover): + """Sets the enable_days_after_expiration_to_self_recover of this OrganizationsettingsPasswordPolicy. + + + :param enable_days_after_expiration_to_self_recover: The enable_days_after_expiration_to_self_recover of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_days_after_expiration_to_self_recover = enable_days_after_expiration_to_self_recover + + @property + def enable_days_before_expiration_to_force_reset(self): + """Gets the enable_days_before_expiration_to_force_reset of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The enable_days_before_expiration_to_force_reset of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_days_before_expiration_to_force_reset + + @enable_days_before_expiration_to_force_reset.setter + def enable_days_before_expiration_to_force_reset(self, enable_days_before_expiration_to_force_reset): + """Sets the enable_days_before_expiration_to_force_reset of this OrganizationsettingsPasswordPolicy. + + + :param enable_days_before_expiration_to_force_reset: The enable_days_before_expiration_to_force_reset of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_days_before_expiration_to_force_reset = enable_days_before_expiration_to_force_reset + + @property + def enable_lockout_time_in_seconds(self): + """Gets the enable_lockout_time_in_seconds of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The enable_lockout_time_in_seconds of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_lockout_time_in_seconds + + @enable_lockout_time_in_seconds.setter + def enable_lockout_time_in_seconds(self, enable_lockout_time_in_seconds): + """Sets the enable_lockout_time_in_seconds of this OrganizationsettingsPasswordPolicy. + + + :param enable_lockout_time_in_seconds: The enable_lockout_time_in_seconds of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_lockout_time_in_seconds = enable_lockout_time_in_seconds + + @property + def enable_max_history(self): + """Gets the enable_max_history of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The enable_max_history of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_max_history + + @enable_max_history.setter + def enable_max_history(self, enable_max_history): + """Sets the enable_max_history of this OrganizationsettingsPasswordPolicy. + + + :param enable_max_history: The enable_max_history of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_max_history = enable_max_history + + @property + def enable_max_login_attempts(self): + """Gets the enable_max_login_attempts of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The enable_max_login_attempts of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_max_login_attempts + + @enable_max_login_attempts.setter + def enable_max_login_attempts(self, enable_max_login_attempts): + """Sets the enable_max_login_attempts of this OrganizationsettingsPasswordPolicy. + + + :param enable_max_login_attempts: The enable_max_login_attempts of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_max_login_attempts = enable_max_login_attempts + + @property + def enable_min_change_period_in_days(self): + """Gets the enable_min_change_period_in_days of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The enable_min_change_period_in_days of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_min_change_period_in_days + + @enable_min_change_period_in_days.setter + def enable_min_change_period_in_days(self, enable_min_change_period_in_days): + """Sets the enable_min_change_period_in_days of this OrganizationsettingsPasswordPolicy. + + + :param enable_min_change_period_in_days: The enable_min_change_period_in_days of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_min_change_period_in_days = enable_min_change_period_in_days + + @property + def enable_min_length(self): + """Gets the enable_min_length of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The enable_min_length of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_min_length + + @enable_min_length.setter + def enable_min_length(self, enable_min_length): + """Sets the enable_min_length of this OrganizationsettingsPasswordPolicy. + + + :param enable_min_length: The enable_min_length of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_min_length = enable_min_length + + @property + def enable_password_expiration_in_days(self): + """Gets the enable_password_expiration_in_days of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The enable_password_expiration_in_days of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_password_expiration_in_days + + @enable_password_expiration_in_days.setter + def enable_password_expiration_in_days(self, enable_password_expiration_in_days): + """Sets the enable_password_expiration_in_days of this OrganizationsettingsPasswordPolicy. + + + :param enable_password_expiration_in_days: The enable_password_expiration_in_days of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_password_expiration_in_days = enable_password_expiration_in_days + + @property + def enable_recovery_email(self): + """Gets the enable_recovery_email of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The enable_recovery_email of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_recovery_email + + @enable_recovery_email.setter + def enable_recovery_email(self, enable_recovery_email): + """Sets the enable_recovery_email of this OrganizationsettingsPasswordPolicy. + + + :param enable_recovery_email: The enable_recovery_email of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_recovery_email = enable_recovery_email + + @property + def enable_reset_lockout_counter(self): + """Gets the enable_reset_lockout_counter of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The enable_reset_lockout_counter of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_reset_lockout_counter + + @enable_reset_lockout_counter.setter + def enable_reset_lockout_counter(self, enable_reset_lockout_counter): + """Sets the enable_reset_lockout_counter of this OrganizationsettingsPasswordPolicy. + + + :param enable_reset_lockout_counter: The enable_reset_lockout_counter of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_reset_lockout_counter = enable_reset_lockout_counter + + @property + def grace_period_date(self): + """Gets the grace_period_date of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The grace_period_date of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: str + """ + return self._grace_period_date + + @grace_period_date.setter + def grace_period_date(self, grace_period_date): + """Sets the grace_period_date of this OrganizationsettingsPasswordPolicy. + + + :param grace_period_date: The grace_period_date of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: str + """ + + self._grace_period_date = grace_period_date + + @property + def lockout_time_in_seconds(self): + """Gets the lockout_time_in_seconds of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The lockout_time_in_seconds of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: int + """ + return self._lockout_time_in_seconds + + @lockout_time_in_seconds.setter + def lockout_time_in_seconds(self, lockout_time_in_seconds): + """Sets the lockout_time_in_seconds of this OrganizationsettingsPasswordPolicy. + + + :param lockout_time_in_seconds: The lockout_time_in_seconds of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: int + """ + + self._lockout_time_in_seconds = lockout_time_in_seconds + + @property + def max_history(self): + """Gets the max_history of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The max_history of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: int + """ + return self._max_history + + @max_history.setter + def max_history(self, max_history): + """Sets the max_history of this OrganizationsettingsPasswordPolicy. + + + :param max_history: The max_history of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: int + """ + + self._max_history = max_history + + @property + def max_login_attempts(self): + """Gets the max_login_attempts of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The max_login_attempts of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: int + """ + return self._max_login_attempts + + @max_login_attempts.setter + def max_login_attempts(self, max_login_attempts): + """Sets the max_login_attempts of this OrganizationsettingsPasswordPolicy. + + + :param max_login_attempts: The max_login_attempts of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: int + """ + + self._max_login_attempts = max_login_attempts + + @property + def min_change_period_in_days(self): + """Gets the min_change_period_in_days of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The min_change_period_in_days of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: int + """ + return self._min_change_period_in_days + + @min_change_period_in_days.setter + def min_change_period_in_days(self, min_change_period_in_days): + """Sets the min_change_period_in_days of this OrganizationsettingsPasswordPolicy. + + + :param min_change_period_in_days: The min_change_period_in_days of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: int + """ + + self._min_change_period_in_days = min_change_period_in_days + + @property + def min_length(self): + """Gets the min_length of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The min_length of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: int + """ + return self._min_length + + @min_length.setter + def min_length(self, min_length): + """Sets the min_length of this OrganizationsettingsPasswordPolicy. + + + :param min_length: The min_length of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: int + """ + + self._min_length = min_length + + @property + def needs_lowercase(self): + """Gets the needs_lowercase of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The needs_lowercase of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._needs_lowercase + + @needs_lowercase.setter + def needs_lowercase(self, needs_lowercase): + """Sets the needs_lowercase of this OrganizationsettingsPasswordPolicy. + + + :param needs_lowercase: The needs_lowercase of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._needs_lowercase = needs_lowercase + + @property + def needs_numeric(self): + """Gets the needs_numeric of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The needs_numeric of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._needs_numeric + + @needs_numeric.setter + def needs_numeric(self, needs_numeric): + """Sets the needs_numeric of this OrganizationsettingsPasswordPolicy. + + + :param needs_numeric: The needs_numeric of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._needs_numeric = needs_numeric + + @property + def needs_symbolic(self): + """Gets the needs_symbolic of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The needs_symbolic of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._needs_symbolic + + @needs_symbolic.setter + def needs_symbolic(self, needs_symbolic): + """Sets the needs_symbolic of this OrganizationsettingsPasswordPolicy. + + + :param needs_symbolic: The needs_symbolic of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._needs_symbolic = needs_symbolic + + @property + def needs_uppercase(self): + """Gets the needs_uppercase of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The needs_uppercase of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._needs_uppercase + + @needs_uppercase.setter + def needs_uppercase(self, needs_uppercase): + """Sets the needs_uppercase of this OrganizationsettingsPasswordPolicy. + + + :param needs_uppercase: The needs_uppercase of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._needs_uppercase = needs_uppercase + + @property + def password_expiration_in_days(self): + """Gets the password_expiration_in_days of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The password_expiration_in_days of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: int + """ + return self._password_expiration_in_days + + @password_expiration_in_days.setter + def password_expiration_in_days(self, password_expiration_in_days): + """Sets the password_expiration_in_days of this OrganizationsettingsPasswordPolicy. + + + :param password_expiration_in_days: The password_expiration_in_days of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: int + """ + + self._password_expiration_in_days = password_expiration_in_days + + @property + def reset_lockout_counter_minutes(self): + """Gets the reset_lockout_counter_minutes of this OrganizationsettingsPasswordPolicy. # noqa: E501 + + + :return: The reset_lockout_counter_minutes of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :rtype: int + """ + return self._reset_lockout_counter_minutes + + @reset_lockout_counter_minutes.setter + def reset_lockout_counter_minutes(self, reset_lockout_counter_minutes): + """Sets the reset_lockout_counter_minutes of this OrganizationsettingsPasswordPolicy. + + + :param reset_lockout_counter_minutes: The reset_lockout_counter_minutes of this OrganizationsettingsPasswordPolicy. # noqa: E501 + :type: int + """ + + self._reset_lockout_counter_minutes = reset_lockout_counter_minutes + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationsettingsPasswordPolicy, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationsettingsPasswordPolicy): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationsettings_user_portal.py b/jcapiv1/jcapiv1/models/organizationsettings_user_portal.py new file mode 100644 index 0000000..6264b88 --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationsettings_user_portal.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationsettingsUserPortal(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'idle_session_duration_minutes': 'int' + } + + attribute_map = { + 'idle_session_duration_minutes': 'idleSessionDurationMinutes' + } + + def __init__(self, idle_session_duration_minutes=None): # noqa: E501 + """OrganizationsettingsUserPortal - a model defined in Swagger""" # noqa: E501 + self._idle_session_duration_minutes = None + self.discriminator = None + if idle_session_duration_minutes is not None: + self.idle_session_duration_minutes = idle_session_duration_minutes + + @property + def idle_session_duration_minutes(self): + """Gets the idle_session_duration_minutes of this OrganizationsettingsUserPortal. # noqa: E501 + + + :return: The idle_session_duration_minutes of this OrganizationsettingsUserPortal. # noqa: E501 + :rtype: int + """ + return self._idle_session_duration_minutes + + @idle_session_duration_minutes.setter + def idle_session_duration_minutes(self, idle_session_duration_minutes): + """Sets the idle_session_duration_minutes of this OrganizationsettingsUserPortal. + + + :param idle_session_duration_minutes: The idle_session_duration_minutes of this OrganizationsettingsUserPortal. # noqa: E501 + :type: int + """ + + self._idle_session_duration_minutes = idle_session_duration_minutes + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationsettingsUserPortal, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationsettingsUserPortal): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationsettingsput.py b/jcapiv1/jcapiv1/models/organizationsettingsput.py new file mode 100644 index 0000000..267178e --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationsettingsput.py @@ -0,0 +1,664 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Organizationsettingsput(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'contact_email': 'str', + 'contact_name': 'str', + 'device_identification_enabled': 'bool', + 'disable_google_login': 'bool', + 'disable_ldap': 'bool', + 'disable_um': 'bool', + 'duplicate_ldap_groups': 'bool', + 'email_disclaimer': 'str', + 'enable_managed_uid': 'bool', + 'features': 'OrganizationsettingsFeatures', + 'growth_data': 'object', + 'logo': 'str', + 'name': 'str', + 'new_system_user_state_defaults': 'OrganizationsettingsputNewSystemUserStateDefaults', + 'password_compliance': 'str', + 'password_policy': 'OrganizationsettingsputPasswordPolicy', + 'show_intro': 'bool', + 'system_user_password_expiration_in_days': 'int', + 'system_users_can_edit': 'bool', + 'system_users_cap': 'int', + 'trusted_app_config': 'TrustedappConfigPut', + 'user_portal': 'OrganizationsettingsUserPortal' + } + + attribute_map = { + 'contact_email': 'contactEmail', + 'contact_name': 'contactName', + 'device_identification_enabled': 'deviceIdentificationEnabled', + 'disable_google_login': 'disableGoogleLogin', + 'disable_ldap': 'disableLdap', + 'disable_um': 'disableUM', + 'duplicate_ldap_groups': 'duplicateLDAPGroups', + 'email_disclaimer': 'emailDisclaimer', + 'enable_managed_uid': 'enableManagedUID', + 'features': 'features', + 'growth_data': 'growthData', + 'logo': 'logo', + 'name': 'name', + 'new_system_user_state_defaults': 'newSystemUserStateDefaults', + 'password_compliance': 'passwordCompliance', + 'password_policy': 'passwordPolicy', + 'show_intro': 'showIntro', + 'system_user_password_expiration_in_days': 'systemUserPasswordExpirationInDays', + 'system_users_can_edit': 'systemUsersCanEdit', + 'system_users_cap': 'systemUsersCap', + 'trusted_app_config': 'trustedAppConfig', + 'user_portal': 'userPortal' + } + + def __init__(self, contact_email=None, contact_name=None, device_identification_enabled=None, disable_google_login=None, disable_ldap=None, disable_um=None, duplicate_ldap_groups=None, email_disclaimer=None, enable_managed_uid=None, features=None, growth_data=None, logo=None, name=None, new_system_user_state_defaults=None, password_compliance=None, password_policy=None, show_intro=None, system_user_password_expiration_in_days=None, system_users_can_edit=None, system_users_cap=None, trusted_app_config=None, user_portal=None): # noqa: E501 + """Organizationsettingsput - a model defined in Swagger""" # noqa: E501 + self._contact_email = None + self._contact_name = None + self._device_identification_enabled = None + self._disable_google_login = None + self._disable_ldap = None + self._disable_um = None + self._duplicate_ldap_groups = None + self._email_disclaimer = None + self._enable_managed_uid = None + self._features = None + self._growth_data = None + self._logo = None + self._name = None + self._new_system_user_state_defaults = None + self._password_compliance = None + self._password_policy = None + self._show_intro = None + self._system_user_password_expiration_in_days = None + self._system_users_can_edit = None + self._system_users_cap = None + self._trusted_app_config = None + self._user_portal = None + self.discriminator = None + if contact_email is not None: + self.contact_email = contact_email + if contact_name is not None: + self.contact_name = contact_name + if device_identification_enabled is not None: + self.device_identification_enabled = device_identification_enabled + if disable_google_login is not None: + self.disable_google_login = disable_google_login + if disable_ldap is not None: + self.disable_ldap = disable_ldap + if disable_um is not None: + self.disable_um = disable_um + if duplicate_ldap_groups is not None: + self.duplicate_ldap_groups = duplicate_ldap_groups + if email_disclaimer is not None: + self.email_disclaimer = email_disclaimer + if enable_managed_uid is not None: + self.enable_managed_uid = enable_managed_uid + if features is not None: + self.features = features + if growth_data is not None: + self.growth_data = growth_data + if logo is not None: + self.logo = logo + if name is not None: + self.name = name + if new_system_user_state_defaults is not None: + self.new_system_user_state_defaults = new_system_user_state_defaults + if password_compliance is not None: + self.password_compliance = password_compliance + if password_policy is not None: + self.password_policy = password_policy + if show_intro is not None: + self.show_intro = show_intro + if system_user_password_expiration_in_days is not None: + self.system_user_password_expiration_in_days = system_user_password_expiration_in_days + if system_users_can_edit is not None: + self.system_users_can_edit = system_users_can_edit + if system_users_cap is not None: + self.system_users_cap = system_users_cap + if trusted_app_config is not None: + self.trusted_app_config = trusted_app_config + if user_portal is not None: + self.user_portal = user_portal + + @property + def contact_email(self): + """Gets the contact_email of this Organizationsettingsput. # noqa: E501 + + + :return: The contact_email of this Organizationsettingsput. # noqa: E501 + :rtype: str + """ + return self._contact_email + + @contact_email.setter + def contact_email(self, contact_email): + """Sets the contact_email of this Organizationsettingsput. + + + :param contact_email: The contact_email of this Organizationsettingsput. # noqa: E501 + :type: str + """ + + self._contact_email = contact_email + + @property + def contact_name(self): + """Gets the contact_name of this Organizationsettingsput. # noqa: E501 + + + :return: The contact_name of this Organizationsettingsput. # noqa: E501 + :rtype: str + """ + return self._contact_name + + @contact_name.setter + def contact_name(self, contact_name): + """Sets the contact_name of this Organizationsettingsput. + + + :param contact_name: The contact_name of this Organizationsettingsput. # noqa: E501 + :type: str + """ + + self._contact_name = contact_name + + @property + def device_identification_enabled(self): + """Gets the device_identification_enabled of this Organizationsettingsput. # noqa: E501 + + + :return: The device_identification_enabled of this Organizationsettingsput. # noqa: E501 + :rtype: bool + """ + return self._device_identification_enabled + + @device_identification_enabled.setter + def device_identification_enabled(self, device_identification_enabled): + """Sets the device_identification_enabled of this Organizationsettingsput. + + + :param device_identification_enabled: The device_identification_enabled of this Organizationsettingsput. # noqa: E501 + :type: bool + """ + + self._device_identification_enabled = device_identification_enabled + + @property + def disable_google_login(self): + """Gets the disable_google_login of this Organizationsettingsput. # noqa: E501 + + + :return: The disable_google_login of this Organizationsettingsput. # noqa: E501 + :rtype: bool + """ + return self._disable_google_login + + @disable_google_login.setter + def disable_google_login(self, disable_google_login): + """Sets the disable_google_login of this Organizationsettingsput. + + + :param disable_google_login: The disable_google_login of this Organizationsettingsput. # noqa: E501 + :type: bool + """ + + self._disable_google_login = disable_google_login + + @property + def disable_ldap(self): + """Gets the disable_ldap of this Organizationsettingsput. # noqa: E501 + + + :return: The disable_ldap of this Organizationsettingsput. # noqa: E501 + :rtype: bool + """ + return self._disable_ldap + + @disable_ldap.setter + def disable_ldap(self, disable_ldap): + """Sets the disable_ldap of this Organizationsettingsput. + + + :param disable_ldap: The disable_ldap of this Organizationsettingsput. # noqa: E501 + :type: bool + """ + + self._disable_ldap = disable_ldap + + @property + def disable_um(self): + """Gets the disable_um of this Organizationsettingsput. # noqa: E501 + + + :return: The disable_um of this Organizationsettingsput. # noqa: E501 + :rtype: bool + """ + return self._disable_um + + @disable_um.setter + def disable_um(self, disable_um): + """Sets the disable_um of this Organizationsettingsput. + + + :param disable_um: The disable_um of this Organizationsettingsput. # noqa: E501 + :type: bool + """ + + self._disable_um = disable_um + + @property + def duplicate_ldap_groups(self): + """Gets the duplicate_ldap_groups of this Organizationsettingsput. # noqa: E501 + + + :return: The duplicate_ldap_groups of this Organizationsettingsput. # noqa: E501 + :rtype: bool + """ + return self._duplicate_ldap_groups + + @duplicate_ldap_groups.setter + def duplicate_ldap_groups(self, duplicate_ldap_groups): + """Sets the duplicate_ldap_groups of this Organizationsettingsput. + + + :param duplicate_ldap_groups: The duplicate_ldap_groups of this Organizationsettingsput. # noqa: E501 + :type: bool + """ + + self._duplicate_ldap_groups = duplicate_ldap_groups + + @property + def email_disclaimer(self): + """Gets the email_disclaimer of this Organizationsettingsput. # noqa: E501 + + + :return: The email_disclaimer of this Organizationsettingsput. # noqa: E501 + :rtype: str + """ + return self._email_disclaimer + + @email_disclaimer.setter + def email_disclaimer(self, email_disclaimer): + """Sets the email_disclaimer of this Organizationsettingsput. + + + :param email_disclaimer: The email_disclaimer of this Organizationsettingsput. # noqa: E501 + :type: str + """ + + self._email_disclaimer = email_disclaimer + + @property + def enable_managed_uid(self): + """Gets the enable_managed_uid of this Organizationsettingsput. # noqa: E501 + + + :return: The enable_managed_uid of this Organizationsettingsput. # noqa: E501 + :rtype: bool + """ + return self._enable_managed_uid + + @enable_managed_uid.setter + def enable_managed_uid(self, enable_managed_uid): + """Sets the enable_managed_uid of this Organizationsettingsput. + + + :param enable_managed_uid: The enable_managed_uid of this Organizationsettingsput. # noqa: E501 + :type: bool + """ + + self._enable_managed_uid = enable_managed_uid + + @property + def features(self): + """Gets the features of this Organizationsettingsput. # noqa: E501 + + + :return: The features of this Organizationsettingsput. # noqa: E501 + :rtype: OrganizationsettingsFeatures + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this Organizationsettingsput. + + + :param features: The features of this Organizationsettingsput. # noqa: E501 + :type: OrganizationsettingsFeatures + """ + + self._features = features + + @property + def growth_data(self): + """Gets the growth_data of this Organizationsettingsput. # noqa: E501 + + Object containing Optimizely experimentIds and states corresponding to them # noqa: E501 + + :return: The growth_data of this Organizationsettingsput. # noqa: E501 + :rtype: object + """ + return self._growth_data + + @growth_data.setter + def growth_data(self, growth_data): + """Sets the growth_data of this Organizationsettingsput. + + Object containing Optimizely experimentIds and states corresponding to them # noqa: E501 + + :param growth_data: The growth_data of this Organizationsettingsput. # noqa: E501 + :type: object + """ + + self._growth_data = growth_data + + @property + def logo(self): + """Gets the logo of this Organizationsettingsput. # noqa: E501 + + + :return: The logo of this Organizationsettingsput. # noqa: E501 + :rtype: str + """ + return self._logo + + @logo.setter + def logo(self, logo): + """Sets the logo of this Organizationsettingsput. + + + :param logo: The logo of this Organizationsettingsput. # noqa: E501 + :type: str + """ + + self._logo = logo + + @property + def name(self): + """Gets the name of this Organizationsettingsput. # noqa: E501 + + + :return: The name of this Organizationsettingsput. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Organizationsettingsput. + + + :param name: The name of this Organizationsettingsput. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def new_system_user_state_defaults(self): + """Gets the new_system_user_state_defaults of this Organizationsettingsput. # noqa: E501 + + + :return: The new_system_user_state_defaults of this Organizationsettingsput. # noqa: E501 + :rtype: OrganizationsettingsputNewSystemUserStateDefaults + """ + return self._new_system_user_state_defaults + + @new_system_user_state_defaults.setter + def new_system_user_state_defaults(self, new_system_user_state_defaults): + """Sets the new_system_user_state_defaults of this Organizationsettingsput. + + + :param new_system_user_state_defaults: The new_system_user_state_defaults of this Organizationsettingsput. # noqa: E501 + :type: OrganizationsettingsputNewSystemUserStateDefaults + """ + + self._new_system_user_state_defaults = new_system_user_state_defaults + + @property + def password_compliance(self): + """Gets the password_compliance of this Organizationsettingsput. # noqa: E501 + + + :return: The password_compliance of this Organizationsettingsput. # noqa: E501 + :rtype: str + """ + return self._password_compliance + + @password_compliance.setter + def password_compliance(self, password_compliance): + """Sets the password_compliance of this Organizationsettingsput. + + + :param password_compliance: The password_compliance of this Organizationsettingsput. # noqa: E501 + :type: str + """ + allowed_values = ["custom", "pci3", "windows"] # noqa: E501 + if password_compliance not in allowed_values: + raise ValueError( + "Invalid value for `password_compliance` ({0}), must be one of {1}" # noqa: E501 + .format(password_compliance, allowed_values) + ) + + self._password_compliance = password_compliance + + @property + def password_policy(self): + """Gets the password_policy of this Organizationsettingsput. # noqa: E501 + + + :return: The password_policy of this Organizationsettingsput. # noqa: E501 + :rtype: OrganizationsettingsputPasswordPolicy + """ + return self._password_policy + + @password_policy.setter + def password_policy(self, password_policy): + """Sets the password_policy of this Organizationsettingsput. + + + :param password_policy: The password_policy of this Organizationsettingsput. # noqa: E501 + :type: OrganizationsettingsputPasswordPolicy + """ + + self._password_policy = password_policy + + @property + def show_intro(self): + """Gets the show_intro of this Organizationsettingsput. # noqa: E501 + + + :return: The show_intro of this Organizationsettingsput. # noqa: E501 + :rtype: bool + """ + return self._show_intro + + @show_intro.setter + def show_intro(self, show_intro): + """Sets the show_intro of this Organizationsettingsput. + + + :param show_intro: The show_intro of this Organizationsettingsput. # noqa: E501 + :type: bool + """ + + self._show_intro = show_intro + + @property + def system_user_password_expiration_in_days(self): + """Gets the system_user_password_expiration_in_days of this Organizationsettingsput. # noqa: E501 + + + :return: The system_user_password_expiration_in_days of this Organizationsettingsput. # noqa: E501 + :rtype: int + """ + return self._system_user_password_expiration_in_days + + @system_user_password_expiration_in_days.setter + def system_user_password_expiration_in_days(self, system_user_password_expiration_in_days): + """Sets the system_user_password_expiration_in_days of this Organizationsettingsput. + + + :param system_user_password_expiration_in_days: The system_user_password_expiration_in_days of this Organizationsettingsput. # noqa: E501 + :type: int + """ + + self._system_user_password_expiration_in_days = system_user_password_expiration_in_days + + @property + def system_users_can_edit(self): + """Gets the system_users_can_edit of this Organizationsettingsput. # noqa: E501 + + + :return: The system_users_can_edit of this Organizationsettingsput. # noqa: E501 + :rtype: bool + """ + return self._system_users_can_edit + + @system_users_can_edit.setter + def system_users_can_edit(self, system_users_can_edit): + """Sets the system_users_can_edit of this Organizationsettingsput. + + + :param system_users_can_edit: The system_users_can_edit of this Organizationsettingsput. # noqa: E501 + :type: bool + """ + + self._system_users_can_edit = system_users_can_edit + + @property + def system_users_cap(self): + """Gets the system_users_cap of this Organizationsettingsput. # noqa: E501 + + + :return: The system_users_cap of this Organizationsettingsput. # noqa: E501 + :rtype: int + """ + return self._system_users_cap + + @system_users_cap.setter + def system_users_cap(self, system_users_cap): + """Sets the system_users_cap of this Organizationsettingsput. + + + :param system_users_cap: The system_users_cap of this Organizationsettingsput. # noqa: E501 + :type: int + """ + + self._system_users_cap = system_users_cap + + @property + def trusted_app_config(self): + """Gets the trusted_app_config of this Organizationsettingsput. # noqa: E501 + + + :return: The trusted_app_config of this Organizationsettingsput. # noqa: E501 + :rtype: TrustedappConfigPut + """ + return self._trusted_app_config + + @trusted_app_config.setter + def trusted_app_config(self, trusted_app_config): + """Sets the trusted_app_config of this Organizationsettingsput. + + + :param trusted_app_config: The trusted_app_config of this Organizationsettingsput. # noqa: E501 + :type: TrustedappConfigPut + """ + + self._trusted_app_config = trusted_app_config + + @property + def user_portal(self): + """Gets the user_portal of this Organizationsettingsput. # noqa: E501 + + + :return: The user_portal of this Organizationsettingsput. # noqa: E501 + :rtype: OrganizationsettingsUserPortal + """ + return self._user_portal + + @user_portal.setter + def user_portal(self, user_portal): + """Sets the user_portal of this Organizationsettingsput. + + + :param user_portal: The user_portal of this Organizationsettingsput. # noqa: E501 + :type: OrganizationsettingsUserPortal + """ + + self._user_portal = user_portal + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Organizationsettingsput, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Organizationsettingsput): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationsettingsput_new_system_user_state_defaults.py b/jcapiv1/jcapiv1/models/organizationsettingsput_new_system_user_state_defaults.py new file mode 100644 index 0000000..eb8bb9f --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationsettingsput_new_system_user_state_defaults.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationsettingsputNewSystemUserStateDefaults(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'application_import': 'str', + 'csv_import': 'str', + 'manual_entry': 'str' + } + + attribute_map = { + 'application_import': 'applicationImport', + 'csv_import': 'csvImport', + 'manual_entry': 'manualEntry' + } + + def __init__(self, application_import=None, csv_import=None, manual_entry=None): # noqa: E501 + """OrganizationsettingsputNewSystemUserStateDefaults - a model defined in Swagger""" # noqa: E501 + self._application_import = None + self._csv_import = None + self._manual_entry = None + self.discriminator = None + if application_import is not None: + self.application_import = application_import + if csv_import is not None: + self.csv_import = csv_import + if manual_entry is not None: + self.manual_entry = manual_entry + + @property + def application_import(self): + """Gets the application_import of this OrganizationsettingsputNewSystemUserStateDefaults. # noqa: E501 + + + :return: The application_import of this OrganizationsettingsputNewSystemUserStateDefaults. # noqa: E501 + :rtype: str + """ + return self._application_import + + @application_import.setter + def application_import(self, application_import): + """Sets the application_import of this OrganizationsettingsputNewSystemUserStateDefaults. + + + :param application_import: The application_import of this OrganizationsettingsputNewSystemUserStateDefaults. # noqa: E501 + :type: str + """ + allowed_values = ["ACTIVATED", "STAGED"] # noqa: E501 + if application_import not in allowed_values: + raise ValueError( + "Invalid value for `application_import` ({0}), must be one of {1}" # noqa: E501 + .format(application_import, allowed_values) + ) + + self._application_import = application_import + + @property + def csv_import(self): + """Gets the csv_import of this OrganizationsettingsputNewSystemUserStateDefaults. # noqa: E501 + + + :return: The csv_import of this OrganizationsettingsputNewSystemUserStateDefaults. # noqa: E501 + :rtype: str + """ + return self._csv_import + + @csv_import.setter + def csv_import(self, csv_import): + """Sets the csv_import of this OrganizationsettingsputNewSystemUserStateDefaults. + + + :param csv_import: The csv_import of this OrganizationsettingsputNewSystemUserStateDefaults. # noqa: E501 + :type: str + """ + allowed_values = ["ACTIVATED", "STAGED"] # noqa: E501 + if csv_import not in allowed_values: + raise ValueError( + "Invalid value for `csv_import` ({0}), must be one of {1}" # noqa: E501 + .format(csv_import, allowed_values) + ) + + self._csv_import = csv_import + + @property + def manual_entry(self): + """Gets the manual_entry of this OrganizationsettingsputNewSystemUserStateDefaults. # noqa: E501 + + + :return: The manual_entry of this OrganizationsettingsputNewSystemUserStateDefaults. # noqa: E501 + :rtype: str + """ + return self._manual_entry + + @manual_entry.setter + def manual_entry(self, manual_entry): + """Sets the manual_entry of this OrganizationsettingsputNewSystemUserStateDefaults. + + + :param manual_entry: The manual_entry of this OrganizationsettingsputNewSystemUserStateDefaults. # noqa: E501 + :type: str + """ + allowed_values = ["ACTIVATED", "STAGED"] # noqa: E501 + if manual_entry not in allowed_values: + raise ValueError( + "Invalid value for `manual_entry` ({0}), must be one of {1}" # noqa: E501 + .format(manual_entry, allowed_values) + ) + + self._manual_entry = manual_entry + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationsettingsputNewSystemUserStateDefaults, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationsettingsputNewSystemUserStateDefaults): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationsettingsput_password_policy.py b/jcapiv1/jcapiv1/models/organizationsettingsput_password_policy.py new file mode 100644 index 0000000..21d67a0 --- /dev/null +++ b/jcapiv1/jcapiv1/models/organizationsettingsput_password_policy.py @@ -0,0 +1,684 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationsettingsputPasswordPolicy(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'allow_username_substring': 'bool', + 'days_after_expiration_to_self_recover': 'int', + 'days_before_expiration_to_force_reset': 'int', + 'effective_date': 'str', + 'enable_days_after_expiration_to_self_recover': 'bool', + 'enable_days_before_expiration_to_force_reset': 'bool', + 'enable_lockout_time_in_seconds': 'bool', + 'enable_max_history': 'bool', + 'enable_max_login_attempts': 'bool', + 'enable_min_change_period_in_days': 'bool', + 'enable_min_length': 'bool', + 'enable_password_expiration_in_days': 'bool', + 'grace_period_date': 'str', + 'lockout_time_in_seconds': 'int', + 'max_history': 'int', + 'max_login_attempts': 'int', + 'min_change_period_in_days': 'int', + 'min_length': 'int', + 'needs_lowercase': 'bool', + 'needs_numeric': 'bool', + 'needs_symbolic': 'bool', + 'needs_uppercase': 'bool', + 'password_expiration_in_days': 'int' + } + + attribute_map = { + 'allow_username_substring': 'allowUsernameSubstring', + 'days_after_expiration_to_self_recover': 'daysAfterExpirationToSelfRecover', + 'days_before_expiration_to_force_reset': 'daysBeforeExpirationToForceReset', + 'effective_date': 'effectiveDate', + 'enable_days_after_expiration_to_self_recover': 'enableDaysAfterExpirationToSelfRecover', + 'enable_days_before_expiration_to_force_reset': 'enableDaysBeforeExpirationToForceReset', + 'enable_lockout_time_in_seconds': 'enableLockoutTimeInSeconds', + 'enable_max_history': 'enableMaxHistory', + 'enable_max_login_attempts': 'enableMaxLoginAttempts', + 'enable_min_change_period_in_days': 'enableMinChangePeriodInDays', + 'enable_min_length': 'enableMinLength', + 'enable_password_expiration_in_days': 'enablePasswordExpirationInDays', + 'grace_period_date': 'gracePeriodDate', + 'lockout_time_in_seconds': 'lockoutTimeInSeconds', + 'max_history': 'maxHistory', + 'max_login_attempts': 'maxLoginAttempts', + 'min_change_period_in_days': 'minChangePeriodInDays', + 'min_length': 'minLength', + 'needs_lowercase': 'needsLowercase', + 'needs_numeric': 'needsNumeric', + 'needs_symbolic': 'needsSymbolic', + 'needs_uppercase': 'needsUppercase', + 'password_expiration_in_days': 'passwordExpirationInDays' + } + + def __init__(self, allow_username_substring=None, days_after_expiration_to_self_recover=None, days_before_expiration_to_force_reset=None, effective_date=None, enable_days_after_expiration_to_self_recover=None, enable_days_before_expiration_to_force_reset=None, enable_lockout_time_in_seconds=None, enable_max_history=None, enable_max_login_attempts=None, enable_min_change_period_in_days=None, enable_min_length=None, enable_password_expiration_in_days=None, grace_period_date=None, lockout_time_in_seconds=None, max_history=None, max_login_attempts=None, min_change_period_in_days=None, min_length=None, needs_lowercase=None, needs_numeric=None, needs_symbolic=None, needs_uppercase=None, password_expiration_in_days=None): # noqa: E501 + """OrganizationsettingsputPasswordPolicy - a model defined in Swagger""" # noqa: E501 + self._allow_username_substring = None + self._days_after_expiration_to_self_recover = None + self._days_before_expiration_to_force_reset = None + self._effective_date = None + self._enable_days_after_expiration_to_self_recover = None + self._enable_days_before_expiration_to_force_reset = None + self._enable_lockout_time_in_seconds = None + self._enable_max_history = None + self._enable_max_login_attempts = None + self._enable_min_change_period_in_days = None + self._enable_min_length = None + self._enable_password_expiration_in_days = None + self._grace_period_date = None + self._lockout_time_in_seconds = None + self._max_history = None + self._max_login_attempts = None + self._min_change_period_in_days = None + self._min_length = None + self._needs_lowercase = None + self._needs_numeric = None + self._needs_symbolic = None + self._needs_uppercase = None + self._password_expiration_in_days = None + self.discriminator = None + if allow_username_substring is not None: + self.allow_username_substring = allow_username_substring + if days_after_expiration_to_self_recover is not None: + self.days_after_expiration_to_self_recover = days_after_expiration_to_self_recover + if days_before_expiration_to_force_reset is not None: + self.days_before_expiration_to_force_reset = days_before_expiration_to_force_reset + if effective_date is not None: + self.effective_date = effective_date + if enable_days_after_expiration_to_self_recover is not None: + self.enable_days_after_expiration_to_self_recover = enable_days_after_expiration_to_self_recover + if enable_days_before_expiration_to_force_reset is not None: + self.enable_days_before_expiration_to_force_reset = enable_days_before_expiration_to_force_reset + if enable_lockout_time_in_seconds is not None: + self.enable_lockout_time_in_seconds = enable_lockout_time_in_seconds + if enable_max_history is not None: + self.enable_max_history = enable_max_history + if enable_max_login_attempts is not None: + self.enable_max_login_attempts = enable_max_login_attempts + if enable_min_change_period_in_days is not None: + self.enable_min_change_period_in_days = enable_min_change_period_in_days + if enable_min_length is not None: + self.enable_min_length = enable_min_length + if enable_password_expiration_in_days is not None: + self.enable_password_expiration_in_days = enable_password_expiration_in_days + if grace_period_date is not None: + self.grace_period_date = grace_period_date + if lockout_time_in_seconds is not None: + self.lockout_time_in_seconds = lockout_time_in_seconds + if max_history is not None: + self.max_history = max_history + if max_login_attempts is not None: + self.max_login_attempts = max_login_attempts + if min_change_period_in_days is not None: + self.min_change_period_in_days = min_change_period_in_days + if min_length is not None: + self.min_length = min_length + if needs_lowercase is not None: + self.needs_lowercase = needs_lowercase + if needs_numeric is not None: + self.needs_numeric = needs_numeric + if needs_symbolic is not None: + self.needs_symbolic = needs_symbolic + if needs_uppercase is not None: + self.needs_uppercase = needs_uppercase + if password_expiration_in_days is not None: + self.password_expiration_in_days = password_expiration_in_days + + @property + def allow_username_substring(self): + """Gets the allow_username_substring of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The allow_username_substring of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._allow_username_substring + + @allow_username_substring.setter + def allow_username_substring(self, allow_username_substring): + """Sets the allow_username_substring of this OrganizationsettingsputPasswordPolicy. + + + :param allow_username_substring: The allow_username_substring of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._allow_username_substring = allow_username_substring + + @property + def days_after_expiration_to_self_recover(self): + """Gets the days_after_expiration_to_self_recover of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + Deprecated field used for the legacy grace period feature. # noqa: E501 + + :return: The days_after_expiration_to_self_recover of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: int + """ + return self._days_after_expiration_to_self_recover + + @days_after_expiration_to_self_recover.setter + def days_after_expiration_to_self_recover(self, days_after_expiration_to_self_recover): + """Sets the days_after_expiration_to_self_recover of this OrganizationsettingsputPasswordPolicy. + + Deprecated field used for the legacy grace period feature. # noqa: E501 + + :param days_after_expiration_to_self_recover: The days_after_expiration_to_self_recover of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: int + """ + + self._days_after_expiration_to_self_recover = days_after_expiration_to_self_recover + + @property + def days_before_expiration_to_force_reset(self): + """Gets the days_before_expiration_to_force_reset of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The days_before_expiration_to_force_reset of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: int + """ + return self._days_before_expiration_to_force_reset + + @days_before_expiration_to_force_reset.setter + def days_before_expiration_to_force_reset(self, days_before_expiration_to_force_reset): + """Sets the days_before_expiration_to_force_reset of this OrganizationsettingsputPasswordPolicy. + + + :param days_before_expiration_to_force_reset: The days_before_expiration_to_force_reset of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: int + """ + + self._days_before_expiration_to_force_reset = days_before_expiration_to_force_reset + + @property + def effective_date(self): + """Gets the effective_date of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The effective_date of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: str + """ + return self._effective_date + + @effective_date.setter + def effective_date(self, effective_date): + """Sets the effective_date of this OrganizationsettingsputPasswordPolicy. + + + :param effective_date: The effective_date of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: str + """ + + self._effective_date = effective_date + + @property + def enable_days_after_expiration_to_self_recover(self): + """Gets the enable_days_after_expiration_to_self_recover of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The enable_days_after_expiration_to_self_recover of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_days_after_expiration_to_self_recover + + @enable_days_after_expiration_to_self_recover.setter + def enable_days_after_expiration_to_self_recover(self, enable_days_after_expiration_to_self_recover): + """Sets the enable_days_after_expiration_to_self_recover of this OrganizationsettingsputPasswordPolicy. + + + :param enable_days_after_expiration_to_self_recover: The enable_days_after_expiration_to_self_recover of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_days_after_expiration_to_self_recover = enable_days_after_expiration_to_self_recover + + @property + def enable_days_before_expiration_to_force_reset(self): + """Gets the enable_days_before_expiration_to_force_reset of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The enable_days_before_expiration_to_force_reset of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_days_before_expiration_to_force_reset + + @enable_days_before_expiration_to_force_reset.setter + def enable_days_before_expiration_to_force_reset(self, enable_days_before_expiration_to_force_reset): + """Sets the enable_days_before_expiration_to_force_reset of this OrganizationsettingsputPasswordPolicy. + + + :param enable_days_before_expiration_to_force_reset: The enable_days_before_expiration_to_force_reset of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_days_before_expiration_to_force_reset = enable_days_before_expiration_to_force_reset + + @property + def enable_lockout_time_in_seconds(self): + """Gets the enable_lockout_time_in_seconds of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The enable_lockout_time_in_seconds of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_lockout_time_in_seconds + + @enable_lockout_time_in_seconds.setter + def enable_lockout_time_in_seconds(self, enable_lockout_time_in_seconds): + """Sets the enable_lockout_time_in_seconds of this OrganizationsettingsputPasswordPolicy. + + + :param enable_lockout_time_in_seconds: The enable_lockout_time_in_seconds of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_lockout_time_in_seconds = enable_lockout_time_in_seconds + + @property + def enable_max_history(self): + """Gets the enable_max_history of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The enable_max_history of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_max_history + + @enable_max_history.setter + def enable_max_history(self, enable_max_history): + """Sets the enable_max_history of this OrganizationsettingsputPasswordPolicy. + + + :param enable_max_history: The enable_max_history of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_max_history = enable_max_history + + @property + def enable_max_login_attempts(self): + """Gets the enable_max_login_attempts of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The enable_max_login_attempts of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_max_login_attempts + + @enable_max_login_attempts.setter + def enable_max_login_attempts(self, enable_max_login_attempts): + """Sets the enable_max_login_attempts of this OrganizationsettingsputPasswordPolicy. + + + :param enable_max_login_attempts: The enable_max_login_attempts of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_max_login_attempts = enable_max_login_attempts + + @property + def enable_min_change_period_in_days(self): + """Gets the enable_min_change_period_in_days of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The enable_min_change_period_in_days of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_min_change_period_in_days + + @enable_min_change_period_in_days.setter + def enable_min_change_period_in_days(self, enable_min_change_period_in_days): + """Sets the enable_min_change_period_in_days of this OrganizationsettingsputPasswordPolicy. + + + :param enable_min_change_period_in_days: The enable_min_change_period_in_days of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_min_change_period_in_days = enable_min_change_period_in_days + + @property + def enable_min_length(self): + """Gets the enable_min_length of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The enable_min_length of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_min_length + + @enable_min_length.setter + def enable_min_length(self, enable_min_length): + """Sets the enable_min_length of this OrganizationsettingsputPasswordPolicy. + + + :param enable_min_length: The enable_min_length of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_min_length = enable_min_length + + @property + def enable_password_expiration_in_days(self): + """Gets the enable_password_expiration_in_days of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The enable_password_expiration_in_days of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._enable_password_expiration_in_days + + @enable_password_expiration_in_days.setter + def enable_password_expiration_in_days(self, enable_password_expiration_in_days): + """Sets the enable_password_expiration_in_days of this OrganizationsettingsputPasswordPolicy. + + + :param enable_password_expiration_in_days: The enable_password_expiration_in_days of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._enable_password_expiration_in_days = enable_password_expiration_in_days + + @property + def grace_period_date(self): + """Gets the grace_period_date of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The grace_period_date of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: str + """ + return self._grace_period_date + + @grace_period_date.setter + def grace_period_date(self, grace_period_date): + """Sets the grace_period_date of this OrganizationsettingsputPasswordPolicy. + + + :param grace_period_date: The grace_period_date of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: str + """ + + self._grace_period_date = grace_period_date + + @property + def lockout_time_in_seconds(self): + """Gets the lockout_time_in_seconds of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The lockout_time_in_seconds of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: int + """ + return self._lockout_time_in_seconds + + @lockout_time_in_seconds.setter + def lockout_time_in_seconds(self, lockout_time_in_seconds): + """Sets the lockout_time_in_seconds of this OrganizationsettingsputPasswordPolicy. + + + :param lockout_time_in_seconds: The lockout_time_in_seconds of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: int + """ + + self._lockout_time_in_seconds = lockout_time_in_seconds + + @property + def max_history(self): + """Gets the max_history of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The max_history of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: int + """ + return self._max_history + + @max_history.setter + def max_history(self, max_history): + """Sets the max_history of this OrganizationsettingsputPasswordPolicy. + + + :param max_history: The max_history of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: int + """ + + self._max_history = max_history + + @property + def max_login_attempts(self): + """Gets the max_login_attempts of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The max_login_attempts of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: int + """ + return self._max_login_attempts + + @max_login_attempts.setter + def max_login_attempts(self, max_login_attempts): + """Sets the max_login_attempts of this OrganizationsettingsputPasswordPolicy. + + + :param max_login_attempts: The max_login_attempts of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: int + """ + + self._max_login_attempts = max_login_attempts + + @property + def min_change_period_in_days(self): + """Gets the min_change_period_in_days of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The min_change_period_in_days of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: int + """ + return self._min_change_period_in_days + + @min_change_period_in_days.setter + def min_change_period_in_days(self, min_change_period_in_days): + """Sets the min_change_period_in_days of this OrganizationsettingsputPasswordPolicy. + + + :param min_change_period_in_days: The min_change_period_in_days of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: int + """ + + self._min_change_period_in_days = min_change_period_in_days + + @property + def min_length(self): + """Gets the min_length of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The min_length of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: int + """ + return self._min_length + + @min_length.setter + def min_length(self, min_length): + """Sets the min_length of this OrganizationsettingsputPasswordPolicy. + + + :param min_length: The min_length of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: int + """ + + self._min_length = min_length + + @property + def needs_lowercase(self): + """Gets the needs_lowercase of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The needs_lowercase of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._needs_lowercase + + @needs_lowercase.setter + def needs_lowercase(self, needs_lowercase): + """Sets the needs_lowercase of this OrganizationsettingsputPasswordPolicy. + + + :param needs_lowercase: The needs_lowercase of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._needs_lowercase = needs_lowercase + + @property + def needs_numeric(self): + """Gets the needs_numeric of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The needs_numeric of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._needs_numeric + + @needs_numeric.setter + def needs_numeric(self, needs_numeric): + """Sets the needs_numeric of this OrganizationsettingsputPasswordPolicy. + + + :param needs_numeric: The needs_numeric of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._needs_numeric = needs_numeric + + @property + def needs_symbolic(self): + """Gets the needs_symbolic of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The needs_symbolic of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._needs_symbolic + + @needs_symbolic.setter + def needs_symbolic(self, needs_symbolic): + """Sets the needs_symbolic of this OrganizationsettingsputPasswordPolicy. + + + :param needs_symbolic: The needs_symbolic of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._needs_symbolic = needs_symbolic + + @property + def needs_uppercase(self): + """Gets the needs_uppercase of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The needs_uppercase of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: bool + """ + return self._needs_uppercase + + @needs_uppercase.setter + def needs_uppercase(self, needs_uppercase): + """Sets the needs_uppercase of this OrganizationsettingsputPasswordPolicy. + + + :param needs_uppercase: The needs_uppercase of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: bool + """ + + self._needs_uppercase = needs_uppercase + + @property + def password_expiration_in_days(self): + """Gets the password_expiration_in_days of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + + + :return: The password_expiration_in_days of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :rtype: int + """ + return self._password_expiration_in_days + + @password_expiration_in_days.setter + def password_expiration_in_days(self, password_expiration_in_days): + """Sets the password_expiration_in_days of this OrganizationsettingsputPasswordPolicy. + + + :param password_expiration_in_days: The password_expiration_in_days of this OrganizationsettingsputPasswordPolicy. # noqa: E501 + :type: int + """ + + self._password_expiration_in_days = password_expiration_in_days + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationsettingsputPasswordPolicy, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationsettingsputPasswordPolicy): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/organizationslist.py b/jcapiv1/jcapiv1/models/organizationslist.py index 25017fb..b76f814 100644 --- a/jcapiv1/jcapiv1/models/organizationslist.py +++ b/jcapiv1/jcapiv1/models/organizationslist.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.organizationslist_results import OrganizationslistResults # noqa: F401,E501 - - class Organizationslist(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,11 +39,9 @@ class Organizationslist(object): def __init__(self, results=None, total_count=None): # noqa: E501 """Organizationslist - a model defined in Swagger""" # noqa: E501 - self._results = None self._total_count = None self.discriminator = None - if results is not None: self.results = results if total_count is not None: diff --git a/jcapiv1/jcapiv1/models/organizationslist_results.py b/jcapiv1/jcapiv1/models/organizationslist_results.py index 42dae3b..10dfded 100644 --- a/jcapiv1/jcapiv1/models/organizationslist_results.py +++ b/jcapiv1/jcapiv1/models/organizationslist_results.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class OrganizationslistResults(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,12 +41,10 @@ class OrganizationslistResults(object): def __init__(self, id=None, display_name=None, logo_url=None): # noqa: E501 """OrganizationslistResults - a model defined in Swagger""" # noqa: E501 - self._id = None self._display_name = None self._logo_url = None self.discriminator = None - if id is not None: self.id = id if display_name is not None: diff --git a/jcapiv1/jcapiv1/models/radiusserver.py b/jcapiv1/jcapiv1/models/radiusserver.py index 8e5486b..ce20e98 100644 --- a/jcapiv1/jcapiv1/models/radiusserver.py +++ b/jcapiv1/jcapiv1/models/radiusserver.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class Radiusserver(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -32,6 +29,8 @@ class Radiusserver(object): """ swagger_types = { 'id': 'str', + 'auth_idp': 'str', + 'device_cert_enabled': 'bool', 'mfa': 'str', 'name': 'str', 'network_source_ip': 'str', @@ -39,12 +38,16 @@ class Radiusserver(object): 'shared_secret': 'str', 'tag_names': 'list[str]', 'tags': 'list[str]', + 'user_cert_enabled': 'bool', 'user_lockout_action': 'str', + 'user_password_enabled': 'bool', 'user_password_expiration_action': 'str' } attribute_map = { 'id': '_id', + 'auth_idp': 'authIdp', + 'device_cert_enabled': 'deviceCertEnabled', 'mfa': 'mfa', 'name': 'name', 'network_source_ip': 'networkSourceIp', @@ -52,14 +55,17 @@ class Radiusserver(object): 'shared_secret': 'sharedSecret', 'tag_names': 'tagNames', 'tags': 'tags', + 'user_cert_enabled': 'userCertEnabled', 'user_lockout_action': 'userLockoutAction', + 'user_password_enabled': 'userPasswordEnabled', 'user_password_expiration_action': 'userPasswordExpirationAction' } - def __init__(self, id=None, mfa=None, name=None, network_source_ip=None, organization=None, shared_secret=None, tag_names=None, tags=None, user_lockout_action=None, user_password_expiration_action=None): # noqa: E501 + def __init__(self, id=None, auth_idp=None, device_cert_enabled=None, mfa=None, name=None, network_source_ip=None, organization=None, shared_secret=None, tag_names=None, tags=None, user_cert_enabled=None, user_lockout_action=None, user_password_enabled=None, user_password_expiration_action=None): # noqa: E501 """Radiusserver - a model defined in Swagger""" # noqa: E501 - self._id = None + self._auth_idp = None + self._device_cert_enabled = None self._mfa = None self._name = None self._network_source_ip = None @@ -67,12 +73,17 @@ def __init__(self, id=None, mfa=None, name=None, network_source_ip=None, organiz self._shared_secret = None self._tag_names = None self._tags = None + self._user_cert_enabled = None self._user_lockout_action = None + self._user_password_enabled = None self._user_password_expiration_action = None self.discriminator = None - if id is not None: self.id = id + if auth_idp is not None: + self.auth_idp = auth_idp + if device_cert_enabled is not None: + self.device_cert_enabled = device_cert_enabled if mfa is not None: self.mfa = mfa if name is not None: @@ -87,8 +98,12 @@ def __init__(self, id=None, mfa=None, name=None, network_source_ip=None, organiz self.tag_names = tag_names if tags is not None: self.tags = tags + if user_cert_enabled is not None: + self.user_cert_enabled = user_cert_enabled if user_lockout_action is not None: self.user_lockout_action = user_lockout_action + if user_password_enabled is not None: + self.user_password_enabled = user_password_enabled if user_password_expiration_action is not None: self.user_password_expiration_action = user_password_expiration_action @@ -113,6 +128,54 @@ def id(self, id): self._id = id + @property + def auth_idp(self): + """Gets the auth_idp of this Radiusserver. # noqa: E501 + + + :return: The auth_idp of this Radiusserver. # noqa: E501 + :rtype: str + """ + return self._auth_idp + + @auth_idp.setter + def auth_idp(self, auth_idp): + """Sets the auth_idp of this Radiusserver. + + + :param auth_idp: The auth_idp of this Radiusserver. # noqa: E501 + :type: str + """ + allowed_values = ["JUMPCLOUD", "AZURE"] # noqa: E501 + if auth_idp not in allowed_values: + raise ValueError( + "Invalid value for `auth_idp` ({0}), must be one of {1}" # noqa: E501 + .format(auth_idp, allowed_values) + ) + + self._auth_idp = auth_idp + + @property + def device_cert_enabled(self): + """Gets the device_cert_enabled of this Radiusserver. # noqa: E501 + + + :return: The device_cert_enabled of this Radiusserver. # noqa: E501 + :rtype: bool + """ + return self._device_cert_enabled + + @device_cert_enabled.setter + def device_cert_enabled(self, device_cert_enabled): + """Sets the device_cert_enabled of this Radiusserver. + + + :param device_cert_enabled: The device_cert_enabled of this Radiusserver. # noqa: E501 + :type: bool + """ + + self._device_cert_enabled = device_cert_enabled + @property def mfa(self): """Gets the mfa of this Radiusserver. # noqa: E501 @@ -266,6 +329,27 @@ def tags(self, tags): self._tags = tags + @property + def user_cert_enabled(self): + """Gets the user_cert_enabled of this Radiusserver. # noqa: E501 + + + :return: The user_cert_enabled of this Radiusserver. # noqa: E501 + :rtype: bool + """ + return self._user_cert_enabled + + @user_cert_enabled.setter + def user_cert_enabled(self, user_cert_enabled): + """Sets the user_cert_enabled of this Radiusserver. + + + :param user_cert_enabled: The user_cert_enabled of this Radiusserver. # noqa: E501 + :type: bool + """ + + self._user_cert_enabled = user_cert_enabled + @property def user_lockout_action(self): """Gets the user_lockout_action of this Radiusserver. # noqa: E501 @@ -287,6 +371,27 @@ def user_lockout_action(self, user_lockout_action): self._user_lockout_action = user_lockout_action + @property + def user_password_enabled(self): + """Gets the user_password_enabled of this Radiusserver. # noqa: E501 + + + :return: The user_password_enabled of this Radiusserver. # noqa: E501 + :rtype: bool + """ + return self._user_password_enabled + + @user_password_enabled.setter + def user_password_enabled(self, user_password_enabled): + """Sets the user_password_enabled of this Radiusserver. + + + :param user_password_enabled: The user_password_enabled of this Radiusserver. # noqa: E501 + :type: bool + """ + + self._user_password_enabled = user_password_enabled + @property def user_password_expiration_action(self): """Gets the user_password_expiration_action of this Radiusserver. # noqa: E501 diff --git a/jcapiv1/jcapiv1/models/radiusserverpost.py b/jcapiv1/jcapiv1/models/radiusserverpost.py index 7ccf187..827c948 100644 --- a/jcapiv1/jcapiv1/models/radiusserverpost.py +++ b/jcapiv1/jcapiv1/models/radiusserverpost.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class Radiusserverpost(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,37 +28,51 @@ class Radiusserverpost(object): and the value is json key in definition. """ swagger_types = { + 'auth_idp': 'str', + 'device_cert_enabled': 'bool', 'mfa': 'str', 'name': 'str', 'network_source_ip': 'str', 'shared_secret': 'str', 'tag_names': 'list[str]', + 'user_cert_enabled': 'bool', 'user_lockout_action': 'str', + 'user_password_enabled': 'bool', 'user_password_expiration_action': 'str' } attribute_map = { + 'auth_idp': 'authIdp', + 'device_cert_enabled': 'deviceCertEnabled', 'mfa': 'mfa', 'name': 'name', 'network_source_ip': 'networkSourceIp', 'shared_secret': 'sharedSecret', 'tag_names': 'tagNames', + 'user_cert_enabled': 'userCertEnabled', 'user_lockout_action': 'userLockoutAction', + 'user_password_enabled': 'userPasswordEnabled', 'user_password_expiration_action': 'userPasswordExpirationAction' } - def __init__(self, mfa=None, name=None, network_source_ip=None, shared_secret=None, tag_names=None, user_lockout_action=None, user_password_expiration_action=None): # noqa: E501 + def __init__(self, auth_idp=None, device_cert_enabled=None, mfa=None, name=None, network_source_ip=None, shared_secret=None, tag_names=None, user_cert_enabled=None, user_lockout_action=None, user_password_enabled=None, user_password_expiration_action=None): # noqa: E501 """Radiusserverpost - a model defined in Swagger""" # noqa: E501 - + self._auth_idp = None + self._device_cert_enabled = None self._mfa = None self._name = None self._network_source_ip = None self._shared_secret = None self._tag_names = None + self._user_cert_enabled = None self._user_lockout_action = None + self._user_password_enabled = None self._user_password_expiration_action = None self.discriminator = None - + if auth_idp is not None: + self.auth_idp = auth_idp + if device_cert_enabled is not None: + self.device_cert_enabled = device_cert_enabled if mfa is not None: self.mfa = mfa self.name = name @@ -69,11 +80,63 @@ def __init__(self, mfa=None, name=None, network_source_ip=None, shared_secret=No self.shared_secret = shared_secret if tag_names is not None: self.tag_names = tag_names + if user_cert_enabled is not None: + self.user_cert_enabled = user_cert_enabled if user_lockout_action is not None: self.user_lockout_action = user_lockout_action + if user_password_enabled is not None: + self.user_password_enabled = user_password_enabled if user_password_expiration_action is not None: self.user_password_expiration_action = user_password_expiration_action + @property + def auth_idp(self): + """Gets the auth_idp of this Radiusserverpost. # noqa: E501 + + + :return: The auth_idp of this Radiusserverpost. # noqa: E501 + :rtype: str + """ + return self._auth_idp + + @auth_idp.setter + def auth_idp(self, auth_idp): + """Sets the auth_idp of this Radiusserverpost. + + + :param auth_idp: The auth_idp of this Radiusserverpost. # noqa: E501 + :type: str + """ + allowed_values = ["JUMPCLOUD", "AZURE"] # noqa: E501 + if auth_idp not in allowed_values: + raise ValueError( + "Invalid value for `auth_idp` ({0}), must be one of {1}" # noqa: E501 + .format(auth_idp, allowed_values) + ) + + self._auth_idp = auth_idp + + @property + def device_cert_enabled(self): + """Gets the device_cert_enabled of this Radiusserverpost. # noqa: E501 + + + :return: The device_cert_enabled of this Radiusserverpost. # noqa: E501 + :rtype: bool + """ + return self._device_cert_enabled + + @device_cert_enabled.setter + def device_cert_enabled(self, device_cert_enabled): + """Sets the device_cert_enabled of this Radiusserverpost. + + + :param device_cert_enabled: The device_cert_enabled of this Radiusserverpost. # noqa: E501 + :type: bool + """ + + self._device_cert_enabled = device_cert_enabled + @property def mfa(self): """Gets the mfa of this Radiusserverpost. # noqa: E501 @@ -193,6 +256,27 @@ def tag_names(self, tag_names): self._tag_names = tag_names + @property + def user_cert_enabled(self): + """Gets the user_cert_enabled of this Radiusserverpost. # noqa: E501 + + + :return: The user_cert_enabled of this Radiusserverpost. # noqa: E501 + :rtype: bool + """ + return self._user_cert_enabled + + @user_cert_enabled.setter + def user_cert_enabled(self, user_cert_enabled): + """Sets the user_cert_enabled of this Radiusserverpost. + + + :param user_cert_enabled: The user_cert_enabled of this Radiusserverpost. # noqa: E501 + :type: bool + """ + + self._user_cert_enabled = user_cert_enabled + @property def user_lockout_action(self): """Gets the user_lockout_action of this Radiusserverpost. # noqa: E501 @@ -214,6 +298,27 @@ def user_lockout_action(self, user_lockout_action): self._user_lockout_action = user_lockout_action + @property + def user_password_enabled(self): + """Gets the user_password_enabled of this Radiusserverpost. # noqa: E501 + + + :return: The user_password_enabled of this Radiusserverpost. # noqa: E501 + :rtype: bool + """ + return self._user_password_enabled + + @user_password_enabled.setter + def user_password_enabled(self, user_password_enabled): + """Sets the user_password_enabled of this Radiusserverpost. + + + :param user_password_enabled: The user_password_enabled of this Radiusserverpost. # noqa: E501 + :type: bool + """ + + self._user_password_enabled = user_password_enabled + @property def user_password_expiration_action(self): """Gets the user_password_expiration_action of this Radiusserverpost. # noqa: E501 diff --git a/jcapiv1/jcapiv1/models/radiusserverput.py b/jcapiv1/jcapiv1/models/radiusserverput.py index 8f29c05..ab00664 100644 --- a/jcapiv1/jcapiv1/models/radiusserverput.py +++ b/jcapiv1/jcapiv1/models/radiusserverput.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class Radiusserverput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -32,38 +29,52 @@ class Radiusserverput(object): """ swagger_types = { 'id': 'str', + 'auth_idp': 'str', + 'device_cert_enabled': 'bool', 'mfa': 'str', 'name': 'str', 'network_source_ip': 'str', 'tag_names': 'list[str]', + 'user_cert_enabled': 'bool', 'user_lockout_action': 'str', + 'user_password_enabled': 'bool', 'user_password_expiration_action': 'str' } attribute_map = { 'id': '_id', + 'auth_idp': 'authIdp', + 'device_cert_enabled': 'deviceCertEnabled', 'mfa': 'mfa', 'name': 'name', 'network_source_ip': 'networkSourceIp', 'tag_names': 'tagNames', + 'user_cert_enabled': 'userCertEnabled', 'user_lockout_action': 'userLockoutAction', + 'user_password_enabled': 'userPasswordEnabled', 'user_password_expiration_action': 'userPasswordExpirationAction' } - def __init__(self, id=None, mfa=None, name=None, network_source_ip=None, tag_names=None, user_lockout_action=None, user_password_expiration_action=None): # noqa: E501 + def __init__(self, id=None, auth_idp=None, device_cert_enabled=None, mfa=None, name=None, network_source_ip=None, tag_names=None, user_cert_enabled=None, user_lockout_action=None, user_password_enabled=None, user_password_expiration_action=None): # noqa: E501 """Radiusserverput - a model defined in Swagger""" # noqa: E501 - self._id = None + self._auth_idp = None + self._device_cert_enabled = None self._mfa = None self._name = None self._network_source_ip = None self._tag_names = None + self._user_cert_enabled = None self._user_lockout_action = None + self._user_password_enabled = None self._user_password_expiration_action = None self.discriminator = None - if id is not None: self.id = id + if auth_idp is not None: + self.auth_idp = auth_idp + if device_cert_enabled is not None: + self.device_cert_enabled = device_cert_enabled if mfa is not None: self.mfa = mfa if name is not None: @@ -72,8 +83,12 @@ def __init__(self, id=None, mfa=None, name=None, network_source_ip=None, tag_nam self.network_source_ip = network_source_ip if tag_names is not None: self.tag_names = tag_names + if user_cert_enabled is not None: + self.user_cert_enabled = user_cert_enabled if user_lockout_action is not None: self.user_lockout_action = user_lockout_action + if user_password_enabled is not None: + self.user_password_enabled = user_password_enabled if user_password_expiration_action is not None: self.user_password_expiration_action = user_password_expiration_action @@ -98,6 +113,54 @@ def id(self, id): self._id = id + @property + def auth_idp(self): + """Gets the auth_idp of this Radiusserverput. # noqa: E501 + + + :return: The auth_idp of this Radiusserverput. # noqa: E501 + :rtype: str + """ + return self._auth_idp + + @auth_idp.setter + def auth_idp(self, auth_idp): + """Sets the auth_idp of this Radiusserverput. + + + :param auth_idp: The auth_idp of this Radiusserverput. # noqa: E501 + :type: str + """ + allowed_values = ["JUMPCLOUD", "AZURE"] # noqa: E501 + if auth_idp not in allowed_values: + raise ValueError( + "Invalid value for `auth_idp` ({0}), must be one of {1}" # noqa: E501 + .format(auth_idp, allowed_values) + ) + + self._auth_idp = auth_idp + + @property + def device_cert_enabled(self): + """Gets the device_cert_enabled of this Radiusserverput. # noqa: E501 + + + :return: The device_cert_enabled of this Radiusserverput. # noqa: E501 + :rtype: bool + """ + return self._device_cert_enabled + + @device_cert_enabled.setter + def device_cert_enabled(self, device_cert_enabled): + """Sets the device_cert_enabled of this Radiusserverput. + + + :param device_cert_enabled: The device_cert_enabled of this Radiusserverput. # noqa: E501 + :type: bool + """ + + self._device_cert_enabled = device_cert_enabled + @property def mfa(self): """Gets the mfa of this Radiusserverput. # noqa: E501 @@ -188,6 +251,27 @@ def tag_names(self, tag_names): self._tag_names = tag_names + @property + def user_cert_enabled(self): + """Gets the user_cert_enabled of this Radiusserverput. # noqa: E501 + + + :return: The user_cert_enabled of this Radiusserverput. # noqa: E501 + :rtype: bool + """ + return self._user_cert_enabled + + @user_cert_enabled.setter + def user_cert_enabled(self, user_cert_enabled): + """Sets the user_cert_enabled of this Radiusserverput. + + + :param user_cert_enabled: The user_cert_enabled of this Radiusserverput. # noqa: E501 + :type: bool + """ + + self._user_cert_enabled = user_cert_enabled + @property def user_lockout_action(self): """Gets the user_lockout_action of this Radiusserverput. # noqa: E501 @@ -209,6 +293,27 @@ def user_lockout_action(self, user_lockout_action): self._user_lockout_action = user_lockout_action + @property + def user_password_enabled(self): + """Gets the user_password_enabled of this Radiusserverput. # noqa: E501 + + + :return: The user_password_enabled of this Radiusserverput. # noqa: E501 + :rtype: bool + """ + return self._user_password_enabled + + @user_password_enabled.setter + def user_password_enabled(self, user_password_enabled): + """Sets the user_password_enabled of this Radiusserverput. + + + :param user_password_enabled: The user_password_enabled of this Radiusserverput. # noqa: E501 + :type: bool + """ + + self._user_password_enabled = user_password_enabled + @property def user_password_expiration_action(self): """Gets the user_password_expiration_action of this Radiusserverput. # noqa: E501 diff --git a/jcapiv1/jcapiv1/models/radiusservers_id_body.py b/jcapiv1/jcapiv1/models/radiusservers_id_body.py new file mode 100644 index 0000000..57b49d7 --- /dev/null +++ b/jcapiv1/jcapiv1/models/radiusservers_id_body.py @@ -0,0 +1,353 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class RadiusserversIdBody(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'device_cert_enabled': 'bool', + 'mfa': 'str', + 'name': 'str', + 'network_source_ip': 'str', + 'shared_secret': 'str', + 'tags': 'list[str]', + 'user_cert_enabled': 'bool', + 'user_lockout_action': 'str', + 'user_password_enabled': 'bool', + 'user_password_expiration_action': 'str' + } + + attribute_map = { + 'device_cert_enabled': 'deviceCertEnabled', + 'mfa': 'mfa', + 'name': 'name', + 'network_source_ip': 'networkSourceIp', + 'shared_secret': 'sharedSecret', + 'tags': 'tags', + 'user_cert_enabled': 'userCertEnabled', + 'user_lockout_action': 'userLockoutAction', + 'user_password_enabled': 'userPasswordEnabled', + 'user_password_expiration_action': 'userPasswordExpirationAction' + } + + def __init__(self, device_cert_enabled=None, mfa=None, name=None, network_source_ip=None, shared_secret=None, tags=None, user_cert_enabled=None, user_lockout_action=None, user_password_enabled=None, user_password_expiration_action=None): # noqa: E501 + """RadiusserversIdBody - a model defined in Swagger""" # noqa: E501 + self._device_cert_enabled = None + self._mfa = None + self._name = None + self._network_source_ip = None + self._shared_secret = None + self._tags = None + self._user_cert_enabled = None + self._user_lockout_action = None + self._user_password_enabled = None + self._user_password_expiration_action = None + self.discriminator = None + if device_cert_enabled is not None: + self.device_cert_enabled = device_cert_enabled + if mfa is not None: + self.mfa = mfa + self.name = name + self.network_source_ip = network_source_ip + self.shared_secret = shared_secret + if tags is not None: + self.tags = tags + if user_cert_enabled is not None: + self.user_cert_enabled = user_cert_enabled + if user_lockout_action is not None: + self.user_lockout_action = user_lockout_action + if user_password_enabled is not None: + self.user_password_enabled = user_password_enabled + if user_password_expiration_action is not None: + self.user_password_expiration_action = user_password_expiration_action + + @property + def device_cert_enabled(self): + """Gets the device_cert_enabled of this RadiusserversIdBody. # noqa: E501 + + + :return: The device_cert_enabled of this RadiusserversIdBody. # noqa: E501 + :rtype: bool + """ + return self._device_cert_enabled + + @device_cert_enabled.setter + def device_cert_enabled(self, device_cert_enabled): + """Sets the device_cert_enabled of this RadiusserversIdBody. + + + :param device_cert_enabled: The device_cert_enabled of this RadiusserversIdBody. # noqa: E501 + :type: bool + """ + + self._device_cert_enabled = device_cert_enabled + + @property + def mfa(self): + """Gets the mfa of this RadiusserversIdBody. # noqa: E501 + + + :return: The mfa of this RadiusserversIdBody. # noqa: E501 + :rtype: str + """ + return self._mfa + + @mfa.setter + def mfa(self, mfa): + """Sets the mfa of this RadiusserversIdBody. + + + :param mfa: The mfa of this RadiusserversIdBody. # noqa: E501 + :type: str + """ + allowed_values = ["DISABLED", "ENABLED", "REQUIRED", "ALWAYS"] # noqa: E501 + if mfa not in allowed_values: + raise ValueError( + "Invalid value for `mfa` ({0}), must be one of {1}" # noqa: E501 + .format(mfa, allowed_values) + ) + + self._mfa = mfa + + @property + def name(self): + """Gets the name of this RadiusserversIdBody. # noqa: E501 + + + :return: The name of this RadiusserversIdBody. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this RadiusserversIdBody. + + + :param name: The name of this RadiusserversIdBody. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def network_source_ip(self): + """Gets the network_source_ip of this RadiusserversIdBody. # noqa: E501 + + + :return: The network_source_ip of this RadiusserversIdBody. # noqa: E501 + :rtype: str + """ + return self._network_source_ip + + @network_source_ip.setter + def network_source_ip(self, network_source_ip): + """Sets the network_source_ip of this RadiusserversIdBody. + + + :param network_source_ip: The network_source_ip of this RadiusserversIdBody. # noqa: E501 + :type: str + """ + if network_source_ip is None: + raise ValueError("Invalid value for `network_source_ip`, must not be `None`") # noqa: E501 + + self._network_source_ip = network_source_ip + + @property + def shared_secret(self): + """Gets the shared_secret of this RadiusserversIdBody. # noqa: E501 + + + :return: The shared_secret of this RadiusserversIdBody. # noqa: E501 + :rtype: str + """ + return self._shared_secret + + @shared_secret.setter + def shared_secret(self, shared_secret): + """Sets the shared_secret of this RadiusserversIdBody. + + + :param shared_secret: The shared_secret of this RadiusserversIdBody. # noqa: E501 + :type: str + """ + if shared_secret is None: + raise ValueError("Invalid value for `shared_secret`, must not be `None`") # noqa: E501 + + self._shared_secret = shared_secret + + @property + def tags(self): + """Gets the tags of this RadiusserversIdBody. # noqa: E501 + + + :return: The tags of this RadiusserversIdBody. # noqa: E501 + :rtype: list[str] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this RadiusserversIdBody. + + + :param tags: The tags of this RadiusserversIdBody. # noqa: E501 + :type: list[str] + """ + + self._tags = tags + + @property + def user_cert_enabled(self): + """Gets the user_cert_enabled of this RadiusserversIdBody. # noqa: E501 + + + :return: The user_cert_enabled of this RadiusserversIdBody. # noqa: E501 + :rtype: bool + """ + return self._user_cert_enabled + + @user_cert_enabled.setter + def user_cert_enabled(self, user_cert_enabled): + """Sets the user_cert_enabled of this RadiusserversIdBody. + + + :param user_cert_enabled: The user_cert_enabled of this RadiusserversIdBody. # noqa: E501 + :type: bool + """ + + self._user_cert_enabled = user_cert_enabled + + @property + def user_lockout_action(self): + """Gets the user_lockout_action of this RadiusserversIdBody. # noqa: E501 + + + :return: The user_lockout_action of this RadiusserversIdBody. # noqa: E501 + :rtype: str + """ + return self._user_lockout_action + + @user_lockout_action.setter + def user_lockout_action(self, user_lockout_action): + """Sets the user_lockout_action of this RadiusserversIdBody. + + + :param user_lockout_action: The user_lockout_action of this RadiusserversIdBody. # noqa: E501 + :type: str + """ + + self._user_lockout_action = user_lockout_action + + @property + def user_password_enabled(self): + """Gets the user_password_enabled of this RadiusserversIdBody. # noqa: E501 + + + :return: The user_password_enabled of this RadiusserversIdBody. # noqa: E501 + :rtype: bool + """ + return self._user_password_enabled + + @user_password_enabled.setter + def user_password_enabled(self, user_password_enabled): + """Sets the user_password_enabled of this RadiusserversIdBody. + + + :param user_password_enabled: The user_password_enabled of this RadiusserversIdBody. # noqa: E501 + :type: bool + """ + + self._user_password_enabled = user_password_enabled + + @property + def user_password_expiration_action(self): + """Gets the user_password_expiration_action of this RadiusserversIdBody. # noqa: E501 + + + :return: The user_password_expiration_action of this RadiusserversIdBody. # noqa: E501 + :rtype: str + """ + return self._user_password_expiration_action + + @user_password_expiration_action.setter + def user_password_expiration_action(self, user_password_expiration_action): + """Sets the user_password_expiration_action of this RadiusserversIdBody. + + + :param user_password_expiration_action: The user_password_expiration_action of this RadiusserversIdBody. # noqa: E501 + :type: str + """ + + self._user_password_expiration_action = user_password_expiration_action + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(RadiusserversIdBody, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RadiusserversIdBody): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/radiusserverslist.py b/jcapiv1/jcapiv1/models/radiusserverslist.py index 38e5580..cbd2a3a 100644 --- a/jcapiv1/jcapiv1/models/radiusserverslist.py +++ b/jcapiv1/jcapiv1/models/radiusserverslist.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.radiusserver import Radiusserver # noqa: F401,E501 - - class Radiusserverslist(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,11 +39,9 @@ class Radiusserverslist(object): def __init__(self, results=None, total_count=None): # noqa: E501 """Radiusserverslist - a model defined in Swagger""" # noqa: E501 - self._results = None self._total_count = None self.discriminator = None - if results is not None: self.results = results if total_count is not None: diff --git a/jcapiv1/jcapiv1/models/search.py b/jcapiv1/jcapiv1/models/search.py index c888848..27576ce 100644 --- a/jcapiv1/jcapiv1/models/search.py +++ b/jcapiv1/jcapiv1/models/search.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class Search(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,12 +41,10 @@ class Search(object): def __init__(self, fields=None, filter=None, search_filter=None): # noqa: E501 """Search - a model defined in Swagger""" # noqa: E501 - self._fields = None self._filter = None self._search_filter = None self.discriminator = None - if fields is not None: self.fields = fields if filter is not None: diff --git a/jcapiv1/jcapiv1/models/sshkeylist.py b/jcapiv1/jcapiv1/models/sshkeylist.py index e9b3c28..72df8fa 100644 --- a/jcapiv1/jcapiv1/models/sshkeylist.py +++ b/jcapiv1/jcapiv1/models/sshkeylist.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class Sshkeylist(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -46,13 +43,11 @@ class Sshkeylist(object): def __init__(self, id=None, create_date=None, name=None, public_key=None): # noqa: E501 """Sshkeylist - a model defined in Swagger""" # noqa: E501 - self._id = None self._create_date = None self._name = None self._public_key = None self.discriminator = None - if id is not None: self.id = id if create_date is not None: diff --git a/jcapiv1/jcapiv1/models/sshkeypost.py b/jcapiv1/jcapiv1/models/sshkeypost.py index 728be4b..179bb54 100644 --- a/jcapiv1/jcapiv1/models/sshkeypost.py +++ b/jcapiv1/jcapiv1/models/sshkeypost.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class Sshkeypost(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,11 +39,9 @@ class Sshkeypost(object): def __init__(self, name=None, public_key=None): # noqa: E501 """Sshkeypost - a model defined in Swagger""" # noqa: E501 - self._name = None self._public_key = None self.discriminator = None - self.name = name self.public_key = public_key diff --git a/jcapiv1/jcapiv1/models/sso.py b/jcapiv1/jcapiv1/models/sso.py new file mode 100644 index 0000000..4babe93 --- /dev/null +++ b/jcapiv1/jcapiv1/models/sso.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Sso(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'beta': 'bool', + 'idp_cert_expiration_at': 'datetime', + 'jit': 'bool', + 'type': 'str' + } + + attribute_map = { + 'beta': 'beta', + 'idp_cert_expiration_at': 'idpCertExpirationAt', + 'jit': 'jit', + 'type': 'type' + } + + def __init__(self, beta=None, idp_cert_expiration_at=None, jit=None, type=None): # noqa: E501 + """Sso - a model defined in Swagger""" # noqa: E501 + self._beta = None + self._idp_cert_expiration_at = None + self._jit = None + self._type = None + self.discriminator = None + if beta is not None: + self.beta = beta + if idp_cert_expiration_at is not None: + self.idp_cert_expiration_at = idp_cert_expiration_at + if jit is not None: + self.jit = jit + if type is not None: + self.type = type + + @property + def beta(self): + """Gets the beta of this Sso. # noqa: E501 + + + :return: The beta of this Sso. # noqa: E501 + :rtype: bool + """ + return self._beta + + @beta.setter + def beta(self, beta): + """Sets the beta of this Sso. + + + :param beta: The beta of this Sso. # noqa: E501 + :type: bool + """ + + self._beta = beta + + @property + def idp_cert_expiration_at(self): + """Gets the idp_cert_expiration_at of this Sso. # noqa: E501 + + + :return: The idp_cert_expiration_at of this Sso. # noqa: E501 + :rtype: datetime + """ + return self._idp_cert_expiration_at + + @idp_cert_expiration_at.setter + def idp_cert_expiration_at(self, idp_cert_expiration_at): + """Sets the idp_cert_expiration_at of this Sso. + + + :param idp_cert_expiration_at: The idp_cert_expiration_at of this Sso. # noqa: E501 + :type: datetime + """ + + self._idp_cert_expiration_at = idp_cert_expiration_at + + @property + def jit(self): + """Gets the jit of this Sso. # noqa: E501 + + + :return: The jit of this Sso. # noqa: E501 + :rtype: bool + """ + return self._jit + + @jit.setter + def jit(self, jit): + """Sets the jit of this Sso. + + + :param jit: The jit of this Sso. # noqa: E501 + :type: bool + """ + + self._jit = jit + + @property + def type(self): + """Gets the type of this Sso. # noqa: E501 + + + :return: The type of this Sso. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Sso. + + + :param type: The type of this Sso. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Sso, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Sso): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/state_activate_body.py b/jcapiv1/jcapiv1/models/state_activate_body.py new file mode 100644 index 0000000..e107756 --- /dev/null +++ b/jcapiv1/jcapiv1/models/state_activate_body.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class StateActivateBody(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'email': 'object' + } + + attribute_map = { + 'email': 'email' + } + + def __init__(self, email=None): # noqa: E501 + """StateActivateBody - a model defined in Swagger""" # noqa: E501 + self._email = None + self.discriminator = None + if email is not None: + self.email = email + + @property + def email(self): + """Gets the email of this StateActivateBody. # noqa: E501 + + + :return: The email of this StateActivateBody. # noqa: E501 + :rtype: object + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this StateActivateBody. + + + :param email: The email of this StateActivateBody. # noqa: E501 + :type: object + """ + + self._email = email + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StateActivateBody, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StateActivateBody): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/system.py b/jcapiv1/jcapiv1/models/system.py index f54b813..64cdbf4 100644 --- a/jcapiv1/jcapiv1/models/system.py +++ b/jcapiv1/jcapiv1/models/system.py @@ -1,33 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.fde import Fde # noqa: F401,E501 -from jcapiv1.models.system_network_interfaces import SystemNetworkInterfaces # noqa: F401,E501 -from jcapiv1.models.system_sshd_params import SystemSshdParams # noqa: F401,E501 -from jcapiv1.models.system_system_insights import SystemSystemInsights # noqa: F401,E501 - - class System(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -45,23 +37,37 @@ class System(object): 'allow_ssh_root_login': 'bool', 'amazon_instance_id': 'str', 'arch': 'str', + 'azure_ad_joined': 'bool', + 'built_in_commands': 'list[SystemBuiltInCommands]', 'connection_history': 'list[object]', - 'created': 'str', + 'created': 'datetime', + 'description': 'str', + 'display_manager': 'str', 'display_name': 'str', + 'domain_info': 'SystemDomainInfo', 'fde': 'Fde', + 'file_system': 'str', + 'has_service_account': 'bool', 'hostname': 'str', - 'last_contact': 'str', + 'last_contact': 'datetime', + 'mdm': 'SystemMdm', 'modify_sshd_config': 'bool', 'network_interfaces': 'list[SystemNetworkInterfaces]', 'organization': 'str', 'os': 'str', + 'os_family': 'str', + 'os_version_detail': 'SystemOsVersionDetail', + 'provision_metadata': 'SystemProvisionMetadata', 'remote_ip': 'str', + 'serial_number': 'str', + 'service_account_state': 'SystemServiceAccountState', 'ssh_root_enabled': 'bool', 'sshd_params': 'list[SystemSshdParams]', 'system_insights': 'SystemSystemInsights', 'system_timezone': 'int', 'tags': 'list[str]', 'template_name': 'str', + 'user_metrics': 'list[SystemUserMetrics]', 'version': 'str' } @@ -75,29 +81,42 @@ class System(object): 'allow_ssh_root_login': 'allowSshRootLogin', 'amazon_instance_id': 'amazonInstanceID', 'arch': 'arch', + 'azure_ad_joined': 'azureAdJoined', + 'built_in_commands': 'builtInCommands', 'connection_history': 'connectionHistory', 'created': 'created', + 'description': 'description', + 'display_manager': 'displayManager', 'display_name': 'displayName', + 'domain_info': 'domainInfo', 'fde': 'fde', + 'file_system': 'fileSystem', + 'has_service_account': 'hasServiceAccount', 'hostname': 'hostname', 'last_contact': 'lastContact', + 'mdm': 'mdm', 'modify_sshd_config': 'modifySSHDConfig', 'network_interfaces': 'networkInterfaces', 'organization': 'organization', 'os': 'os', + 'os_family': 'osFamily', + 'os_version_detail': 'osVersionDetail', + 'provision_metadata': 'provisionMetadata', 'remote_ip': 'remoteIP', + 'serial_number': 'serialNumber', + 'service_account_state': 'serviceAccountState', 'ssh_root_enabled': 'sshRootEnabled', 'sshd_params': 'sshdParams', 'system_insights': 'systemInsights', 'system_timezone': 'systemTimezone', 'tags': 'tags', 'template_name': 'templateName', + 'user_metrics': 'userMetrics', 'version': 'version' } - def __init__(self, id=None, active=None, agent_version=None, allow_multi_factor_authentication=None, allow_public_key_authentication=None, allow_ssh_password_authentication=None, allow_ssh_root_login=None, amazon_instance_id=None, arch=None, connection_history=None, created=None, display_name=None, fde=None, hostname=None, last_contact=None, modify_sshd_config=None, network_interfaces=None, organization=None, os=None, remote_ip=None, ssh_root_enabled=None, sshd_params=None, system_insights=None, system_timezone=None, tags=None, template_name=None, version=None): # noqa: E501 + def __init__(self, id=None, active=None, agent_version=None, allow_multi_factor_authentication=None, allow_public_key_authentication=None, allow_ssh_password_authentication=None, allow_ssh_root_login=None, amazon_instance_id=None, arch=None, azure_ad_joined=None, built_in_commands=None, connection_history=None, created=None, description=None, display_manager=None, display_name=None, domain_info=None, fde=None, file_system=None, has_service_account=None, hostname=None, last_contact=None, mdm=None, modify_sshd_config=None, network_interfaces=None, organization=None, os=None, os_family=None, os_version_detail=None, provision_metadata=None, remote_ip=None, serial_number=None, service_account_state=None, ssh_root_enabled=None, sshd_params=None, system_insights=None, system_timezone=None, tags=None, template_name=None, user_metrics=None, version=None): # noqa: E501 """System - a model defined in Swagger""" # noqa: E501 - self._id = None self._active = None self._agent_version = None @@ -107,26 +126,39 @@ def __init__(self, id=None, active=None, agent_version=None, allow_multi_factor_ self._allow_ssh_root_login = None self._amazon_instance_id = None self._arch = None + self._azure_ad_joined = None + self._built_in_commands = None self._connection_history = None self._created = None + self._description = None + self._display_manager = None self._display_name = None + self._domain_info = None self._fde = None + self._file_system = None + self._has_service_account = None self._hostname = None self._last_contact = None + self._mdm = None self._modify_sshd_config = None self._network_interfaces = None self._organization = None self._os = None + self._os_family = None + self._os_version_detail = None + self._provision_metadata = None self._remote_ip = None + self._serial_number = None + self._service_account_state = None self._ssh_root_enabled = None self._sshd_params = None self._system_insights = None self._system_timezone = None self._tags = None self._template_name = None + self._user_metrics = None self._version = None self.discriminator = None - if id is not None: self.id = id if active is not None: @@ -145,18 +177,34 @@ def __init__(self, id=None, active=None, agent_version=None, allow_multi_factor_ self.amazon_instance_id = amazon_instance_id if arch is not None: self.arch = arch + if azure_ad_joined is not None: + self.azure_ad_joined = azure_ad_joined + if built_in_commands is not None: + self.built_in_commands = built_in_commands if connection_history is not None: self.connection_history = connection_history if created is not None: self.created = created + if description is not None: + self.description = description + if display_manager is not None: + self.display_manager = display_manager if display_name is not None: self.display_name = display_name + if domain_info is not None: + self.domain_info = domain_info if fde is not None: self.fde = fde + if file_system is not None: + self.file_system = file_system + if has_service_account is not None: + self.has_service_account = has_service_account if hostname is not None: self.hostname = hostname if last_contact is not None: self.last_contact = last_contact + if mdm is not None: + self.mdm = mdm if modify_sshd_config is not None: self.modify_sshd_config = modify_sshd_config if network_interfaces is not None: @@ -165,8 +213,18 @@ def __init__(self, id=None, active=None, agent_version=None, allow_multi_factor_ self.organization = organization if os is not None: self.os = os + if os_family is not None: + self.os_family = os_family + if os_version_detail is not None: + self.os_version_detail = os_version_detail + if provision_metadata is not None: + self.provision_metadata = provision_metadata if remote_ip is not None: self.remote_ip = remote_ip + if serial_number is not None: + self.serial_number = serial_number + if service_account_state is not None: + self.service_account_state = service_account_state if ssh_root_enabled is not None: self.ssh_root_enabled = ssh_root_enabled if sshd_params is not None: @@ -179,6 +237,8 @@ def __init__(self, id=None, active=None, agent_version=None, allow_multi_factor_ self.tags = tags if template_name is not None: self.template_name = template_name + if user_metrics is not None: + self.user_metrics = user_metrics if version is not None: self.version = version @@ -371,6 +431,48 @@ def arch(self, arch): self._arch = arch + @property + def azure_ad_joined(self): + """Gets the azure_ad_joined of this System. # noqa: E501 + + + :return: The azure_ad_joined of this System. # noqa: E501 + :rtype: bool + """ + return self._azure_ad_joined + + @azure_ad_joined.setter + def azure_ad_joined(self, azure_ad_joined): + """Sets the azure_ad_joined of this System. + + + :param azure_ad_joined: The azure_ad_joined of this System. # noqa: E501 + :type: bool + """ + + self._azure_ad_joined = azure_ad_joined + + @property + def built_in_commands(self): + """Gets the built_in_commands of this System. # noqa: E501 + + + :return: The built_in_commands of this System. # noqa: E501 + :rtype: list[SystemBuiltInCommands] + """ + return self._built_in_commands + + @built_in_commands.setter + def built_in_commands(self, built_in_commands): + """Sets the built_in_commands of this System. + + + :param built_in_commands: The built_in_commands of this System. # noqa: E501 + :type: list[SystemBuiltInCommands] + """ + + self._built_in_commands = built_in_commands + @property def connection_history(self): """Gets the connection_history of this System. # noqa: E501 @@ -398,7 +500,7 @@ def created(self): :return: The created of this System. # noqa: E501 - :rtype: str + :rtype: datetime """ return self._created @@ -408,11 +510,53 @@ def created(self, created): :param created: The created of this System. # noqa: E501 - :type: str + :type: datetime """ self._created = created + @property + def description(self): + """Gets the description of this System. # noqa: E501 + + + :return: The description of this System. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this System. + + + :param description: The description of this System. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def display_manager(self): + """Gets the display_manager of this System. # noqa: E501 + + + :return: The display_manager of this System. # noqa: E501 + :rtype: str + """ + return self._display_manager + + @display_manager.setter + def display_manager(self, display_manager): + """Sets the display_manager of this System. + + + :param display_manager: The display_manager of this System. # noqa: E501 + :type: str + """ + + self._display_manager = display_manager + @property def display_name(self): """Gets the display_name of this System. # noqa: E501 @@ -434,6 +578,27 @@ def display_name(self, display_name): self._display_name = display_name + @property + def domain_info(self): + """Gets the domain_info of this System. # noqa: E501 + + + :return: The domain_info of this System. # noqa: E501 + :rtype: SystemDomainInfo + """ + return self._domain_info + + @domain_info.setter + def domain_info(self, domain_info): + """Sets the domain_info of this System. + + + :param domain_info: The domain_info of this System. # noqa: E501 + :type: SystemDomainInfo + """ + + self._domain_info = domain_info + @property def fde(self): """Gets the fde of this System. # noqa: E501 @@ -455,6 +620,48 @@ def fde(self, fde): self._fde = fde + @property + def file_system(self): + """Gets the file_system of this System. # noqa: E501 + + + :return: The file_system of this System. # noqa: E501 + :rtype: str + """ + return self._file_system + + @file_system.setter + def file_system(self, file_system): + """Sets the file_system of this System. + + + :param file_system: The file_system of this System. # noqa: E501 + :type: str + """ + + self._file_system = file_system + + @property + def has_service_account(self): + """Gets the has_service_account of this System. # noqa: E501 + + + :return: The has_service_account of this System. # noqa: E501 + :rtype: bool + """ + return self._has_service_account + + @has_service_account.setter + def has_service_account(self, has_service_account): + """Sets the has_service_account of this System. + + + :param has_service_account: The has_service_account of this System. # noqa: E501 + :type: bool + """ + + self._has_service_account = has_service_account + @property def hostname(self): """Gets the hostname of this System. # noqa: E501 @@ -482,7 +689,7 @@ def last_contact(self): :return: The last_contact of this System. # noqa: E501 - :rtype: str + :rtype: datetime """ return self._last_contact @@ -492,11 +699,32 @@ def last_contact(self, last_contact): :param last_contact: The last_contact of this System. # noqa: E501 - :type: str + :type: datetime """ self._last_contact = last_contact + @property + def mdm(self): + """Gets the mdm of this System. # noqa: E501 + + + :return: The mdm of this System. # noqa: E501 + :rtype: SystemMdm + """ + return self._mdm + + @mdm.setter + def mdm(self, mdm): + """Sets the mdm of this System. + + + :param mdm: The mdm of this System. # noqa: E501 + :type: SystemMdm + """ + + self._mdm = mdm + @property def modify_sshd_config(self): """Gets the modify_sshd_config of this System. # noqa: E501 @@ -581,6 +809,69 @@ def os(self, os): self._os = os + @property + def os_family(self): + """Gets the os_family of this System. # noqa: E501 + + + :return: The os_family of this System. # noqa: E501 + :rtype: str + """ + return self._os_family + + @os_family.setter + def os_family(self, os_family): + """Sets the os_family of this System. + + + :param os_family: The os_family of this System. # noqa: E501 + :type: str + """ + + self._os_family = os_family + + @property + def os_version_detail(self): + """Gets the os_version_detail of this System. # noqa: E501 + + + :return: The os_version_detail of this System. # noqa: E501 + :rtype: SystemOsVersionDetail + """ + return self._os_version_detail + + @os_version_detail.setter + def os_version_detail(self, os_version_detail): + """Sets the os_version_detail of this System. + + + :param os_version_detail: The os_version_detail of this System. # noqa: E501 + :type: SystemOsVersionDetail + """ + + self._os_version_detail = os_version_detail + + @property + def provision_metadata(self): + """Gets the provision_metadata of this System. # noqa: E501 + + + :return: The provision_metadata of this System. # noqa: E501 + :rtype: SystemProvisionMetadata + """ + return self._provision_metadata + + @provision_metadata.setter + def provision_metadata(self, provision_metadata): + """Sets the provision_metadata of this System. + + + :param provision_metadata: The provision_metadata of this System. # noqa: E501 + :type: SystemProvisionMetadata + """ + + self._provision_metadata = provision_metadata + @property def remote_ip(self): """Gets the remote_ip of this System. # noqa: E501 @@ -602,6 +893,48 @@ def remote_ip(self, remote_ip): self._remote_ip = remote_ip + @property + def serial_number(self): + """Gets the serial_number of this System. # noqa: E501 + + + :return: The serial_number of this System. # noqa: E501 + :rtype: str + """ + return self._serial_number + + @serial_number.setter + def serial_number(self, serial_number): + """Sets the serial_number of this System. + + + :param serial_number: The serial_number of this System. # noqa: E501 + :type: str + """ + + self._serial_number = serial_number + + @property + def service_account_state(self): + """Gets the service_account_state of this System. # noqa: E501 + + + :return: The service_account_state of this System. # noqa: E501 + :rtype: SystemServiceAccountState + """ + return self._service_account_state + + @service_account_state.setter + def service_account_state(self, service_account_state): + """Sets the service_account_state of this System. + + + :param service_account_state: The service_account_state of this System. # noqa: E501 + :type: SystemServiceAccountState + """ + + self._service_account_state = service_account_state + @property def ssh_root_enabled(self): """Gets the ssh_root_enabled of this System. # noqa: E501 @@ -728,6 +1061,27 @@ def template_name(self, template_name): self._template_name = template_name + @property + def user_metrics(self): + """Gets the user_metrics of this System. # noqa: E501 + + + :return: The user_metrics of this System. # noqa: E501 + :rtype: list[SystemUserMetrics] + """ + return self._user_metrics + + @user_metrics.setter + def user_metrics(self, user_metrics): + """Sets the user_metrics of this System. + + + :param user_metrics: The user_metrics of this System. # noqa: E501 + :type: list[SystemUserMetrics] + """ + + self._user_metrics = user_metrics + @property def version(self): """Gets the version of this System. # noqa: E501 diff --git a/jcapiv1/jcapiv1/models/system_built_in_commands.py b/jcapiv1/jcapiv1/models/system_built_in_commands.py new file mode 100644 index 0000000..1d139b0 --- /dev/null +++ b/jcapiv1/jcapiv1/models/system_built_in_commands.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemBuiltInCommands(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'type': 'str' + } + + attribute_map = { + 'name': 'name', + 'type': 'type' + } + + def __init__(self, name=None, type=None): # noqa: E501 + """SystemBuiltInCommands - a model defined in Swagger""" # noqa: E501 + self._name = None + self._type = None + self.discriminator = None + if name is not None: + self.name = name + if type is not None: + self.type = type + + @property + def name(self): + """Gets the name of this SystemBuiltInCommands. # noqa: E501 + + + :return: The name of this SystemBuiltInCommands. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SystemBuiltInCommands. + + + :param name: The name of this SystemBuiltInCommands. # noqa: E501 + :type: str + """ + allowed_values = ["erase", "lock", "restart", "shutdown"] # noqa: E501 + if name not in allowed_values: + raise ValueError( + "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 + .format(name, allowed_values) + ) + + self._name = name + + @property + def type(self): + """Gets the type of this SystemBuiltInCommands. # noqa: E501 + + + :return: The type of this SystemBuiltInCommands. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SystemBuiltInCommands. + + + :param type: The type of this SystemBuiltInCommands. # noqa: E501 + :type: str + """ + allowed_values = ["security"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemBuiltInCommands, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemBuiltInCommands): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/system_domain_info.py b/jcapiv1/jcapiv1/models/system_domain_info.py new file mode 100644 index 0000000..c7f2ff9 --- /dev/null +++ b/jcapiv1/jcapiv1/models/system_domain_info.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemDomainInfo(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'domain_name': 'str', + 'part_of_domain': 'bool' + } + + attribute_map = { + 'domain_name': 'domainName', + 'part_of_domain': 'partOfDomain' + } + + def __init__(self, domain_name=None, part_of_domain=None): # noqa: E501 + """SystemDomainInfo - a model defined in Swagger""" # noqa: E501 + self._domain_name = None + self._part_of_domain = None + self.discriminator = None + if domain_name is not None: + self.domain_name = domain_name + if part_of_domain is not None: + self.part_of_domain = part_of_domain + + @property + def domain_name(self): + """Gets the domain_name of this SystemDomainInfo. # noqa: E501 + + + :return: The domain_name of this SystemDomainInfo. # noqa: E501 + :rtype: str + """ + return self._domain_name + + @domain_name.setter + def domain_name(self, domain_name): + """Sets the domain_name of this SystemDomainInfo. + + + :param domain_name: The domain_name of this SystemDomainInfo. # noqa: E501 + :type: str + """ + + self._domain_name = domain_name + + @property + def part_of_domain(self): + """Gets the part_of_domain of this SystemDomainInfo. # noqa: E501 + + + :return: The part_of_domain of this SystemDomainInfo. # noqa: E501 + :rtype: bool + """ + return self._part_of_domain + + @part_of_domain.setter + def part_of_domain(self, part_of_domain): + """Sets the part_of_domain of this SystemDomainInfo. + + + :param part_of_domain: The part_of_domain of this SystemDomainInfo. # noqa: E501 + :type: bool + """ + + self._part_of_domain = part_of_domain + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemDomainInfo, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemDomainInfo): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/system_mdm.py b/jcapiv1/jcapiv1/models/system_mdm.py new file mode 100644 index 0000000..4821dc4 --- /dev/null +++ b/jcapiv1/jcapiv1/models/system_mdm.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemMdm(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'dep': 'bool', + 'enrollment_type': 'str', + 'internal': 'SystemMdmInternal', + 'profile_identifier': 'str', + 'user_approved': 'bool', + 'vendor': 'str' + } + + attribute_map = { + 'dep': 'dep', + 'enrollment_type': 'enrollmentType', + 'internal': 'internal', + 'profile_identifier': 'profileIdentifier', + 'user_approved': 'userApproved', + 'vendor': 'vendor' + } + + def __init__(self, dep=None, enrollment_type=None, internal=None, profile_identifier=None, user_approved=None, vendor=None): # noqa: E501 + """SystemMdm - a model defined in Swagger""" # noqa: E501 + self._dep = None + self._enrollment_type = None + self._internal = None + self._profile_identifier = None + self._user_approved = None + self._vendor = None + self.discriminator = None + if dep is not None: + self.dep = dep + if enrollment_type is not None: + self.enrollment_type = enrollment_type + if internal is not None: + self.internal = internal + if profile_identifier is not None: + self.profile_identifier = profile_identifier + if user_approved is not None: + self.user_approved = user_approved + if vendor is not None: + self.vendor = vendor + + @property + def dep(self): + """Gets the dep of this SystemMdm. # noqa: E501 + + + :return: The dep of this SystemMdm. # noqa: E501 + :rtype: bool + """ + return self._dep + + @dep.setter + def dep(self, dep): + """Sets the dep of this SystemMdm. + + + :param dep: The dep of this SystemMdm. # noqa: E501 + :type: bool + """ + + self._dep = dep + + @property + def enrollment_type(self): + """Gets the enrollment_type of this SystemMdm. # noqa: E501 + + + :return: The enrollment_type of this SystemMdm. # noqa: E501 + :rtype: str + """ + return self._enrollment_type + + @enrollment_type.setter + def enrollment_type(self, enrollment_type): + """Sets the enrollment_type of this SystemMdm. + + + :param enrollment_type: The enrollment_type of this SystemMdm. # noqa: E501 + :type: str + """ + allowed_values = ["unknown", "automated device", "device", "user"] # noqa: E501 + if enrollment_type not in allowed_values: + raise ValueError( + "Invalid value for `enrollment_type` ({0}), must be one of {1}" # noqa: E501 + .format(enrollment_type, allowed_values) + ) + + self._enrollment_type = enrollment_type + + @property + def internal(self): + """Gets the internal of this SystemMdm. # noqa: E501 + + + :return: The internal of this SystemMdm. # noqa: E501 + :rtype: SystemMdmInternal + """ + return self._internal + + @internal.setter + def internal(self, internal): + """Sets the internal of this SystemMdm. + + + :param internal: The internal of this SystemMdm. # noqa: E501 + :type: SystemMdmInternal + """ + + self._internal = internal + + @property + def profile_identifier(self): + """Gets the profile_identifier of this SystemMdm. # noqa: E501 + + + :return: The profile_identifier of this SystemMdm. # noqa: E501 + :rtype: str + """ + return self._profile_identifier + + @profile_identifier.setter + def profile_identifier(self, profile_identifier): + """Sets the profile_identifier of this SystemMdm. + + + :param profile_identifier: The profile_identifier of this SystemMdm. # noqa: E501 + :type: str + """ + + self._profile_identifier = profile_identifier + + @property + def user_approved(self): + """Gets the user_approved of this SystemMdm. # noqa: E501 + + + :return: The user_approved of this SystemMdm. # noqa: E501 + :rtype: bool + """ + return self._user_approved + + @user_approved.setter + def user_approved(self, user_approved): + """Sets the user_approved of this SystemMdm. + + + :param user_approved: The user_approved of this SystemMdm. # noqa: E501 + :type: bool + """ + + self._user_approved = user_approved + + @property + def vendor(self): + """Gets the vendor of this SystemMdm. # noqa: E501 + + + :return: The vendor of this SystemMdm. # noqa: E501 + :rtype: str + """ + return self._vendor + + @vendor.setter + def vendor(self, vendor): + """Sets the vendor of this SystemMdm. + + + :param vendor: The vendor of this SystemMdm. # noqa: E501 + :type: str + """ + allowed_values = ["unknown", "none", "internal", "external"] # noqa: E501 + if vendor not in allowed_values: + raise ValueError( + "Invalid value for `vendor` ({0}), must be one of {1}" # noqa: E501 + .format(vendor, allowed_values) + ) + + self._vendor = vendor + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemMdm, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemMdm): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/system_mdm_internal.py b/jcapiv1/jcapiv1/models/system_mdm_internal.py new file mode 100644 index 0000000..c878980 --- /dev/null +++ b/jcapiv1/jcapiv1/models/system_mdm_internal.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemMdmInternal(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'device_id': 'str' + } + + attribute_map = { + 'device_id': 'deviceId' + } + + def __init__(self, device_id=None): # noqa: E501 + """SystemMdmInternal - a model defined in Swagger""" # noqa: E501 + self._device_id = None + self.discriminator = None + if device_id is not None: + self.device_id = device_id + + @property + def device_id(self): + """Gets the device_id of this SystemMdmInternal. # noqa: E501 + + + :return: The device_id of this SystemMdmInternal. # noqa: E501 + :rtype: str + """ + return self._device_id + + @device_id.setter + def device_id(self, device_id): + """Sets the device_id of this SystemMdmInternal. + + + :param device_id: The device_id of this SystemMdmInternal. # noqa: E501 + :type: str + """ + + self._device_id = device_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemMdmInternal, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemMdmInternal): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/system_network_interfaces.py b/jcapiv1/jcapiv1/models/system_network_interfaces.py index a9e1065..590c604 100644 --- a/jcapiv1/jcapiv1/models/system_network_interfaces.py +++ b/jcapiv1/jcapiv1/models/system_network_interfaces.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemNetworkInterfaces(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -46,13 +43,11 @@ class SystemNetworkInterfaces(object): def __init__(self, address=None, family=None, internal=None, name=None): # noqa: E501 """SystemNetworkInterfaces - a model defined in Swagger""" # noqa: E501 - self._address = None self._family = None self._internal = None self._name = None self.discriminator = None - if address is not None: self.address = address if family is not None: @@ -101,6 +96,12 @@ def family(self, family): :param family: The family of this SystemNetworkInterfaces. # noqa: E501 :type: str """ + allowed_values = ["IPv4", "IPv6"] # noqa: E501 + if family not in allowed_values: + raise ValueError( + "Invalid value for `family` ({0}), must be one of {1}" # noqa: E501 + .format(family, allowed_values) + ) self._family = family diff --git a/jcapiv1/jcapiv1/models/system_os_version_detail.py b/jcapiv1/jcapiv1/models/system_os_version_detail.py new file mode 100644 index 0000000..09e5246 --- /dev/null +++ b/jcapiv1/jcapiv1/models/system_os_version_detail.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemOsVersionDetail(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'major': 'str', + 'minor': 'str', + 'os_name': 'str', + 'patch': 'str', + 'release_name': 'str', + 'revision': 'str' + } + + attribute_map = { + 'major': 'major', + 'minor': 'minor', + 'os_name': 'osName', + 'patch': 'patch', + 'release_name': 'releaseName', + 'revision': 'revision' + } + + def __init__(self, major=None, minor=None, os_name=None, patch=None, release_name=None, revision=None): # noqa: E501 + """SystemOsVersionDetail - a model defined in Swagger""" # noqa: E501 + self._major = None + self._minor = None + self._os_name = None + self._patch = None + self._release_name = None + self._revision = None + self.discriminator = None + if major is not None: + self.major = major + if minor is not None: + self.minor = minor + if os_name is not None: + self.os_name = os_name + if patch is not None: + self.patch = patch + if release_name is not None: + self.release_name = release_name + if revision is not None: + self.revision = revision + + @property + def major(self): + """Gets the major of this SystemOsVersionDetail. # noqa: E501 + + + :return: The major of this SystemOsVersionDetail. # noqa: E501 + :rtype: str + """ + return self._major + + @major.setter + def major(self, major): + """Sets the major of this SystemOsVersionDetail. + + + :param major: The major of this SystemOsVersionDetail. # noqa: E501 + :type: str + """ + + self._major = major + + @property + def minor(self): + """Gets the minor of this SystemOsVersionDetail. # noqa: E501 + + + :return: The minor of this SystemOsVersionDetail. # noqa: E501 + :rtype: str + """ + return self._minor + + @minor.setter + def minor(self, minor): + """Sets the minor of this SystemOsVersionDetail. + + + :param minor: The minor of this SystemOsVersionDetail. # noqa: E501 + :type: str + """ + + self._minor = minor + + @property + def os_name(self): + """Gets the os_name of this SystemOsVersionDetail. # noqa: E501 + + + :return: The os_name of this SystemOsVersionDetail. # noqa: E501 + :rtype: str + """ + return self._os_name + + @os_name.setter + def os_name(self, os_name): + """Sets the os_name of this SystemOsVersionDetail. + + + :param os_name: The os_name of this SystemOsVersionDetail. # noqa: E501 + :type: str + """ + + self._os_name = os_name + + @property + def patch(self): + """Gets the patch of this SystemOsVersionDetail. # noqa: E501 + + + :return: The patch of this SystemOsVersionDetail. # noqa: E501 + :rtype: str + """ + return self._patch + + @patch.setter + def patch(self, patch): + """Sets the patch of this SystemOsVersionDetail. + + + :param patch: The patch of this SystemOsVersionDetail. # noqa: E501 + :type: str + """ + + self._patch = patch + + @property + def release_name(self): + """Gets the release_name of this SystemOsVersionDetail. # noqa: E501 + + + :return: The release_name of this SystemOsVersionDetail. # noqa: E501 + :rtype: str + """ + return self._release_name + + @release_name.setter + def release_name(self, release_name): + """Sets the release_name of this SystemOsVersionDetail. + + + :param release_name: The release_name of this SystemOsVersionDetail. # noqa: E501 + :type: str + """ + + self._release_name = release_name + + @property + def revision(self): + """Gets the revision of this SystemOsVersionDetail. # noqa: E501 + + + :return: The revision of this SystemOsVersionDetail. # noqa: E501 + :rtype: str + """ + return self._revision + + @revision.setter + def revision(self, revision): + """Sets the revision of this SystemOsVersionDetail. + + + :param revision: The revision of this SystemOsVersionDetail. # noqa: E501 + :type: str + """ + + self._revision = revision + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemOsVersionDetail, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemOsVersionDetail): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/system_provision_metadata.py b/jcapiv1/jcapiv1/models/system_provision_metadata.py new file mode 100644 index 0000000..bbff884 --- /dev/null +++ b/jcapiv1/jcapiv1/models/system_provision_metadata.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemProvisionMetadata(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'provisioner': 'SystemProvisionMetadataProvisioner' + } + + attribute_map = { + 'provisioner': 'provisioner' + } + + def __init__(self, provisioner=None): # noqa: E501 + """SystemProvisionMetadata - a model defined in Swagger""" # noqa: E501 + self._provisioner = None + self.discriminator = None + if provisioner is not None: + self.provisioner = provisioner + + @property + def provisioner(self): + """Gets the provisioner of this SystemProvisionMetadata. # noqa: E501 + + + :return: The provisioner of this SystemProvisionMetadata. # noqa: E501 + :rtype: SystemProvisionMetadataProvisioner + """ + return self._provisioner + + @provisioner.setter + def provisioner(self, provisioner): + """Sets the provisioner of this SystemProvisionMetadata. + + + :param provisioner: The provisioner of this SystemProvisionMetadata. # noqa: E501 + :type: SystemProvisionMetadataProvisioner + """ + + self._provisioner = provisioner + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemProvisionMetadata, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemProvisionMetadata): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/system_provision_metadata_provisioner.py b/jcapiv1/jcapiv1/models/system_provision_metadata_provisioner.py new file mode 100644 index 0000000..3a2c711 --- /dev/null +++ b/jcapiv1/jcapiv1/models/system_provision_metadata_provisioner.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemProvisionMetadataProvisioner(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'provisioner_id': 'str', + 'type': 'str' + } + + attribute_map = { + 'provisioner_id': 'provisionerId', + 'type': 'type' + } + + def __init__(self, provisioner_id=None, type='administrator'): # noqa: E501 + """SystemProvisionMetadataProvisioner - a model defined in Swagger""" # noqa: E501 + self._provisioner_id = None + self._type = None + self.discriminator = None + if provisioner_id is not None: + self.provisioner_id = provisioner_id + if type is not None: + self.type = type + + @property + def provisioner_id(self): + """Gets the provisioner_id of this SystemProvisionMetadataProvisioner. # noqa: E501 + + + :return: The provisioner_id of this SystemProvisionMetadataProvisioner. # noqa: E501 + :rtype: str + """ + return self._provisioner_id + + @provisioner_id.setter + def provisioner_id(self, provisioner_id): + """Sets the provisioner_id of this SystemProvisionMetadataProvisioner. + + + :param provisioner_id: The provisioner_id of this SystemProvisionMetadataProvisioner. # noqa: E501 + :type: str + """ + + self._provisioner_id = provisioner_id + + @property + def type(self): + """Gets the type of this SystemProvisionMetadataProvisioner. # noqa: E501 + + + :return: The type of this SystemProvisionMetadataProvisioner. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SystemProvisionMetadataProvisioner. + + + :param type: The type of this SystemProvisionMetadataProvisioner. # noqa: E501 + :type: str + """ + allowed_values = ["administrator", "mdm", "user"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemProvisionMetadataProvisioner, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemProvisionMetadataProvisioner): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/system_service_account_state.py b/jcapiv1/jcapiv1/models/system_service_account_state.py new file mode 100644 index 0000000..f9e3250 --- /dev/null +++ b/jcapiv1/jcapiv1/models/system_service_account_state.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemServiceAccountState(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'has_secure_token': 'bool', + 'password_apfs_valid': 'bool', + 'password_od_valid': 'bool' + } + + attribute_map = { + 'has_secure_token': 'hasSecureToken', + 'password_apfs_valid': 'passwordAPFSValid', + 'password_od_valid': 'passwordODValid' + } + + def __init__(self, has_secure_token=None, password_apfs_valid=None, password_od_valid=None): # noqa: E501 + """SystemServiceAccountState - a model defined in Swagger""" # noqa: E501 + self._has_secure_token = None + self._password_apfs_valid = None + self._password_od_valid = None + self.discriminator = None + if has_secure_token is not None: + self.has_secure_token = has_secure_token + if password_apfs_valid is not None: + self.password_apfs_valid = password_apfs_valid + if password_od_valid is not None: + self.password_od_valid = password_od_valid + + @property + def has_secure_token(self): + """Gets the has_secure_token of this SystemServiceAccountState. # noqa: E501 + + + :return: The has_secure_token of this SystemServiceAccountState. # noqa: E501 + :rtype: bool + """ + return self._has_secure_token + + @has_secure_token.setter + def has_secure_token(self, has_secure_token): + """Sets the has_secure_token of this SystemServiceAccountState. + + + :param has_secure_token: The has_secure_token of this SystemServiceAccountState. # noqa: E501 + :type: bool + """ + + self._has_secure_token = has_secure_token + + @property + def password_apfs_valid(self): + """Gets the password_apfs_valid of this SystemServiceAccountState. # noqa: E501 + + + :return: The password_apfs_valid of this SystemServiceAccountState. # noqa: E501 + :rtype: bool + """ + return self._password_apfs_valid + + @password_apfs_valid.setter + def password_apfs_valid(self, password_apfs_valid): + """Sets the password_apfs_valid of this SystemServiceAccountState. + + + :param password_apfs_valid: The password_apfs_valid of this SystemServiceAccountState. # noqa: E501 + :type: bool + """ + + self._password_apfs_valid = password_apfs_valid + + @property + def password_od_valid(self): + """Gets the password_od_valid of this SystemServiceAccountState. # noqa: E501 + + + :return: The password_od_valid of this SystemServiceAccountState. # noqa: E501 + :rtype: bool + """ + return self._password_od_valid + + @password_od_valid.setter + def password_od_valid(self, password_od_valid): + """Sets the password_od_valid of this SystemServiceAccountState. + + + :param password_od_valid: The password_od_valid of this SystemServiceAccountState. # noqa: E501 + :type: bool + """ + + self._password_od_valid = password_od_valid + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemServiceAccountState, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemServiceAccountState): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/system_sshd_params.py b/jcapiv1/jcapiv1/models/system_sshd_params.py index cb57d50..eeae3f9 100644 --- a/jcapiv1/jcapiv1/models/system_sshd_params.py +++ b/jcapiv1/jcapiv1/models/system_sshd_params.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemSshdParams(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,11 +39,9 @@ class SystemSshdParams(object): def __init__(self, name=None, value=None): # noqa: E501 """SystemSshdParams - a model defined in Swagger""" # noqa: E501 - self._name = None self._value = None self.discriminator = None - if name is not None: self.name = name if value is not None: diff --git a/jcapiv1/jcapiv1/models/system_system_insights.py b/jcapiv1/jcapiv1/models/system_system_insights.py index 30065e2..47f30d4 100644 --- a/jcapiv1/jcapiv1/models/system_system_insights.py +++ b/jcapiv1/jcapiv1/models/system_system_insights.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemSystemInsights(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,10 +37,8 @@ class SystemSystemInsights(object): def __init__(self, state=None): # noqa: E501 """SystemSystemInsights - a model defined in Swagger""" # noqa: E501 - self._state = None self.discriminator = None - if state is not None: self.state = state diff --git a/jcapiv1/jcapiv1/models/system_user_metrics.py b/jcapiv1/jcapiv1/models/system_user_metrics.py new file mode 100644 index 0000000..6e298ca --- /dev/null +++ b/jcapiv1/jcapiv1/models/system_user_metrics.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemUserMetrics(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'admin': 'bool', + 'managed': 'bool', + 'secure_token_enabled': 'bool', + 'suspended': 'bool', + 'user_name': 'str' + } + + attribute_map = { + 'admin': 'admin', + 'managed': 'managed', + 'secure_token_enabled': 'secureTokenEnabled', + 'suspended': 'suspended', + 'user_name': 'userName' + } + + def __init__(self, admin=None, managed=None, secure_token_enabled=None, suspended=None, user_name=None): # noqa: E501 + """SystemUserMetrics - a model defined in Swagger""" # noqa: E501 + self._admin = None + self._managed = None + self._secure_token_enabled = None + self._suspended = None + self._user_name = None + self.discriminator = None + if admin is not None: + self.admin = admin + if managed is not None: + self.managed = managed + if secure_token_enabled is not None: + self.secure_token_enabled = secure_token_enabled + if suspended is not None: + self.suspended = suspended + if user_name is not None: + self.user_name = user_name + + @property + def admin(self): + """Gets the admin of this SystemUserMetrics. # noqa: E501 + + + :return: The admin of this SystemUserMetrics. # noqa: E501 + :rtype: bool + """ + return self._admin + + @admin.setter + def admin(self, admin): + """Sets the admin of this SystemUserMetrics. + + + :param admin: The admin of this SystemUserMetrics. # noqa: E501 + :type: bool + """ + + self._admin = admin + + @property + def managed(self): + """Gets the managed of this SystemUserMetrics. # noqa: E501 + + + :return: The managed of this SystemUserMetrics. # noqa: E501 + :rtype: bool + """ + return self._managed + + @managed.setter + def managed(self, managed): + """Sets the managed of this SystemUserMetrics. + + + :param managed: The managed of this SystemUserMetrics. # noqa: E501 + :type: bool + """ + + self._managed = managed + + @property + def secure_token_enabled(self): + """Gets the secure_token_enabled of this SystemUserMetrics. # noqa: E501 + + + :return: The secure_token_enabled of this SystemUserMetrics. # noqa: E501 + :rtype: bool + """ + return self._secure_token_enabled + + @secure_token_enabled.setter + def secure_token_enabled(self, secure_token_enabled): + """Sets the secure_token_enabled of this SystemUserMetrics. + + + :param secure_token_enabled: The secure_token_enabled of this SystemUserMetrics. # noqa: E501 + :type: bool + """ + + self._secure_token_enabled = secure_token_enabled + + @property + def suspended(self): + """Gets the suspended of this SystemUserMetrics. # noqa: E501 + + + :return: The suspended of this SystemUserMetrics. # noqa: E501 + :rtype: bool + """ + return self._suspended + + @suspended.setter + def suspended(self, suspended): + """Sets the suspended of this SystemUserMetrics. + + + :param suspended: The suspended of this SystemUserMetrics. # noqa: E501 + :type: bool + """ + + self._suspended = suspended + + @property + def user_name(self): + """Gets the user_name of this SystemUserMetrics. # noqa: E501 + + + :return: The user_name of this SystemUserMetrics. # noqa: E501 + :rtype: str + """ + return self._user_name + + @user_name.setter + def user_name(self, user_name): + """Sets the user_name of this SystemUserMetrics. + + + :param user_name: The user_name of this SystemUserMetrics. # noqa: E501 + :type: str + """ + + self._user_name = user_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemUserMetrics, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemUserMetrics): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/systemput.py b/jcapiv1/jcapiv1/models/systemput.py index 8528e2d..a798221 100644 --- a/jcapiv1/jcapiv1/models/systemput.py +++ b/jcapiv1/jcapiv1/models/systemput.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.systemput_agent_bound_messages import SystemputAgentBoundMessages # noqa: F401,E501 - - class Systemput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -54,7 +49,6 @@ class Systemput(object): def __init__(self, agent_bound_messages=None, allow_multi_factor_authentication=None, allow_public_key_authentication=None, allow_ssh_password_authentication=None, allow_ssh_root_login=None, display_name=None, tags=None): # noqa: E501 """Systemput - a model defined in Swagger""" # noqa: E501 - self._agent_bound_messages = None self._allow_multi_factor_authentication = None self._allow_public_key_authentication = None @@ -63,7 +57,6 @@ def __init__(self, agent_bound_messages=None, allow_multi_factor_authentication= self._display_name = None self._tags = None self.discriminator = None - if agent_bound_messages is not None: self.agent_bound_messages = agent_bound_messages if allow_multi_factor_authentication is not None: diff --git a/jcapiv1/jcapiv1/models/systemput_agent_bound_messages.py b/jcapiv1/jcapiv1/models/systemput_agent_bound_messages.py index d0d0e04..daa3071 100644 --- a/jcapiv1/jcapiv1/models/systemput_agent_bound_messages.py +++ b/jcapiv1/jcapiv1/models/systemput_agent_bound_messages.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemputAgentBoundMessages(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,10 +37,8 @@ class SystemputAgentBoundMessages(object): def __init__(self, cmd=None): # noqa: E501 """SystemputAgentBoundMessages - a model defined in Swagger""" # noqa: E501 - self._cmd = None self.discriminator = None - if cmd is not None: self.cmd = cmd diff --git a/jcapiv1/jcapiv1/models/systemslist.py b/jcapiv1/jcapiv1/models/systemslist.py index 030376b..e5e1860 100644 --- a/jcapiv1/jcapiv1/models/systemslist.py +++ b/jcapiv1/jcapiv1/models/systemslist.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.system import System # noqa: F401,E501 - - class Systemslist(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,11 +39,9 @@ class Systemslist(object): def __init__(self, results=None, total_count=None): # noqa: E501 """Systemslist - a model defined in Swagger""" # noqa: E501 - self._results = None self._total_count = None self.discriminator = None - if results is not None: self.results = results if total_count is not None: diff --git a/jcapiv1/jcapiv1/models/systemuser.py b/jcapiv1/jcapiv1/models/systemuser.py deleted file mode 100644 index cf766e0..0000000 --- a/jcapiv1/jcapiv1/models/systemuser.py +++ /dev/null @@ -1,1194 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - -from jcapiv1.models.mfa import Mfa # noqa: F401,E501 -from jcapiv1.models.sshkeylist import Sshkeylist # noqa: F401,E501 - - -class Systemuser(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'str', - 'account_locked': 'bool', - 'activated': 'bool', - 'allow_public_key': 'bool', - 'associated_tag_count': 'int', - 'attributes': 'list[object]', - 'company': 'str', - 'cost_center': 'str', - 'created': 'str', - 'department': 'str', - 'description': 'str', - 'displayname': 'str', - 'email': 'str', - 'employee_identifier': 'str', - 'employee_type': 'str', - 'enable_managed_uid': 'bool', - 'enable_user_portal_multifactor': 'bool', - 'external_dn': 'str', - 'external_source_type': 'str', - 'externally_managed': 'bool', - 'firstname': 'str', - 'job_title': 'str', - 'lastname': 'str', - 'ldap_binding_user': 'bool', - 'location': 'str', - 'mfa': 'Mfa', - 'middlename': 'str', - 'password_expiration_date': 'str', - 'password_expired': 'bool', - 'password_never_expires': 'bool', - 'passwordless_sudo': 'bool', - 'public_key': 'str', - 'samba_service_user': 'bool', - 'ssh_keys': 'list[Sshkeylist]', - 'sudo': 'bool', - 'suspended': 'bool', - 'tags': 'list[str]', - 'totp_enabled': 'bool', - 'unix_guid': 'int', - 'unix_uid': 'int', - 'username': 'str' - } - - attribute_map = { - 'id': '_id', - 'account_locked': 'account_locked', - 'activated': 'activated', - 'allow_public_key': 'allow_public_key', - 'associated_tag_count': 'associatedTagCount', - 'attributes': 'attributes', - 'company': 'company', - 'cost_center': 'costCenter', - 'created': 'created', - 'department': 'department', - 'description': 'description', - 'displayname': 'displayname', - 'email': 'email', - 'employee_identifier': 'employeeIdentifier', - 'employee_type': 'employeeType', - 'enable_managed_uid': 'enable_managed_uid', - 'enable_user_portal_multifactor': 'enable_user_portal_multifactor', - 'external_dn': 'external_dn', - 'external_source_type': 'external_source_type', - 'externally_managed': 'externally_managed', - 'firstname': 'firstname', - 'job_title': 'jobTitle', - 'lastname': 'lastname', - 'ldap_binding_user': 'ldap_binding_user', - 'location': 'location', - 'mfa': 'mfa', - 'middlename': 'middlename', - 'password_expiration_date': 'password_expiration_date', - 'password_expired': 'password_expired', - 'password_never_expires': 'password_never_expires', - 'passwordless_sudo': 'passwordless_sudo', - 'public_key': 'public_key', - 'samba_service_user': 'samba_service_user', - 'ssh_keys': 'ssh_keys', - 'sudo': 'sudo', - 'suspended': 'suspended', - 'tags': 'tags', - 'totp_enabled': 'totp_enabled', - 'unix_guid': 'unix_guid', - 'unix_uid': 'unix_uid', - 'username': 'username' - } - - def __init__(self, id=None, account_locked=None, activated=None, allow_public_key=None, associated_tag_count=None, attributes=None, company=None, cost_center=None, created=None, department=None, description=None, displayname=None, email=None, employee_identifier=None, employee_type=None, enable_managed_uid=None, enable_user_portal_multifactor=None, external_dn=None, external_source_type=None, externally_managed=None, firstname=None, job_title=None, lastname=None, ldap_binding_user=None, location=None, mfa=None, middlename=None, password_expiration_date=None, password_expired=None, password_never_expires=None, passwordless_sudo=None, public_key=None, samba_service_user=None, ssh_keys=None, sudo=None, suspended=None, tags=None, totp_enabled=None, unix_guid=None, unix_uid=None, username=None): # noqa: E501 - """Systemuser - a model defined in Swagger""" # noqa: E501 - - self._id = None - self._account_locked = None - self._activated = None - self._allow_public_key = None - self._associated_tag_count = None - self._attributes = None - self._company = None - self._cost_center = None - self._created = None - self._department = None - self._description = None - self._displayname = None - self._email = None - self._employee_identifier = None - self._employee_type = None - self._enable_managed_uid = None - self._enable_user_portal_multifactor = None - self._external_dn = None - self._external_source_type = None - self._externally_managed = None - self._firstname = None - self._job_title = None - self._lastname = None - self._ldap_binding_user = None - self._location = None - self._mfa = None - self._middlename = None - self._password_expiration_date = None - self._password_expired = None - self._password_never_expires = None - self._passwordless_sudo = None - self._public_key = None - self._samba_service_user = None - self._ssh_keys = None - self._sudo = None - self._suspended = None - self._tags = None - self._totp_enabled = None - self._unix_guid = None - self._unix_uid = None - self._username = None - self.discriminator = None - - if id is not None: - self.id = id - if account_locked is not None: - self.account_locked = account_locked - if activated is not None: - self.activated = activated - if allow_public_key is not None: - self.allow_public_key = allow_public_key - if associated_tag_count is not None: - self.associated_tag_count = associated_tag_count - if attributes is not None: - self.attributes = attributes - if company is not None: - self.company = company - if cost_center is not None: - self.cost_center = cost_center - if created is not None: - self.created = created - if department is not None: - self.department = department - if description is not None: - self.description = description - if displayname is not None: - self.displayname = displayname - if email is not None: - self.email = email - if employee_identifier is not None: - self.employee_identifier = employee_identifier - if employee_type is not None: - self.employee_type = employee_type - if enable_managed_uid is not None: - self.enable_managed_uid = enable_managed_uid - if enable_user_portal_multifactor is not None: - self.enable_user_portal_multifactor = enable_user_portal_multifactor - if external_dn is not None: - self.external_dn = external_dn - if external_source_type is not None: - self.external_source_type = external_source_type - if externally_managed is not None: - self.externally_managed = externally_managed - if firstname is not None: - self.firstname = firstname - if job_title is not None: - self.job_title = job_title - if lastname is not None: - self.lastname = lastname - if ldap_binding_user is not None: - self.ldap_binding_user = ldap_binding_user - if location is not None: - self.location = location - if mfa is not None: - self.mfa = mfa - if middlename is not None: - self.middlename = middlename - if password_expiration_date is not None: - self.password_expiration_date = password_expiration_date - if password_expired is not None: - self.password_expired = password_expired - if password_never_expires is not None: - self.password_never_expires = password_never_expires - if passwordless_sudo is not None: - self.passwordless_sudo = passwordless_sudo - if public_key is not None: - self.public_key = public_key - if samba_service_user is not None: - self.samba_service_user = samba_service_user - if ssh_keys is not None: - self.ssh_keys = ssh_keys - if sudo is not None: - self.sudo = sudo - if suspended is not None: - self.suspended = suspended - if tags is not None: - self.tags = tags - if totp_enabled is not None: - self.totp_enabled = totp_enabled - if unix_guid is not None: - self.unix_guid = unix_guid - if unix_uid is not None: - self.unix_uid = unix_uid - if username is not None: - self.username = username - - @property - def id(self): - """Gets the id of this Systemuser. # noqa: E501 - - - :return: The id of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Systemuser. - - - :param id: The id of this Systemuser. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def account_locked(self): - """Gets the account_locked of this Systemuser. # noqa: E501 - - - :return: The account_locked of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._account_locked - - @account_locked.setter - def account_locked(self, account_locked): - """Sets the account_locked of this Systemuser. - - - :param account_locked: The account_locked of this Systemuser. # noqa: E501 - :type: bool - """ - - self._account_locked = account_locked - - @property - def activated(self): - """Gets the activated of this Systemuser. # noqa: E501 - - - :return: The activated of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._activated - - @activated.setter - def activated(self, activated): - """Sets the activated of this Systemuser. - - - :param activated: The activated of this Systemuser. # noqa: E501 - :type: bool - """ - - self._activated = activated - - @property - def allow_public_key(self): - """Gets the allow_public_key of this Systemuser. # noqa: E501 - - - :return: The allow_public_key of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._allow_public_key - - @allow_public_key.setter - def allow_public_key(self, allow_public_key): - """Sets the allow_public_key of this Systemuser. - - - :param allow_public_key: The allow_public_key of this Systemuser. # noqa: E501 - :type: bool - """ - - self._allow_public_key = allow_public_key - - @property - def associated_tag_count(self): - """Gets the associated_tag_count of this Systemuser. # noqa: E501 - - - :return: The associated_tag_count of this Systemuser. # noqa: E501 - :rtype: int - """ - return self._associated_tag_count - - @associated_tag_count.setter - def associated_tag_count(self, associated_tag_count): - """Sets the associated_tag_count of this Systemuser. - - - :param associated_tag_count: The associated_tag_count of this Systemuser. # noqa: E501 - :type: int - """ - if associated_tag_count is not None and associated_tag_count < 0: # noqa: E501 - raise ValueError("Invalid value for `associated_tag_count`, must be a value greater than or equal to `0`") # noqa: E501 - - self._associated_tag_count = associated_tag_count - - @property - def attributes(self): - """Gets the attributes of this Systemuser. # noqa: E501 - - - :return: The attributes of this Systemuser. # noqa: E501 - :rtype: list[object] - """ - return self._attributes - - @attributes.setter - def attributes(self, attributes): - """Sets the attributes of this Systemuser. - - - :param attributes: The attributes of this Systemuser. # noqa: E501 - :type: list[object] - """ - - self._attributes = attributes - - @property - def company(self): - """Gets the company of this Systemuser. # noqa: E501 - - - :return: The company of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._company - - @company.setter - def company(self, company): - """Sets the company of this Systemuser. - - - :param company: The company of this Systemuser. # noqa: E501 - :type: str - """ - if company is not None and len(company) > 1024: - raise ValueError("Invalid value for `company`, length must be less than or equal to `1024`") # noqa: E501 - - self._company = company - - @property - def cost_center(self): - """Gets the cost_center of this Systemuser. # noqa: E501 - - - :return: The cost_center of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._cost_center - - @cost_center.setter - def cost_center(self, cost_center): - """Sets the cost_center of this Systemuser. - - - :param cost_center: The cost_center of this Systemuser. # noqa: E501 - :type: str - """ - if cost_center is not None and len(cost_center) > 1024: - raise ValueError("Invalid value for `cost_center`, length must be less than or equal to `1024`") # noqa: E501 - - self._cost_center = cost_center - - @property - def created(self): - """Gets the created of this Systemuser. # noqa: E501 - - - :return: The created of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._created - - @created.setter - def created(self, created): - """Sets the created of this Systemuser. - - - :param created: The created of this Systemuser. # noqa: E501 - :type: str - """ - - self._created = created - - @property - def department(self): - """Gets the department of this Systemuser. # noqa: E501 - - - :return: The department of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._department - - @department.setter - def department(self, department): - """Sets the department of this Systemuser. - - - :param department: The department of this Systemuser. # noqa: E501 - :type: str - """ - if department is not None and len(department) > 1024: - raise ValueError("Invalid value for `department`, length must be less than or equal to `1024`") # noqa: E501 - - self._department = department - - @property - def description(self): - """Gets the description of this Systemuser. # noqa: E501 - - - :return: The description of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this Systemuser. - - - :param description: The description of this Systemuser. # noqa: E501 - :type: str - """ - if description is not None and len(description) > 1024: - raise ValueError("Invalid value for `description`, length must be less than or equal to `1024`") # noqa: E501 - - self._description = description - - @property - def displayname(self): - """Gets the displayname of this Systemuser. # noqa: E501 - - - :return: The displayname of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._displayname - - @displayname.setter - def displayname(self, displayname): - """Sets the displayname of this Systemuser. - - - :param displayname: The displayname of this Systemuser. # noqa: E501 - :type: str - """ - if displayname is not None and len(displayname) > 1024: - raise ValueError("Invalid value for `displayname`, length must be less than or equal to `1024`") # noqa: E501 - - self._displayname = displayname - - @property - def email(self): - """Gets the email of this Systemuser. # noqa: E501 - - - :return: The email of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._email - - @email.setter - def email(self, email): - """Sets the email of this Systemuser. - - - :param email: The email of this Systemuser. # noqa: E501 - :type: str - """ - if email is not None and len(email) > 1024: - raise ValueError("Invalid value for `email`, length must be less than or equal to `1024`") # noqa: E501 - - self._email = email - - @property - def employee_identifier(self): - """Gets the employee_identifier of this Systemuser. # noqa: E501 - - Must be unique per user. # noqa: E501 - - :return: The employee_identifier of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._employee_identifier - - @employee_identifier.setter - def employee_identifier(self, employee_identifier): - """Sets the employee_identifier of this Systemuser. - - Must be unique per user. # noqa: E501 - - :param employee_identifier: The employee_identifier of this Systemuser. # noqa: E501 - :type: str - """ - if employee_identifier is not None and len(employee_identifier) > 256: - raise ValueError("Invalid value for `employee_identifier`, length must be less than or equal to `256`") # noqa: E501 - - self._employee_identifier = employee_identifier - - @property - def employee_type(self): - """Gets the employee_type of this Systemuser. # noqa: E501 - - - :return: The employee_type of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._employee_type - - @employee_type.setter - def employee_type(self, employee_type): - """Sets the employee_type of this Systemuser. - - - :param employee_type: The employee_type of this Systemuser. # noqa: E501 - :type: str - """ - if employee_type is not None and len(employee_type) > 1024: - raise ValueError("Invalid value for `employee_type`, length must be less than or equal to `1024`") # noqa: E501 - - self._employee_type = employee_type - - @property - def enable_managed_uid(self): - """Gets the enable_managed_uid of this Systemuser. # noqa: E501 - - - :return: The enable_managed_uid of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._enable_managed_uid - - @enable_managed_uid.setter - def enable_managed_uid(self, enable_managed_uid): - """Sets the enable_managed_uid of this Systemuser. - - - :param enable_managed_uid: The enable_managed_uid of this Systemuser. # noqa: E501 - :type: bool - """ - - self._enable_managed_uid = enable_managed_uid - - @property - def enable_user_portal_multifactor(self): - """Gets the enable_user_portal_multifactor of this Systemuser. # noqa: E501 - - - :return: The enable_user_portal_multifactor of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._enable_user_portal_multifactor - - @enable_user_portal_multifactor.setter - def enable_user_portal_multifactor(self, enable_user_portal_multifactor): - """Sets the enable_user_portal_multifactor of this Systemuser. - - - :param enable_user_portal_multifactor: The enable_user_portal_multifactor of this Systemuser. # noqa: E501 - :type: bool - """ - - self._enable_user_portal_multifactor = enable_user_portal_multifactor - - @property - def external_dn(self): - """Gets the external_dn of this Systemuser. # noqa: E501 - - - :return: The external_dn of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._external_dn - - @external_dn.setter - def external_dn(self, external_dn): - """Sets the external_dn of this Systemuser. - - - :param external_dn: The external_dn of this Systemuser. # noqa: E501 - :type: str - """ - - self._external_dn = external_dn - - @property - def external_source_type(self): - """Gets the external_source_type of this Systemuser. # noqa: E501 - - - :return: The external_source_type of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._external_source_type - - @external_source_type.setter - def external_source_type(self, external_source_type): - """Sets the external_source_type of this Systemuser. - - - :param external_source_type: The external_source_type of this Systemuser. # noqa: E501 - :type: str - """ - - self._external_source_type = external_source_type - - @property - def externally_managed(self): - """Gets the externally_managed of this Systemuser. # noqa: E501 - - - :return: The externally_managed of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._externally_managed - - @externally_managed.setter - def externally_managed(self, externally_managed): - """Sets the externally_managed of this Systemuser. - - - :param externally_managed: The externally_managed of this Systemuser. # noqa: E501 - :type: bool - """ - - self._externally_managed = externally_managed - - @property - def firstname(self): - """Gets the firstname of this Systemuser. # noqa: E501 - - - :return: The firstname of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._firstname - - @firstname.setter - def firstname(self, firstname): - """Sets the firstname of this Systemuser. - - - :param firstname: The firstname of this Systemuser. # noqa: E501 - :type: str - """ - if firstname is not None and len(firstname) > 1024: - raise ValueError("Invalid value for `firstname`, length must be less than or equal to `1024`") # noqa: E501 - - self._firstname = firstname - - @property - def job_title(self): - """Gets the job_title of this Systemuser. # noqa: E501 - - - :return: The job_title of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._job_title - - @job_title.setter - def job_title(self, job_title): - """Sets the job_title of this Systemuser. - - - :param job_title: The job_title of this Systemuser. # noqa: E501 - :type: str - """ - if job_title is not None and len(job_title) > 1024: - raise ValueError("Invalid value for `job_title`, length must be less than or equal to `1024`") # noqa: E501 - - self._job_title = job_title - - @property - def lastname(self): - """Gets the lastname of this Systemuser. # noqa: E501 - - - :return: The lastname of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._lastname - - @lastname.setter - def lastname(self, lastname): - """Sets the lastname of this Systemuser. - - - :param lastname: The lastname of this Systemuser. # noqa: E501 - :type: str - """ - if lastname is not None and len(lastname) > 1024: - raise ValueError("Invalid value for `lastname`, length must be less than or equal to `1024`") # noqa: E501 - - self._lastname = lastname - - @property - def ldap_binding_user(self): - """Gets the ldap_binding_user of this Systemuser. # noqa: E501 - - - :return: The ldap_binding_user of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._ldap_binding_user - - @ldap_binding_user.setter - def ldap_binding_user(self, ldap_binding_user): - """Sets the ldap_binding_user of this Systemuser. - - - :param ldap_binding_user: The ldap_binding_user of this Systemuser. # noqa: E501 - :type: bool - """ - - self._ldap_binding_user = ldap_binding_user - - @property - def location(self): - """Gets the location of this Systemuser. # noqa: E501 - - - :return: The location of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._location - - @location.setter - def location(self, location): - """Sets the location of this Systemuser. - - - :param location: The location of this Systemuser. # noqa: E501 - :type: str - """ - if location is not None and len(location) > 1024: - raise ValueError("Invalid value for `location`, length must be less than or equal to `1024`") # noqa: E501 - - self._location = location - - @property - def mfa(self): - """Gets the mfa of this Systemuser. # noqa: E501 - - - :return: The mfa of this Systemuser. # noqa: E501 - :rtype: Mfa - """ - return self._mfa - - @mfa.setter - def mfa(self, mfa): - """Sets the mfa of this Systemuser. - - - :param mfa: The mfa of this Systemuser. # noqa: E501 - :type: Mfa - """ - - self._mfa = mfa - - @property - def middlename(self): - """Gets the middlename of this Systemuser. # noqa: E501 - - - :return: The middlename of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._middlename - - @middlename.setter - def middlename(self, middlename): - """Sets the middlename of this Systemuser. - - - :param middlename: The middlename of this Systemuser. # noqa: E501 - :type: str - """ - if middlename is not None and len(middlename) > 1024: - raise ValueError("Invalid value for `middlename`, length must be less than or equal to `1024`") # noqa: E501 - - self._middlename = middlename - - @property - def password_expiration_date(self): - """Gets the password_expiration_date of this Systemuser. # noqa: E501 - - - :return: The password_expiration_date of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._password_expiration_date - - @password_expiration_date.setter - def password_expiration_date(self, password_expiration_date): - """Sets the password_expiration_date of this Systemuser. - - - :param password_expiration_date: The password_expiration_date of this Systemuser. # noqa: E501 - :type: str - """ - - self._password_expiration_date = password_expiration_date - - @property - def password_expired(self): - """Gets the password_expired of this Systemuser. # noqa: E501 - - - :return: The password_expired of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._password_expired - - @password_expired.setter - def password_expired(self, password_expired): - """Sets the password_expired of this Systemuser. - - - :param password_expired: The password_expired of this Systemuser. # noqa: E501 - :type: bool - """ - - self._password_expired = password_expired - - @property - def password_never_expires(self): - """Gets the password_never_expires of this Systemuser. # noqa: E501 - - - :return: The password_never_expires of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._password_never_expires - - @password_never_expires.setter - def password_never_expires(self, password_never_expires): - """Sets the password_never_expires of this Systemuser. - - - :param password_never_expires: The password_never_expires of this Systemuser. # noqa: E501 - :type: bool - """ - - self._password_never_expires = password_never_expires - - @property - def passwordless_sudo(self): - """Gets the passwordless_sudo of this Systemuser. # noqa: E501 - - - :return: The passwordless_sudo of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._passwordless_sudo - - @passwordless_sudo.setter - def passwordless_sudo(self, passwordless_sudo): - """Sets the passwordless_sudo of this Systemuser. - - - :param passwordless_sudo: The passwordless_sudo of this Systemuser. # noqa: E501 - :type: bool - """ - - self._passwordless_sudo = passwordless_sudo - - @property - def public_key(self): - """Gets the public_key of this Systemuser. # noqa: E501 - - - :return: The public_key of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._public_key - - @public_key.setter - def public_key(self, public_key): - """Sets the public_key of this Systemuser. - - - :param public_key: The public_key of this Systemuser. # noqa: E501 - :type: str - """ - - self._public_key = public_key - - @property - def samba_service_user(self): - """Gets the samba_service_user of this Systemuser. # noqa: E501 - - - :return: The samba_service_user of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._samba_service_user - - @samba_service_user.setter - def samba_service_user(self, samba_service_user): - """Sets the samba_service_user of this Systemuser. - - - :param samba_service_user: The samba_service_user of this Systemuser. # noqa: E501 - :type: bool - """ - - self._samba_service_user = samba_service_user - - @property - def ssh_keys(self): - """Gets the ssh_keys of this Systemuser. # noqa: E501 - - - :return: The ssh_keys of this Systemuser. # noqa: E501 - :rtype: list[Sshkeylist] - """ - return self._ssh_keys - - @ssh_keys.setter - def ssh_keys(self, ssh_keys): - """Sets the ssh_keys of this Systemuser. - - - :param ssh_keys: The ssh_keys of this Systemuser. # noqa: E501 - :type: list[Sshkeylist] - """ - - self._ssh_keys = ssh_keys - - @property - def sudo(self): - """Gets the sudo of this Systemuser. # noqa: E501 - - - :return: The sudo of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._sudo - - @sudo.setter - def sudo(self, sudo): - """Sets the sudo of this Systemuser. - - - :param sudo: The sudo of this Systemuser. # noqa: E501 - :type: bool - """ - - self._sudo = sudo - - @property - def suspended(self): - """Gets the suspended of this Systemuser. # noqa: E501 - - - :return: The suspended of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._suspended - - @suspended.setter - def suspended(self, suspended): - """Sets the suspended of this Systemuser. - - - :param suspended: The suspended of this Systemuser. # noqa: E501 - :type: bool - """ - - self._suspended = suspended - - @property - def tags(self): - """Gets the tags of this Systemuser. # noqa: E501 - - - :return: The tags of this Systemuser. # noqa: E501 - :rtype: list[str] - """ - return self._tags - - @tags.setter - def tags(self, tags): - """Sets the tags of this Systemuser. - - - :param tags: The tags of this Systemuser. # noqa: E501 - :type: list[str] - """ - - self._tags = tags - - @property - def totp_enabled(self): - """Gets the totp_enabled of this Systemuser. # noqa: E501 - - - :return: The totp_enabled of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._totp_enabled - - @totp_enabled.setter - def totp_enabled(self, totp_enabled): - """Sets the totp_enabled of this Systemuser. - - - :param totp_enabled: The totp_enabled of this Systemuser. # noqa: E501 - :type: bool - """ - - self._totp_enabled = totp_enabled - - @property - def unix_guid(self): - """Gets the unix_guid of this Systemuser. # noqa: E501 - - - :return: The unix_guid of this Systemuser. # noqa: E501 - :rtype: int - """ - return self._unix_guid - - @unix_guid.setter - def unix_guid(self, unix_guid): - """Sets the unix_guid of this Systemuser. - - - :param unix_guid: The unix_guid of this Systemuser. # noqa: E501 - :type: int - """ - if unix_guid is not None and unix_guid < 1: # noqa: E501 - raise ValueError("Invalid value for `unix_guid`, must be a value greater than or equal to `1`") # noqa: E501 - - self._unix_guid = unix_guid - - @property - def unix_uid(self): - """Gets the unix_uid of this Systemuser. # noqa: E501 - - - :return: The unix_uid of this Systemuser. # noqa: E501 - :rtype: int - """ - return self._unix_uid - - @unix_uid.setter - def unix_uid(self, unix_uid): - """Sets the unix_uid of this Systemuser. - - - :param unix_uid: The unix_uid of this Systemuser. # noqa: E501 - :type: int - """ - if unix_uid is not None and unix_uid < 1: # noqa: E501 - raise ValueError("Invalid value for `unix_uid`, must be a value greater than or equal to `1`") # noqa: E501 - - self._unix_uid = unix_uid - - @property - def username(self): - """Gets the username of this Systemuser. # noqa: E501 - - - :return: The username of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._username - - @username.setter - def username(self, username): - """Sets the username of this Systemuser. - - - :param username: The username of this Systemuser. # noqa: E501 - :type: str - """ - if username is not None and len(username) > 1024: - raise ValueError("Invalid value for `username`, length must be less than or equal to `1024`") # noqa: E501 - - self._username = username - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Systemuser, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Systemuser): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv1/jcapiv1/models/systemuserbinding.py b/jcapiv1/jcapiv1/models/systemuserbinding.py deleted file mode 100644 index c178ac9..0000000 --- a/jcapiv1/jcapiv1/models/systemuserbinding.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Systemuserbinding(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """Systemuserbinding - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Systemuserbinding, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Systemuserbinding): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv1/jcapiv1/models/systemuserbindingsput.py b/jcapiv1/jcapiv1/models/systemuserbindingsput.py deleted file mode 100644 index 44eeb12..0000000 --- a/jcapiv1/jcapiv1/models/systemuserbindingsput.py +++ /dev/null @@ -1,147 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Systemuserbindingsput(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'add': 'list[str]', - 'remove': 'list[str]' - } - - attribute_map = { - 'add': 'add', - 'remove': 'remove' - } - - def __init__(self, add=None, remove=None): # noqa: E501 - """Systemuserbindingsput - a model defined in Swagger""" # noqa: E501 - - self._add = None - self._remove = None - self.discriminator = None - - self.add = add - self.remove = remove - - @property - def add(self): - """Gets the add of this Systemuserbindingsput. # noqa: E501 - - The list of systemuser ids to be added to this system. # noqa: E501 - - :return: The add of this Systemuserbindingsput. # noqa: E501 - :rtype: list[str] - """ - return self._add - - @add.setter - def add(self, add): - """Sets the add of this Systemuserbindingsput. - - The list of systemuser ids to be added to this system. # noqa: E501 - - :param add: The add of this Systemuserbindingsput. # noqa: E501 - :type: list[str] - """ - if add is None: - raise ValueError("Invalid value for `add`, must not be `None`") # noqa: E501 - - self._add = add - - @property - def remove(self): - """Gets the remove of this Systemuserbindingsput. # noqa: E501 - - The list of systemuser ids to be removed from this system. # noqa: E501 - - :return: The remove of this Systemuserbindingsput. # noqa: E501 - :rtype: list[str] - """ - return self._remove - - @remove.setter - def remove(self, remove): - """Sets the remove of this Systemuserbindingsput. - - The list of systemuser ids to be removed from this system. # noqa: E501 - - :param remove: The remove of this Systemuserbindingsput. # noqa: E501 - :type: list[str] - """ - if remove is None: - raise ValueError("Invalid value for `remove`, must not be `None`") # noqa: E501 - - self._remove = remove - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Systemuserbindingsput, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Systemuserbindingsput): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv1/jcapiv1/models/systemuserput.py b/jcapiv1/jcapiv1/models/systemuserput.py index 706183a..49cc5e6 100644 --- a/jcapiv1/jcapiv1/models/systemuserput.py +++ b/jcapiv1/jcapiv1/models/systemuserput.py @@ -1,33 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.mfa import Mfa # noqa: F401,E501 -from jcapiv1.models.sshkeypost import Sshkeypost # noqa: F401,E501 -from jcapiv1.models.systemuserput_addresses import SystemuserputAddresses # noqa: F401,E501 -from jcapiv1.models.systemuserput_phone_numbers import SystemuserputPhoneNumbers # noqa: F401,E501 - - class Systemuserput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -39,11 +31,13 @@ class Systemuserput(object): 'account_locked': 'bool', 'addresses': 'list[SystemuserputAddresses]', 'allow_public_key': 'bool', - 'attributes': 'list[object]', + 'alternate_email': 'str', + 'attributes': 'list[SystemuserputAttributes]', 'company': 'str', 'cost_center': 'str', 'department': 'str', 'description': 'str', + 'disable_device_max_login_attempts': 'bool', 'displayname': 'str', 'email': 'str', 'employee_identifier': 'str', @@ -51,6 +45,7 @@ class Systemuserput(object): 'enable_managed_uid': 'bool', 'enable_user_portal_multifactor': 'bool', 'external_dn': 'str', + 'external_password_expiration_date': 'str', 'external_source_type': 'str', 'externally_managed': 'bool', 'firstname': 'str', @@ -58,15 +53,18 @@ class Systemuserput(object): 'lastname': 'str', 'ldap_binding_user': 'bool', 'location': 'str', + 'managed_apple_id': 'str', + 'manager': 'str', 'mfa': 'Mfa', 'middlename': 'str', 'password': 'str', 'password_never_expires': 'bool', 'phone_numbers': 'list[SystemuserputPhoneNumbers]', 'public_key': 'str', - 'relationships': 'list[object]', + 'relationships': 'list[SystemuserputRelationships]', 'samba_service_user': 'bool', 'ssh_keys': 'list[Sshkeypost]', + 'state': 'str', 'sudo': 'bool', 'suspended': 'bool', 'tags': 'list[str]', @@ -79,11 +77,13 @@ class Systemuserput(object): 'account_locked': 'account_locked', 'addresses': 'addresses', 'allow_public_key': 'allow_public_key', + 'alternate_email': 'alternateEmail', 'attributes': 'attributes', 'company': 'company', 'cost_center': 'costCenter', 'department': 'department', 'description': 'description', + 'disable_device_max_login_attempts': 'disableDeviceMaxLoginAttempts', 'displayname': 'displayname', 'email': 'email', 'employee_identifier': 'employeeIdentifier', @@ -91,6 +91,7 @@ class Systemuserput(object): 'enable_managed_uid': 'enable_managed_uid', 'enable_user_portal_multifactor': 'enable_user_portal_multifactor', 'external_dn': 'external_dn', + 'external_password_expiration_date': 'external_password_expiration_date', 'external_source_type': 'external_source_type', 'externally_managed': 'externally_managed', 'firstname': 'firstname', @@ -98,6 +99,8 @@ class Systemuserput(object): 'lastname': 'lastname', 'ldap_binding_user': 'ldap_binding_user', 'location': 'location', + 'managed_apple_id': 'managedAppleId', + 'manager': 'manager', 'mfa': 'mfa', 'middlename': 'middlename', 'password': 'password', @@ -107,6 +110,7 @@ class Systemuserput(object): 'relationships': 'relationships', 'samba_service_user': 'samba_service_user', 'ssh_keys': 'ssh_keys', + 'state': 'state', 'sudo': 'sudo', 'suspended': 'suspended', 'tags': 'tags', @@ -115,17 +119,18 @@ class Systemuserput(object): 'username': 'username' } - def __init__(self, account_locked=None, addresses=None, allow_public_key=None, attributes=None, company=None, cost_center=None, department=None, description=None, displayname=None, email=None, employee_identifier=None, employee_type=None, enable_managed_uid=None, enable_user_portal_multifactor=None, external_dn=None, external_source_type=None, externally_managed=None, firstname=None, job_title=None, lastname=None, ldap_binding_user=None, location=None, mfa=None, middlename=None, password=None, password_never_expires=None, phone_numbers=None, public_key=None, relationships=None, samba_service_user=None, ssh_keys=None, sudo=None, suspended=None, tags=None, unix_guid=None, unix_uid=None, username=None): # noqa: E501 + def __init__(self, account_locked=None, addresses=None, allow_public_key=None, alternate_email=None, attributes=None, company=None, cost_center=None, department=None, description=None, disable_device_max_login_attempts=None, displayname=None, email=None, employee_identifier=None, employee_type=None, enable_managed_uid=None, enable_user_portal_multifactor=None, external_dn=None, external_password_expiration_date=None, external_source_type=None, externally_managed=None, firstname=None, job_title=None, lastname=None, ldap_binding_user=None, location=None, managed_apple_id=None, manager=None, mfa=None, middlename=None, password=None, password_never_expires=None, phone_numbers=None, public_key=None, relationships=None, samba_service_user=None, ssh_keys=None, state=None, sudo=None, suspended=None, tags=None, unix_guid=None, unix_uid=None, username=None): # noqa: E501 """Systemuserput - a model defined in Swagger""" # noqa: E501 - self._account_locked = None self._addresses = None self._allow_public_key = None + self._alternate_email = None self._attributes = None self._company = None self._cost_center = None self._department = None self._description = None + self._disable_device_max_login_attempts = None self._displayname = None self._email = None self._employee_identifier = None @@ -133,6 +138,7 @@ def __init__(self, account_locked=None, addresses=None, allow_public_key=None, a self._enable_managed_uid = None self._enable_user_portal_multifactor = None self._external_dn = None + self._external_password_expiration_date = None self._external_source_type = None self._externally_managed = None self._firstname = None @@ -140,6 +146,8 @@ def __init__(self, account_locked=None, addresses=None, allow_public_key=None, a self._lastname = None self._ldap_binding_user = None self._location = None + self._managed_apple_id = None + self._manager = None self._mfa = None self._middlename = None self._password = None @@ -149,6 +157,7 @@ def __init__(self, account_locked=None, addresses=None, allow_public_key=None, a self._relationships = None self._samba_service_user = None self._ssh_keys = None + self._state = None self._sudo = None self._suspended = None self._tags = None @@ -156,13 +165,14 @@ def __init__(self, account_locked=None, addresses=None, allow_public_key=None, a self._unix_uid = None self._username = None self.discriminator = None - if account_locked is not None: self.account_locked = account_locked if addresses is not None: self.addresses = addresses if allow_public_key is not None: self.allow_public_key = allow_public_key + if alternate_email is not None: + self.alternate_email = alternate_email if attributes is not None: self.attributes = attributes if company is not None: @@ -173,6 +183,8 @@ def __init__(self, account_locked=None, addresses=None, allow_public_key=None, a self.department = department if description is not None: self.description = description + if disable_device_max_login_attempts is not None: + self.disable_device_max_login_attempts = disable_device_max_login_attempts if displayname is not None: self.displayname = displayname if email is not None: @@ -187,6 +199,8 @@ def __init__(self, account_locked=None, addresses=None, allow_public_key=None, a self.enable_user_portal_multifactor = enable_user_portal_multifactor if external_dn is not None: self.external_dn = external_dn + if external_password_expiration_date is not None: + self.external_password_expiration_date = external_password_expiration_date if external_source_type is not None: self.external_source_type = external_source_type if externally_managed is not None: @@ -201,6 +215,10 @@ def __init__(self, account_locked=None, addresses=None, allow_public_key=None, a self.ldap_binding_user = ldap_binding_user if location is not None: self.location = location + if managed_apple_id is not None: + self.managed_apple_id = managed_apple_id + if manager is not None: + self.manager = manager if mfa is not None: self.mfa = mfa if middlename is not None: @@ -219,6 +237,8 @@ def __init__(self, account_locked=None, addresses=None, allow_public_key=None, a self.samba_service_user = samba_service_user if ssh_keys is not None: self.ssh_keys = ssh_keys + if state is not None: + self.state = state if sudo is not None: self.sudo = sudo if suspended is not None: @@ -297,13 +317,34 @@ def allow_public_key(self, allow_public_key): self._allow_public_key = allow_public_key + @property + def alternate_email(self): + """Gets the alternate_email of this Systemuserput. # noqa: E501 + + + :return: The alternate_email of this Systemuserput. # noqa: E501 + :rtype: str + """ + return self._alternate_email + + @alternate_email.setter + def alternate_email(self, alternate_email): + """Sets the alternate_email of this Systemuserput. + + + :param alternate_email: The alternate_email of this Systemuserput. # noqa: E501 + :type: str + """ + + self._alternate_email = alternate_email + @property def attributes(self): """Gets the attributes of this Systemuserput. # noqa: E501 :return: The attributes of this Systemuserput. # noqa: E501 - :rtype: list[object] + :rtype: list[SystemuserputAttributes] """ return self._attributes @@ -313,7 +354,7 @@ def attributes(self, attributes): :param attributes: The attributes of this Systemuserput. # noqa: E501 - :type: list[object] + :type: list[SystemuserputAttributes] """ self._attributes = attributes @@ -336,8 +377,6 @@ def company(self, company): :param company: The company of this Systemuserput. # noqa: E501 :type: str """ - if company is not None and len(company) > 1024: - raise ValueError("Invalid value for `company`, length must be less than or equal to `1024`") # noqa: E501 self._company = company @@ -359,8 +398,6 @@ def cost_center(self, cost_center): :param cost_center: The cost_center of this Systemuserput. # noqa: E501 :type: str """ - if cost_center is not None and len(cost_center) > 1024: - raise ValueError("Invalid value for `cost_center`, length must be less than or equal to `1024`") # noqa: E501 self._cost_center = cost_center @@ -382,8 +419,6 @@ def department(self, department): :param department: The department of this Systemuserput. # noqa: E501 :type: str """ - if department is not None and len(department) > 1024: - raise ValueError("Invalid value for `department`, length must be less than or equal to `1024`") # noqa: E501 self._department = department @@ -405,11 +440,30 @@ def description(self, description): :param description: The description of this Systemuserput. # noqa: E501 :type: str """ - if description is not None and len(description) > 1024: - raise ValueError("Invalid value for `description`, length must be less than or equal to `1024`") # noqa: E501 self._description = description + @property + def disable_device_max_login_attempts(self): + """Gets the disable_device_max_login_attempts of this Systemuserput. # noqa: E501 + + + :return: The disable_device_max_login_attempts of this Systemuserput. # noqa: E501 + :rtype: bool + """ + return self._disable_device_max_login_attempts + + @disable_device_max_login_attempts.setter + def disable_device_max_login_attempts(self, disable_device_max_login_attempts): + """Sets the disable_device_max_login_attempts of this Systemuserput. + + + :param disable_device_max_login_attempts: The disable_device_max_login_attempts of this Systemuserput. # noqa: E501 + :type: bool + """ + + self._disable_device_max_login_attempts = disable_device_max_login_attempts + @property def displayname(self): """Gets the displayname of this Systemuserput. # noqa: E501 @@ -428,8 +482,6 @@ def displayname(self, displayname): :param displayname: The displayname of this Systemuserput. # noqa: E501 :type: str """ - if displayname is not None and len(displayname) > 1024: - raise ValueError("Invalid value for `displayname`, length must be less than or equal to `1024`") # noqa: E501 self._displayname = displayname @@ -451,8 +503,6 @@ def email(self, email): :param email: The email of this Systemuserput. # noqa: E501 :type: str """ - if email is not None and len(email) > 1024: - raise ValueError("Invalid value for `email`, length must be less than or equal to `1024`") # noqa: E501 self._email = email @@ -476,8 +526,6 @@ def employee_identifier(self, employee_identifier): :param employee_identifier: The employee_identifier of this Systemuserput. # noqa: E501 :type: str """ - if employee_identifier is not None and len(employee_identifier) > 256: - raise ValueError("Invalid value for `employee_identifier`, length must be less than or equal to `256`") # noqa: E501 self._employee_identifier = employee_identifier @@ -499,8 +547,6 @@ def employee_type(self, employee_type): :param employee_type: The employee_type of this Systemuserput. # noqa: E501 :type: str """ - if employee_type is not None and len(employee_type) > 1024: - raise ValueError("Invalid value for `employee_type`, length must be less than or equal to `1024`") # noqa: E501 self._employee_type = employee_type @@ -567,6 +613,27 @@ def external_dn(self, external_dn): self._external_dn = external_dn + @property + def external_password_expiration_date(self): + """Gets the external_password_expiration_date of this Systemuserput. # noqa: E501 + + + :return: The external_password_expiration_date of this Systemuserput. # noqa: E501 + :rtype: str + """ + return self._external_password_expiration_date + + @external_password_expiration_date.setter + def external_password_expiration_date(self, external_password_expiration_date): + """Sets the external_password_expiration_date of this Systemuserput. + + + :param external_password_expiration_date: The external_password_expiration_date of this Systemuserput. # noqa: E501 + :type: str + """ + + self._external_password_expiration_date = external_password_expiration_date + @property def external_source_type(self): """Gets the external_source_type of this Systemuserput. # noqa: E501 @@ -627,8 +694,6 @@ def firstname(self, firstname): :param firstname: The firstname of this Systemuserput. # noqa: E501 :type: str """ - if firstname is not None and len(firstname) > 1024: - raise ValueError("Invalid value for `firstname`, length must be less than or equal to `1024`") # noqa: E501 self._firstname = firstname @@ -650,8 +715,6 @@ def job_title(self, job_title): :param job_title: The job_title of this Systemuserput. # noqa: E501 :type: str """ - if job_title is not None and len(job_title) > 1024: - raise ValueError("Invalid value for `job_title`, length must be less than or equal to `1024`") # noqa: E501 self._job_title = job_title @@ -673,8 +736,6 @@ def lastname(self, lastname): :param lastname: The lastname of this Systemuserput. # noqa: E501 :type: str """ - if lastname is not None and len(lastname) > 1024: - raise ValueError("Invalid value for `lastname`, length must be less than or equal to `1024`") # noqa: E501 self._lastname = lastname @@ -717,11 +778,53 @@ def location(self, location): :param location: The location of this Systemuserput. # noqa: E501 :type: str """ - if location is not None and len(location) > 1024: - raise ValueError("Invalid value for `location`, length must be less than or equal to `1024`") # noqa: E501 self._location = location + @property + def managed_apple_id(self): + """Gets the managed_apple_id of this Systemuserput. # noqa: E501 + + + :return: The managed_apple_id of this Systemuserput. # noqa: E501 + :rtype: str + """ + return self._managed_apple_id + + @managed_apple_id.setter + def managed_apple_id(self, managed_apple_id): + """Sets the managed_apple_id of this Systemuserput. + + + :param managed_apple_id: The managed_apple_id of this Systemuserput. # noqa: E501 + :type: str + """ + + self._managed_apple_id = managed_apple_id + + @property + def manager(self): + """Gets the manager of this Systemuserput. # noqa: E501 + + Relation with another systemuser to identify the last as a manager. # noqa: E501 + + :return: The manager of this Systemuserput. # noqa: E501 + :rtype: str + """ + return self._manager + + @manager.setter + def manager(self, manager): + """Sets the manager of this Systemuserput. + + Relation with another systemuser to identify the last as a manager. # noqa: E501 + + :param manager: The manager of this Systemuserput. # noqa: E501 + :type: str + """ + + self._manager = manager + @property def mfa(self): """Gets the mfa of this Systemuserput. # noqa: E501 @@ -761,8 +864,6 @@ def middlename(self, middlename): :param middlename: The middlename of this Systemuserput. # noqa: E501 :type: str """ - if middlename is not None and len(middlename) > 1024: - raise ValueError("Invalid value for `middlename`, length must be less than or equal to `1024`") # noqa: E501 self._middlename = middlename @@ -856,7 +957,7 @@ def relationships(self): :return: The relationships of this Systemuserput. # noqa: E501 - :rtype: list[object] + :rtype: list[SystemuserputRelationships] """ return self._relationships @@ -866,7 +967,7 @@ def relationships(self, relationships): :param relationships: The relationships of this Systemuserput. # noqa: E501 - :type: list[object] + :type: list[SystemuserputRelationships] """ self._relationships = relationships @@ -913,6 +1014,33 @@ def ssh_keys(self, ssh_keys): self._ssh_keys = ssh_keys + @property + def state(self): + """Gets the state of this Systemuserput. # noqa: E501 + + + :return: The state of this Systemuserput. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this Systemuserput. + + + :param state: The state of this Systemuserput. # noqa: E501 + :type: str + """ + allowed_values = ["ACTIVATED", "SUSPENDED"] # noqa: E501 + if state not in allowed_values: + raise ValueError( + "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 + .format(state, allowed_values) + ) + + self._state = state + @property def sudo(self): """Gets the sudo of this Systemuserput. # noqa: E501 @@ -994,8 +1122,6 @@ def unix_guid(self, unix_guid): :param unix_guid: The unix_guid of this Systemuserput. # noqa: E501 :type: int """ - if unix_guid is not None and unix_guid < 1: # noqa: E501 - raise ValueError("Invalid value for `unix_guid`, must be a value greater than or equal to `1`") # noqa: E501 self._unix_guid = unix_guid @@ -1017,8 +1143,6 @@ def unix_uid(self, unix_uid): :param unix_uid: The unix_uid of this Systemuserput. # noqa: E501 :type: int """ - if unix_uid is not None and unix_uid < 1: # noqa: E501 - raise ValueError("Invalid value for `unix_uid`, must be a value greater than or equal to `1`") # noqa: E501 self._unix_uid = unix_uid @@ -1040,8 +1164,6 @@ def username(self, username): :param username: The username of this Systemuserput. # noqa: E501 :type: str """ - if username is not None and len(username) > 1024: - raise ValueError("Invalid value for `username`, length must be less than or equal to `1024`") # noqa: E501 self._username = username diff --git a/jcapiv1/jcapiv1/models/systemuserput_addresses.py b/jcapiv1/jcapiv1/models/systemuserput_addresses.py index 25c2ed6..e4c6a7d 100644 --- a/jcapiv1/jcapiv1/models/systemuserput_addresses.py +++ b/jcapiv1/jcapiv1/models/systemuserput_addresses.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemuserputAddresses(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -54,7 +51,6 @@ class SystemuserputAddresses(object): def __init__(self, country=None, extended_address=None, locality=None, po_box=None, postal_code=None, region=None, street_address=None, type=None): # noqa: E501 """SystemuserputAddresses - a model defined in Swagger""" # noqa: E501 - self._country = None self._extended_address = None self._locality = None @@ -64,7 +60,6 @@ def __init__(self, country=None, extended_address=None, locality=None, po_box=No self._street_address = None self._type = None self.discriminator = None - if country is not None: self.country = country if extended_address is not None: @@ -100,8 +95,6 @@ def country(self, country): :param country: The country of this SystemuserputAddresses. # noqa: E501 :type: str """ - if country is not None and len(country) > 1024: - raise ValueError("Invalid value for `country`, length must be less than or equal to `1024`") # noqa: E501 self._country = country @@ -123,8 +116,6 @@ def extended_address(self, extended_address): :param extended_address: The extended_address of this SystemuserputAddresses. # noqa: E501 :type: str """ - if extended_address is not None and len(extended_address) > 1024: - raise ValueError("Invalid value for `extended_address`, length must be less than or equal to `1024`") # noqa: E501 self._extended_address = extended_address @@ -146,8 +137,6 @@ def locality(self, locality): :param locality: The locality of this SystemuserputAddresses. # noqa: E501 :type: str """ - if locality is not None and len(locality) > 1024: - raise ValueError("Invalid value for `locality`, length must be less than or equal to `1024`") # noqa: E501 self._locality = locality @@ -169,8 +158,6 @@ def po_box(self, po_box): :param po_box: The po_box of this SystemuserputAddresses. # noqa: E501 :type: str """ - if po_box is not None and len(po_box) > 1024: - raise ValueError("Invalid value for `po_box`, length must be less than or equal to `1024`") # noqa: E501 self._po_box = po_box @@ -192,8 +179,6 @@ def postal_code(self, postal_code): :param postal_code: The postal_code of this SystemuserputAddresses. # noqa: E501 :type: str """ - if postal_code is not None and len(postal_code) > 1024: - raise ValueError("Invalid value for `postal_code`, length must be less than or equal to `1024`") # noqa: E501 self._postal_code = postal_code @@ -215,8 +200,6 @@ def region(self, region): :param region: The region of this SystemuserputAddresses. # noqa: E501 :type: str """ - if region is not None and len(region) > 1024: - raise ValueError("Invalid value for `region`, length must be less than or equal to `1024`") # noqa: E501 self._region = region @@ -238,8 +221,6 @@ def street_address(self, street_address): :param street_address: The street_address of this SystemuserputAddresses. # noqa: E501 :type: str """ - if street_address is not None and len(street_address) > 1024: - raise ValueError("Invalid value for `street_address`, length must be less than or equal to `1024`") # noqa: E501 self._street_address = street_address @@ -261,8 +242,6 @@ def type(self, type): :param type: The type of this SystemuserputAddresses. # noqa: E501 :type: str """ - if type is not None and len(type) > 1024: - raise ValueError("Invalid value for `type`, length must be less than or equal to `1024`") # noqa: E501 self._type = type diff --git a/jcapiv1/jcapiv1/models/systemuserput_attributes.py b/jcapiv1/jcapiv1/models/systemuserput_attributes.py new file mode 100644 index 0000000..1c9e79f --- /dev/null +++ b/jcapiv1/jcapiv1/models/systemuserput_attributes.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemuserputAttributes(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'value': 'str' + } + + attribute_map = { + 'name': 'name', + 'value': 'value' + } + + def __init__(self, name=None, value=None): # noqa: E501 + """SystemuserputAttributes - a model defined in Swagger""" # noqa: E501 + self._name = None + self._value = None + self.discriminator = None + if name is not None: + self.name = name + if value is not None: + self.value = value + + @property + def name(self): + """Gets the name of this SystemuserputAttributes. # noqa: E501 + + + :return: The name of this SystemuserputAttributes. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SystemuserputAttributes. + + + :param name: The name of this SystemuserputAttributes. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def value(self): + """Gets the value of this SystemuserputAttributes. # noqa: E501 + + + :return: The value of this SystemuserputAttributes. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this SystemuserputAttributes. + + + :param value: The value of this SystemuserputAttributes. # noqa: E501 + :type: str + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemuserputAttributes, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemuserputAttributes): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/systemuserput_phone_numbers.py b/jcapiv1/jcapiv1/models/systemuserput_phone_numbers.py index 37e7abb..cd518dc 100644 --- a/jcapiv1/jcapiv1/models/systemuserput_phone_numbers.py +++ b/jcapiv1/jcapiv1/models/systemuserput_phone_numbers.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemuserputPhoneNumbers(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,11 +39,9 @@ class SystemuserputPhoneNumbers(object): def __init__(self, number=None, type=None): # noqa: E501 """SystemuserputPhoneNumbers - a model defined in Swagger""" # noqa: E501 - self._number = None self._type = None self.discriminator = None - if number is not None: self.number = number if type is not None: @@ -70,8 +65,6 @@ def number(self, number): :param number: The number of this SystemuserputPhoneNumbers. # noqa: E501 :type: str """ - if number is not None and len(number) > 1024: - raise ValueError("Invalid value for `number`, length must be less than or equal to `1024`") # noqa: E501 self._number = number @@ -93,8 +86,6 @@ def type(self, type): :param type: The type of this SystemuserputPhoneNumbers. # noqa: E501 :type: str """ - if type is not None and len(type) > 1024: - raise ValueError("Invalid value for `type`, length must be less than or equal to `1024`") # noqa: E501 self._type = type diff --git a/jcapiv1/jcapiv1/models/systemuserput_relationships.py b/jcapiv1/jcapiv1/models/systemuserput_relationships.py new file mode 100644 index 0000000..d215681 --- /dev/null +++ b/jcapiv1/jcapiv1/models/systemuserput_relationships.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemuserputRelationships(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'type': 'str', + 'value': 'str' + } + + attribute_map = { + 'type': 'type', + 'value': 'value' + } + + def __init__(self, type=None, value=None): # noqa: E501 + """SystemuserputRelationships - a model defined in Swagger""" # noqa: E501 + self._type = None + self._value = None + self.discriminator = None + if type is not None: + self.type = type + if value is not None: + self.value = value + + @property + def type(self): + """Gets the type of this SystemuserputRelationships. # noqa: E501 + + + :return: The type of this SystemuserputRelationships. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SystemuserputRelationships. + + + :param type: The type of this SystemuserputRelationships. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def value(self): + """Gets the value of this SystemuserputRelationships. # noqa: E501 + + + :return: The value of this SystemuserputRelationships. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this SystemuserputRelationships. + + + :param value: The value of this SystemuserputRelationships. # noqa: E501 + :type: str + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemuserputRelationships, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemuserputRelationships): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/systemuserputpost.py b/jcapiv1/jcapiv1/models/systemuserputpost.py index 022a9de..e5c3d7a 100644 --- a/jcapiv1/jcapiv1/models/systemuserputpost.py +++ b/jcapiv1/jcapiv1/models/systemuserputpost.py @@ -1,32 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.mfa import Mfa # noqa: F401,E501 -from jcapiv1.models.systemuserputpost_addresses import SystemuserputpostAddresses # noqa: F401,E501 -from jcapiv1.models.systemuserputpost_phone_numbers import SystemuserputpostPhoneNumbers # noqa: F401,E501 - - class Systemuserputpost(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -39,11 +32,13 @@ class Systemuserputpost(object): 'activated': 'bool', 'addresses': 'list[SystemuserputpostAddresses]', 'allow_public_key': 'bool', - 'attributes': 'list[object]', + 'alternate_email': 'str', + 'attributes': 'list[SystemuserputAttributes]', 'company': 'str', 'cost_center': 'str', 'department': 'str', 'description': 'str', + 'disable_device_max_login_attempts': 'bool', 'displayname': 'str', 'email': 'str', 'employee_identifier': 'str', @@ -51,6 +46,7 @@ class Systemuserputpost(object): 'enable_managed_uid': 'bool', 'enable_user_portal_multifactor': 'bool', 'external_dn': 'str', + 'external_password_expiration_date': 'datetime', 'external_source_type': 'str', 'externally_managed': 'bool', 'firstname': 'str', @@ -58,6 +54,8 @@ class Systemuserputpost(object): 'lastname': 'str', 'ldap_binding_user': 'bool', 'location': 'str', + 'managed_apple_id': 'str', + 'manager': 'str', 'mfa': 'Mfa', 'middlename': 'str', 'password': 'str', @@ -65,8 +63,10 @@ class Systemuserputpost(object): 'passwordless_sudo': 'bool', 'phone_numbers': 'list[SystemuserputpostPhoneNumbers]', 'public_key': 'str', - 'relationships': 'list[object]', + 'recovery_email': 'SystemuserputpostRecoveryEmail', + 'relationships': 'list[SystemuserputRelationships]', 'samba_service_user': 'bool', + 'state': 'str', 'sudo': 'bool', 'suspended': 'bool', 'tags': 'list[str]', @@ -80,11 +80,13 @@ class Systemuserputpost(object): 'activated': 'activated', 'addresses': 'addresses', 'allow_public_key': 'allow_public_key', + 'alternate_email': 'alternateEmail', 'attributes': 'attributes', 'company': 'company', 'cost_center': 'costCenter', 'department': 'department', 'description': 'description', + 'disable_device_max_login_attempts': 'disableDeviceMaxLoginAttempts', 'displayname': 'displayname', 'email': 'email', 'employee_identifier': 'employeeIdentifier', @@ -92,6 +94,7 @@ class Systemuserputpost(object): 'enable_managed_uid': 'enable_managed_uid', 'enable_user_portal_multifactor': 'enable_user_portal_multifactor', 'external_dn': 'external_dn', + 'external_password_expiration_date': 'external_password_expiration_date', 'external_source_type': 'external_source_type', 'externally_managed': 'externally_managed', 'firstname': 'firstname', @@ -99,6 +102,8 @@ class Systemuserputpost(object): 'lastname': 'lastname', 'ldap_binding_user': 'ldap_binding_user', 'location': 'location', + 'managed_apple_id': 'managedAppleId', + 'manager': 'manager', 'mfa': 'mfa', 'middlename': 'middlename', 'password': 'password', @@ -106,8 +111,10 @@ class Systemuserputpost(object): 'passwordless_sudo': 'passwordless_sudo', 'phone_numbers': 'phoneNumbers', 'public_key': 'public_key', + 'recovery_email': 'recoveryEmail', 'relationships': 'relationships', 'samba_service_user': 'samba_service_user', + 'state': 'state', 'sudo': 'sudo', 'suspended': 'suspended', 'tags': 'tags', @@ -116,18 +123,19 @@ class Systemuserputpost(object): 'username': 'username' } - def __init__(self, account_locked=None, activated=None, addresses=None, allow_public_key=None, attributes=None, company=None, cost_center=None, department=None, description=None, displayname=None, email=None, employee_identifier=None, employee_type=None, enable_managed_uid=None, enable_user_portal_multifactor=None, external_dn=None, external_source_type=None, externally_managed=None, firstname=None, job_title=None, lastname=None, ldap_binding_user=None, location=None, mfa=None, middlename=None, password=None, password_never_expires=None, passwordless_sudo=None, phone_numbers=None, public_key=None, relationships=None, samba_service_user=None, sudo=None, suspended=None, tags=None, unix_guid=None, unix_uid=None, username=None): # noqa: E501 + def __init__(self, account_locked=None, activated=None, addresses=None, allow_public_key=None, alternate_email=None, attributes=None, company=None, cost_center=None, department=None, description=None, disable_device_max_login_attempts=None, displayname=None, email=None, employee_identifier=None, employee_type=None, enable_managed_uid=None, enable_user_portal_multifactor=None, external_dn=None, external_password_expiration_date=None, external_source_type=None, externally_managed=None, firstname=None, job_title=None, lastname=None, ldap_binding_user=None, location=None, managed_apple_id=None, manager=None, mfa=None, middlename=None, password=None, password_never_expires=None, passwordless_sudo=None, phone_numbers=None, public_key=None, recovery_email=None, relationships=None, samba_service_user=None, state=None, sudo=None, suspended=None, tags=None, unix_guid=None, unix_uid=None, username=None): # noqa: E501 """Systemuserputpost - a model defined in Swagger""" # noqa: E501 - self._account_locked = None self._activated = None self._addresses = None self._allow_public_key = None + self._alternate_email = None self._attributes = None self._company = None self._cost_center = None self._department = None self._description = None + self._disable_device_max_login_attempts = None self._displayname = None self._email = None self._employee_identifier = None @@ -135,6 +143,7 @@ def __init__(self, account_locked=None, activated=None, addresses=None, allow_pu self._enable_managed_uid = None self._enable_user_portal_multifactor = None self._external_dn = None + self._external_password_expiration_date = None self._external_source_type = None self._externally_managed = None self._firstname = None @@ -142,6 +151,8 @@ def __init__(self, account_locked=None, activated=None, addresses=None, allow_pu self._lastname = None self._ldap_binding_user = None self._location = None + self._managed_apple_id = None + self._manager = None self._mfa = None self._middlename = None self._password = None @@ -149,8 +160,10 @@ def __init__(self, account_locked=None, activated=None, addresses=None, allow_pu self._passwordless_sudo = None self._phone_numbers = None self._public_key = None + self._recovery_email = None self._relationships = None self._samba_service_user = None + self._state = None self._sudo = None self._suspended = None self._tags = None @@ -158,7 +171,6 @@ def __init__(self, account_locked=None, activated=None, addresses=None, allow_pu self._unix_uid = None self._username = None self.discriminator = None - if account_locked is not None: self.account_locked = account_locked if activated is not None: @@ -167,6 +179,8 @@ def __init__(self, account_locked=None, activated=None, addresses=None, allow_pu self.addresses = addresses if allow_public_key is not None: self.allow_public_key = allow_public_key + if alternate_email is not None: + self.alternate_email = alternate_email if attributes is not None: self.attributes = attributes if company is not None: @@ -177,6 +191,8 @@ def __init__(self, account_locked=None, activated=None, addresses=None, allow_pu self.department = department if description is not None: self.description = description + if disable_device_max_login_attempts is not None: + self.disable_device_max_login_attempts = disable_device_max_login_attempts if displayname is not None: self.displayname = displayname self.email = email @@ -190,6 +206,8 @@ def __init__(self, account_locked=None, activated=None, addresses=None, allow_pu self.enable_user_portal_multifactor = enable_user_portal_multifactor if external_dn is not None: self.external_dn = external_dn + if external_password_expiration_date is not None: + self.external_password_expiration_date = external_password_expiration_date if external_source_type is not None: self.external_source_type = external_source_type if externally_managed is not None: @@ -204,6 +222,10 @@ def __init__(self, account_locked=None, activated=None, addresses=None, allow_pu self.ldap_binding_user = ldap_binding_user if location is not None: self.location = location + if managed_apple_id is not None: + self.managed_apple_id = managed_apple_id + if manager is not None: + self.manager = manager if mfa is not None: self.mfa = mfa if middlename is not None: @@ -218,10 +240,14 @@ def __init__(self, account_locked=None, activated=None, addresses=None, allow_pu self.phone_numbers = phone_numbers if public_key is not None: self.public_key = public_key + if recovery_email is not None: + self.recovery_email = recovery_email if relationships is not None: self.relationships = relationships if samba_service_user is not None: self.samba_service_user = samba_service_user + if state is not None: + self.state = state if sudo is not None: self.sudo = sudo if suspended is not None: @@ -318,13 +344,34 @@ def allow_public_key(self, allow_public_key): self._allow_public_key = allow_public_key + @property + def alternate_email(self): + """Gets the alternate_email of this Systemuserputpost. # noqa: E501 + + + :return: The alternate_email of this Systemuserputpost. # noqa: E501 + :rtype: str + """ + return self._alternate_email + + @alternate_email.setter + def alternate_email(self, alternate_email): + """Sets the alternate_email of this Systemuserputpost. + + + :param alternate_email: The alternate_email of this Systemuserputpost. # noqa: E501 + :type: str + """ + + self._alternate_email = alternate_email + @property def attributes(self): """Gets the attributes of this Systemuserputpost. # noqa: E501 :return: The attributes of this Systemuserputpost. # noqa: E501 - :rtype: list[object] + :rtype: list[SystemuserputAttributes] """ return self._attributes @@ -334,7 +381,7 @@ def attributes(self, attributes): :param attributes: The attributes of this Systemuserputpost. # noqa: E501 - :type: list[object] + :type: list[SystemuserputAttributes] """ self._attributes = attributes @@ -420,11 +467,30 @@ def description(self, description): :param description: The description of this Systemuserputpost. # noqa: E501 :type: str """ - if description is not None and len(description) > 1024: - raise ValueError("Invalid value for `description`, length must be less than or equal to `1024`") # noqa: E501 self._description = description + @property + def disable_device_max_login_attempts(self): + """Gets the disable_device_max_login_attempts of this Systemuserputpost. # noqa: E501 + + + :return: The disable_device_max_login_attempts of this Systemuserputpost. # noqa: E501 + :rtype: bool + """ + return self._disable_device_max_login_attempts + + @disable_device_max_login_attempts.setter + def disable_device_max_login_attempts(self, disable_device_max_login_attempts): + """Sets the disable_device_max_login_attempts of this Systemuserputpost. + + + :param disable_device_max_login_attempts: The disable_device_max_login_attempts of this Systemuserputpost. # noqa: E501 + :type: bool + """ + + self._disable_device_max_login_attempts = disable_device_max_login_attempts + @property def displayname(self): """Gets the displayname of this Systemuserputpost. # noqa: E501 @@ -466,8 +532,6 @@ def email(self, email): """ if email is None: raise ValueError("Invalid value for `email`, must not be `None`") # noqa: E501 - if email is not None and len(email) > 1024: - raise ValueError("Invalid value for `email`, length must be less than or equal to `1024`") # noqa: E501 self._email = email @@ -491,8 +555,6 @@ def employee_identifier(self, employee_identifier): :param employee_identifier: The employee_identifier of this Systemuserputpost. # noqa: E501 :type: str """ - if employee_identifier is not None and len(employee_identifier) > 256: - raise ValueError("Invalid value for `employee_identifier`, length must be less than or equal to `256`") # noqa: E501 self._employee_identifier = employee_identifier @@ -580,6 +642,27 @@ def external_dn(self, external_dn): self._external_dn = external_dn + @property + def external_password_expiration_date(self): + """Gets the external_password_expiration_date of this Systemuserputpost. # noqa: E501 + + + :return: The external_password_expiration_date of this Systemuserputpost. # noqa: E501 + :rtype: datetime + """ + return self._external_password_expiration_date + + @external_password_expiration_date.setter + def external_password_expiration_date(self, external_password_expiration_date): + """Sets the external_password_expiration_date of this Systemuserputpost. + + + :param external_password_expiration_date: The external_password_expiration_date of this Systemuserputpost. # noqa: E501 + :type: datetime + """ + + self._external_password_expiration_date = external_password_expiration_date + @property def external_source_type(self): """Gets the external_source_type of this Systemuserputpost. # noqa: E501 @@ -727,6 +810,50 @@ def location(self, location): self._location = location + @property + def managed_apple_id(self): + """Gets the managed_apple_id of this Systemuserputpost. # noqa: E501 + + + :return: The managed_apple_id of this Systemuserputpost. # noqa: E501 + :rtype: str + """ + return self._managed_apple_id + + @managed_apple_id.setter + def managed_apple_id(self, managed_apple_id): + """Sets the managed_apple_id of this Systemuserputpost. + + + :param managed_apple_id: The managed_apple_id of this Systemuserputpost. # noqa: E501 + :type: str + """ + + self._managed_apple_id = managed_apple_id + + @property + def manager(self): + """Gets the manager of this Systemuserputpost. # noqa: E501 + + Relation with another systemuser to identify the last as a manager. # noqa: E501 + + :return: The manager of this Systemuserputpost. # noqa: E501 + :rtype: str + """ + return self._manager + + @manager.setter + def manager(self, manager): + """Sets the manager of this Systemuserputpost. + + Relation with another systemuser to identify the last as a manager. # noqa: E501 + + :param manager: The manager of this Systemuserputpost. # noqa: E501 + :type: str + """ + + self._manager = manager + @property def mfa(self): """Gets the mfa of this Systemuserputpost. # noqa: E501 @@ -874,13 +1001,34 @@ def public_key(self, public_key): self._public_key = public_key + @property + def recovery_email(self): + """Gets the recovery_email of this Systemuserputpost. # noqa: E501 + + + :return: The recovery_email of this Systemuserputpost. # noqa: E501 + :rtype: SystemuserputpostRecoveryEmail + """ + return self._recovery_email + + @recovery_email.setter + def recovery_email(self, recovery_email): + """Sets the recovery_email of this Systemuserputpost. + + + :param recovery_email: The recovery_email of this Systemuserputpost. # noqa: E501 + :type: SystemuserputpostRecoveryEmail + """ + + self._recovery_email = recovery_email + @property def relationships(self): """Gets the relationships of this Systemuserputpost. # noqa: E501 :return: The relationships of this Systemuserputpost. # noqa: E501 - :rtype: list[object] + :rtype: list[SystemuserputRelationships] """ return self._relationships @@ -890,7 +1038,7 @@ def relationships(self, relationships): :param relationships: The relationships of this Systemuserputpost. # noqa: E501 - :type: list[object] + :type: list[SystemuserputRelationships] """ self._relationships = relationships @@ -916,6 +1064,33 @@ def samba_service_user(self, samba_service_user): self._samba_service_user = samba_service_user + @property + def state(self): + """Gets the state of this Systemuserputpost. # noqa: E501 + + + :return: The state of this Systemuserputpost. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this Systemuserputpost. + + + :param state: The state of this Systemuserputpost. # noqa: E501 + :type: str + """ + allowed_values = ["STAGED", "ACTIVATED", "SUSPENDED"] # noqa: E501 + if state not in allowed_values: + raise ValueError( + "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 + .format(state, allowed_values) + ) + + self._state = state + @property def sudo(self): """Gets the sudo of this Systemuserputpost. # noqa: E501 @@ -997,8 +1172,6 @@ def unix_guid(self, unix_guid): :param unix_guid: The unix_guid of this Systemuserputpost. # noqa: E501 :type: int """ - if unix_guid is not None and unix_guid < 1: # noqa: E501 - raise ValueError("Invalid value for `unix_guid`, must be a value greater than or equal to `1`") # noqa: E501 self._unix_guid = unix_guid @@ -1020,8 +1193,6 @@ def unix_uid(self, unix_uid): :param unix_uid: The unix_uid of this Systemuserputpost. # noqa: E501 :type: int """ - if unix_uid is not None and unix_uid < 1: # noqa: E501 - raise ValueError("Invalid value for `unix_uid`, must be a value greater than or equal to `1`") # noqa: E501 self._unix_uid = unix_uid diff --git a/jcapiv1/jcapiv1/models/systemuserputpost_addresses.py b/jcapiv1/jcapiv1/models/systemuserputpost_addresses.py index 01989a4..a22889f 100644 --- a/jcapiv1/jcapiv1/models/systemuserputpost_addresses.py +++ b/jcapiv1/jcapiv1/models/systemuserputpost_addresses.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemuserputpostAddresses(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -54,7 +51,6 @@ class SystemuserputpostAddresses(object): def __init__(self, country=None, extended_address=None, locality=None, po_box=None, postal_code=None, region=None, street_address=None, type=None): # noqa: E501 """SystemuserputpostAddresses - a model defined in Swagger""" # noqa: E501 - self._country = None self._extended_address = None self._locality = None @@ -64,7 +60,6 @@ def __init__(self, country=None, extended_address=None, locality=None, po_box=No self._street_address = None self._type = None self.discriminator = None - if country is not None: self.country = country if extended_address is not None: diff --git a/jcapiv1/jcapiv1/models/systemuserputpost_phone_numbers.py b/jcapiv1/jcapiv1/models/systemuserputpost_phone_numbers.py index d156d3d..c0e2d73 100644 --- a/jcapiv1/jcapiv1/models/systemuserputpost_phone_numbers.py +++ b/jcapiv1/jcapiv1/models/systemuserputpost_phone_numbers.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemuserputpostPhoneNumbers(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,11 +39,9 @@ class SystemuserputpostPhoneNumbers(object): def __init__(self, number=None, type=None): # noqa: E501 """SystemuserputpostPhoneNumbers - a model defined in Swagger""" # noqa: E501 - self._number = None self._type = None self.discriminator = None - if number is not None: self.number = number if type is not None: diff --git a/jcapiv1/jcapiv1/models/systemuserputpost_recovery_email.py b/jcapiv1/jcapiv1/models/systemuserputpost_recovery_email.py new file mode 100644 index 0000000..35faf58 --- /dev/null +++ b/jcapiv1/jcapiv1/models/systemuserputpost_recovery_email.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemuserputpostRecoveryEmail(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'address': 'str' + } + + attribute_map = { + 'address': 'address' + } + + def __init__(self, address=None): # noqa: E501 + """SystemuserputpostRecoveryEmail - a model defined in Swagger""" # noqa: E501 + self._address = None + self.discriminator = None + if address is not None: + self.address = address + + @property + def address(self): + """Gets the address of this SystemuserputpostRecoveryEmail. # noqa: E501 + + + :return: The address of this SystemuserputpostRecoveryEmail. # noqa: E501 + :rtype: str + """ + return self._address + + @address.setter + def address(self, address): + """Sets the address of this SystemuserputpostRecoveryEmail. + + + :param address: The address of this SystemuserputpostRecoveryEmail. # noqa: E501 + :type: str + """ + + self._address = address + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemuserputpostRecoveryEmail, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemuserputpostRecoveryEmail): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/systemuserreturn.py b/jcapiv1/jcapiv1/models/systemuserreturn.py index 3a08c85..7c32ec1 100644 --- a/jcapiv1/jcapiv1/models/systemuserreturn.py +++ b/jcapiv1/jcapiv1/models/systemuserreturn.py @@ -1,33 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.mfa import Mfa # noqa: F401,E501 -from jcapiv1.models.sshkeylist import Sshkeylist # noqa: F401,E501 -from jcapiv1.models.systemuserreturn_addresses import SystemuserreturnAddresses # noqa: F401,E501 -from jcapiv1.models.systemuserreturn_phone_numbers import SystemuserreturnPhoneNumbers # noqa: F401,E501 - - class Systemuserreturn(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -38,16 +30,20 @@ class Systemuserreturn(object): swagger_types = { 'id': 'str', 'account_locked': 'bool', + 'account_locked_date': 'str', 'activated': 'bool', 'addresses': 'list[SystemuserreturnAddresses]', 'allow_public_key': 'bool', - 'attributes': 'list[object]', + 'alternate_email': 'str', + 'attributes': 'list[SystemuserputAttributes]', 'bad_login_attempts': 'int', 'company': 'str', 'cost_center': 'str', 'created': 'str', + 'creation_source': 'str', 'department': 'str', 'description': 'str', + 'disable_device_max_login_attempts': 'bool', 'displayname': 'str', 'email': 'str', 'employee_identifier': 'str', @@ -55,6 +51,7 @@ class Systemuserreturn(object): 'enable_managed_uid': 'bool', 'enable_user_portal_multifactor': 'bool', 'external_dn': 'str', + 'external_password_expiration_date': 'str', 'external_source_type': 'str', 'externally_managed': 'bool', 'firstname': 'str', @@ -62,7 +59,10 @@ class Systemuserreturn(object): 'lastname': 'str', 'ldap_binding_user': 'bool', 'location': 'str', + 'managed_apple_id': 'str', + 'manager': 'str', 'mfa': 'Mfa', + 'mfa_enrollment': 'MfaEnrollment', 'middlename': 'str', 'organization': 'str', 'password_expiration_date': 'str', @@ -71,9 +71,11 @@ class Systemuserreturn(object): 'passwordless_sudo': 'bool', 'phone_numbers': 'list[SystemuserreturnPhoneNumbers]', 'public_key': 'str', - 'relationships': 'list[object]', + 'recovery_email': 'SystemuserreturnRecoveryEmail', + 'relationships': 'list[SystemuserputRelationships]', 'samba_service_user': 'bool', 'ssh_keys': 'list[Sshkeylist]', + 'state': 'str', 'sudo': 'bool', 'suspended': 'bool', 'tags': 'list[str]', @@ -86,16 +88,20 @@ class Systemuserreturn(object): attribute_map = { 'id': '_id', 'account_locked': 'account_locked', + 'account_locked_date': 'account_locked_date', 'activated': 'activated', 'addresses': 'addresses', 'allow_public_key': 'allow_public_key', + 'alternate_email': 'alternateEmail', 'attributes': 'attributes', 'bad_login_attempts': 'badLoginAttempts', 'company': 'company', 'cost_center': 'costCenter', 'created': 'created', + 'creation_source': 'creationSource', 'department': 'department', 'description': 'description', + 'disable_device_max_login_attempts': 'disableDeviceMaxLoginAttempts', 'displayname': 'displayname', 'email': 'email', 'employee_identifier': 'employeeIdentifier', @@ -103,6 +109,7 @@ class Systemuserreturn(object): 'enable_managed_uid': 'enable_managed_uid', 'enable_user_portal_multifactor': 'enable_user_portal_multifactor', 'external_dn': 'external_dn', + 'external_password_expiration_date': 'external_password_expiration_date', 'external_source_type': 'external_source_type', 'externally_managed': 'externally_managed', 'firstname': 'firstname', @@ -110,7 +117,10 @@ class Systemuserreturn(object): 'lastname': 'lastname', 'ldap_binding_user': 'ldap_binding_user', 'location': 'location', + 'managed_apple_id': 'managedAppleId', + 'manager': 'manager', 'mfa': 'mfa', + 'mfa_enrollment': 'mfaEnrollment', 'middlename': 'middlename', 'organization': 'organization', 'password_expiration_date': 'password_expiration_date', @@ -119,9 +129,11 @@ class Systemuserreturn(object): 'passwordless_sudo': 'passwordless_sudo', 'phone_numbers': 'phoneNumbers', 'public_key': 'public_key', + 'recovery_email': 'recoveryEmail', 'relationships': 'relationships', 'samba_service_user': 'samba_service_user', 'ssh_keys': 'ssh_keys', + 'state': 'state', 'sudo': 'sudo', 'suspended': 'suspended', 'tags': 'tags', @@ -131,21 +143,24 @@ class Systemuserreturn(object): 'username': 'username' } - def __init__(self, id=None, account_locked=None, activated=None, addresses=None, allow_public_key=None, attributes=None, bad_login_attempts=None, company=None, cost_center=None, created=None, department=None, description=None, displayname=None, email=None, employee_identifier=None, employee_type=None, enable_managed_uid=None, enable_user_portal_multifactor=None, external_dn=None, external_source_type=None, externally_managed=None, firstname=None, job_title=None, lastname=None, ldap_binding_user=None, location=None, mfa=None, middlename=None, organization=None, password_expiration_date=None, password_expired=None, password_never_expires=None, passwordless_sudo=None, phone_numbers=None, public_key=None, relationships=None, samba_service_user=None, ssh_keys=None, sudo=None, suspended=None, tags=None, totp_enabled=None, unix_guid=None, unix_uid=None, username=None): # noqa: E501 + def __init__(self, id=None, account_locked=None, account_locked_date=None, activated=None, addresses=None, allow_public_key=None, alternate_email=None, attributes=None, bad_login_attempts=None, company=None, cost_center=None, created=None, creation_source=None, department=None, description=None, disable_device_max_login_attempts=None, displayname=None, email=None, employee_identifier=None, employee_type=None, enable_managed_uid=None, enable_user_portal_multifactor=None, external_dn=None, external_password_expiration_date=None, external_source_type=None, externally_managed=None, firstname=None, job_title=None, lastname=None, ldap_binding_user=None, location=None, managed_apple_id=None, manager=None, mfa=None, mfa_enrollment=None, middlename=None, organization=None, password_expiration_date=None, password_expired=None, password_never_expires=None, passwordless_sudo=None, phone_numbers=None, public_key=None, recovery_email=None, relationships=None, samba_service_user=None, ssh_keys=None, state=None, sudo=None, suspended=None, tags=None, totp_enabled=None, unix_guid=None, unix_uid=None, username=None): # noqa: E501 """Systemuserreturn - a model defined in Swagger""" # noqa: E501 - self._id = None self._account_locked = None + self._account_locked_date = None self._activated = None self._addresses = None self._allow_public_key = None + self._alternate_email = None self._attributes = None self._bad_login_attempts = None self._company = None self._cost_center = None self._created = None + self._creation_source = None self._department = None self._description = None + self._disable_device_max_login_attempts = None self._displayname = None self._email = None self._employee_identifier = None @@ -153,6 +168,7 @@ def __init__(self, id=None, account_locked=None, activated=None, addresses=None, self._enable_managed_uid = None self._enable_user_portal_multifactor = None self._external_dn = None + self._external_password_expiration_date = None self._external_source_type = None self._externally_managed = None self._firstname = None @@ -160,7 +176,10 @@ def __init__(self, id=None, account_locked=None, activated=None, addresses=None, self._lastname = None self._ldap_binding_user = None self._location = None + self._managed_apple_id = None + self._manager = None self._mfa = None + self._mfa_enrollment = None self._middlename = None self._organization = None self._password_expiration_date = None @@ -169,9 +188,11 @@ def __init__(self, id=None, account_locked=None, activated=None, addresses=None, self._passwordless_sudo = None self._phone_numbers = None self._public_key = None + self._recovery_email = None self._relationships = None self._samba_service_user = None self._ssh_keys = None + self._state = None self._sudo = None self._suspended = None self._tags = None @@ -180,17 +201,20 @@ def __init__(self, id=None, account_locked=None, activated=None, addresses=None, self._unix_uid = None self._username = None self.discriminator = None - if id is not None: self.id = id if account_locked is not None: self.account_locked = account_locked + if account_locked_date is not None: + self.account_locked_date = account_locked_date if activated is not None: self.activated = activated if addresses is not None: self.addresses = addresses if allow_public_key is not None: self.allow_public_key = allow_public_key + if alternate_email is not None: + self.alternate_email = alternate_email if attributes is not None: self.attributes = attributes if bad_login_attempts is not None: @@ -201,10 +225,14 @@ def __init__(self, id=None, account_locked=None, activated=None, addresses=None, self.cost_center = cost_center if created is not None: self.created = created + if creation_source is not None: + self.creation_source = creation_source if department is not None: self.department = department if description is not None: self.description = description + if disable_device_max_login_attempts is not None: + self.disable_device_max_login_attempts = disable_device_max_login_attempts if displayname is not None: self.displayname = displayname if email is not None: @@ -219,6 +247,8 @@ def __init__(self, id=None, account_locked=None, activated=None, addresses=None, self.enable_user_portal_multifactor = enable_user_portal_multifactor if external_dn is not None: self.external_dn = external_dn + if external_password_expiration_date is not None: + self.external_password_expiration_date = external_password_expiration_date if external_source_type is not None: self.external_source_type = external_source_type if externally_managed is not None: @@ -233,8 +263,14 @@ def __init__(self, id=None, account_locked=None, activated=None, addresses=None, self.ldap_binding_user = ldap_binding_user if location is not None: self.location = location + if managed_apple_id is not None: + self.managed_apple_id = managed_apple_id + if manager is not None: + self.manager = manager if mfa is not None: self.mfa = mfa + if mfa_enrollment is not None: + self.mfa_enrollment = mfa_enrollment if middlename is not None: self.middlename = middlename if organization is not None: @@ -251,12 +287,16 @@ def __init__(self, id=None, account_locked=None, activated=None, addresses=None, self.phone_numbers = phone_numbers if public_key is not None: self.public_key = public_key + if recovery_email is not None: + self.recovery_email = recovery_email if relationships is not None: self.relationships = relationships if samba_service_user is not None: self.samba_service_user = samba_service_user if ssh_keys is not None: self.ssh_keys = ssh_keys + if state is not None: + self.state = state if sudo is not None: self.sudo = sudo if suspended is not None: @@ -314,6 +354,27 @@ def account_locked(self, account_locked): self._account_locked = account_locked + @property + def account_locked_date(self): + """Gets the account_locked_date of this Systemuserreturn. # noqa: E501 + + + :return: The account_locked_date of this Systemuserreturn. # noqa: E501 + :rtype: str + """ + return self._account_locked_date + + @account_locked_date.setter + def account_locked_date(self, account_locked_date): + """Sets the account_locked_date of this Systemuserreturn. + + + :param account_locked_date: The account_locked_date of this Systemuserreturn. # noqa: E501 + :type: str + """ + + self._account_locked_date = account_locked_date + @property def activated(self): """Gets the activated of this Systemuserreturn. # noqa: E501 @@ -377,13 +438,34 @@ def allow_public_key(self, allow_public_key): self._allow_public_key = allow_public_key + @property + def alternate_email(self): + """Gets the alternate_email of this Systemuserreturn. # noqa: E501 + + + :return: The alternate_email of this Systemuserreturn. # noqa: E501 + :rtype: str + """ + return self._alternate_email + + @alternate_email.setter + def alternate_email(self, alternate_email): + """Sets the alternate_email of this Systemuserreturn. + + + :param alternate_email: The alternate_email of this Systemuserreturn. # noqa: E501 + :type: str + """ + + self._alternate_email = alternate_email + @property def attributes(self): """Gets the attributes of this Systemuserreturn. # noqa: E501 :return: The attributes of this Systemuserreturn. # noqa: E501 - :rtype: list[object] + :rtype: list[SystemuserputAttributes] """ return self._attributes @@ -393,7 +475,7 @@ def attributes(self, attributes): :param attributes: The attributes of this Systemuserreturn. # noqa: E501 - :type: list[object] + :type: list[SystemuserputAttributes] """ self._attributes = attributes @@ -416,8 +498,6 @@ def bad_login_attempts(self, bad_login_attempts): :param bad_login_attempts: The bad_login_attempts of this Systemuserreturn. # noqa: E501 :type: int """ - if bad_login_attempts is not None and bad_login_attempts < 0: # noqa: E501 - raise ValueError("Invalid value for `bad_login_attempts`, must be a value greater than or equal to `0`") # noqa: E501 self._bad_login_attempts = bad_login_attempts @@ -439,8 +519,6 @@ def company(self, company): :param company: The company of this Systemuserreturn. # noqa: E501 :type: str """ - if company is not None and len(company) > 1024: - raise ValueError("Invalid value for `company`, length must be less than or equal to `1024`") # noqa: E501 self._company = company @@ -462,8 +540,6 @@ def cost_center(self, cost_center): :param cost_center: The cost_center of this Systemuserreturn. # noqa: E501 :type: str """ - if cost_center is not None and len(cost_center) > 1024: - raise ValueError("Invalid value for `cost_center`, length must be less than or equal to `1024`") # noqa: E501 self._cost_center = cost_center @@ -488,6 +564,27 @@ def created(self, created): self._created = created + @property + def creation_source(self): + """Gets the creation_source of this Systemuserreturn. # noqa: E501 + + + :return: The creation_source of this Systemuserreturn. # noqa: E501 + :rtype: str + """ + return self._creation_source + + @creation_source.setter + def creation_source(self, creation_source): + """Sets the creation_source of this Systemuserreturn. + + + :param creation_source: The creation_source of this Systemuserreturn. # noqa: E501 + :type: str + """ + + self._creation_source = creation_source + @property def department(self): """Gets the department of this Systemuserreturn. # noqa: E501 @@ -506,8 +603,6 @@ def department(self, department): :param department: The department of this Systemuserreturn. # noqa: E501 :type: str """ - if department is not None and len(department) > 1024: - raise ValueError("Invalid value for `department`, length must be less than or equal to `1024`") # noqa: E501 self._department = department @@ -529,11 +624,30 @@ def description(self, description): :param description: The description of this Systemuserreturn. # noqa: E501 :type: str """ - if description is not None and len(description) > 1024: - raise ValueError("Invalid value for `description`, length must be less than or equal to `1024`") # noqa: E501 self._description = description + @property + def disable_device_max_login_attempts(self): + """Gets the disable_device_max_login_attempts of this Systemuserreturn. # noqa: E501 + + + :return: The disable_device_max_login_attempts of this Systemuserreturn. # noqa: E501 + :rtype: bool + """ + return self._disable_device_max_login_attempts + + @disable_device_max_login_attempts.setter + def disable_device_max_login_attempts(self, disable_device_max_login_attempts): + """Sets the disable_device_max_login_attempts of this Systemuserreturn. + + + :param disable_device_max_login_attempts: The disable_device_max_login_attempts of this Systemuserreturn. # noqa: E501 + :type: bool + """ + + self._disable_device_max_login_attempts = disable_device_max_login_attempts + @property def displayname(self): """Gets the displayname of this Systemuserreturn. # noqa: E501 @@ -552,8 +666,6 @@ def displayname(self, displayname): :param displayname: The displayname of this Systemuserreturn. # noqa: E501 :type: str """ - if displayname is not None and len(displayname) > 1024: - raise ValueError("Invalid value for `displayname`, length must be less than or equal to `1024`") # noqa: E501 self._displayname = displayname @@ -575,8 +687,6 @@ def email(self, email): :param email: The email of this Systemuserreturn. # noqa: E501 :type: str """ - if email is not None and len(email) > 1024: - raise ValueError("Invalid value for `email`, length must be less than or equal to `1024`") # noqa: E501 self._email = email @@ -600,8 +710,6 @@ def employee_identifier(self, employee_identifier): :param employee_identifier: The employee_identifier of this Systemuserreturn. # noqa: E501 :type: str """ - if employee_identifier is not None and len(employee_identifier) > 256: - raise ValueError("Invalid value for `employee_identifier`, length must be less than or equal to `256`") # noqa: E501 self._employee_identifier = employee_identifier @@ -623,8 +731,6 @@ def employee_type(self, employee_type): :param employee_type: The employee_type of this Systemuserreturn. # noqa: E501 :type: str """ - if employee_type is not None and len(employee_type) > 1024: - raise ValueError("Invalid value for `employee_type`, length must be less than or equal to `1024`") # noqa: E501 self._employee_type = employee_type @@ -691,6 +797,27 @@ def external_dn(self, external_dn): self._external_dn = external_dn + @property + def external_password_expiration_date(self): + """Gets the external_password_expiration_date of this Systemuserreturn. # noqa: E501 + + + :return: The external_password_expiration_date of this Systemuserreturn. # noqa: E501 + :rtype: str + """ + return self._external_password_expiration_date + + @external_password_expiration_date.setter + def external_password_expiration_date(self, external_password_expiration_date): + """Sets the external_password_expiration_date of this Systemuserreturn. + + + :param external_password_expiration_date: The external_password_expiration_date of this Systemuserreturn. # noqa: E501 + :type: str + """ + + self._external_password_expiration_date = external_password_expiration_date + @property def external_source_type(self): """Gets the external_source_type of this Systemuserreturn. # noqa: E501 @@ -751,8 +878,6 @@ def firstname(self, firstname): :param firstname: The firstname of this Systemuserreturn. # noqa: E501 :type: str """ - if firstname is not None and len(firstname) > 1024: - raise ValueError("Invalid value for `firstname`, length must be less than or equal to `1024`") # noqa: E501 self._firstname = firstname @@ -774,8 +899,6 @@ def job_title(self, job_title): :param job_title: The job_title of this Systemuserreturn. # noqa: E501 :type: str """ - if job_title is not None and len(job_title) > 1024: - raise ValueError("Invalid value for `job_title`, length must be less than or equal to `1024`") # noqa: E501 self._job_title = job_title @@ -797,8 +920,6 @@ def lastname(self, lastname): :param lastname: The lastname of this Systemuserreturn. # noqa: E501 :type: str """ - if lastname is not None and len(lastname) > 1024: - raise ValueError("Invalid value for `lastname`, length must be less than or equal to `1024`") # noqa: E501 self._lastname = lastname @@ -841,11 +962,53 @@ def location(self, location): :param location: The location of this Systemuserreturn. # noqa: E501 :type: str """ - if location is not None and len(location) > 1024: - raise ValueError("Invalid value for `location`, length must be less than or equal to `1024`") # noqa: E501 self._location = location + @property + def managed_apple_id(self): + """Gets the managed_apple_id of this Systemuserreturn. # noqa: E501 + + + :return: The managed_apple_id of this Systemuserreturn. # noqa: E501 + :rtype: str + """ + return self._managed_apple_id + + @managed_apple_id.setter + def managed_apple_id(self, managed_apple_id): + """Sets the managed_apple_id of this Systemuserreturn. + + + :param managed_apple_id: The managed_apple_id of this Systemuserreturn. # noqa: E501 + :type: str + """ + + self._managed_apple_id = managed_apple_id + + @property + def manager(self): + """Gets the manager of this Systemuserreturn. # noqa: E501 + + Relation with another systemuser to identify the last as a manager. # noqa: E501 + + :return: The manager of this Systemuserreturn. # noqa: E501 + :rtype: str + """ + return self._manager + + @manager.setter + def manager(self, manager): + """Sets the manager of this Systemuserreturn. + + Relation with another systemuser to identify the last as a manager. # noqa: E501 + + :param manager: The manager of this Systemuserreturn. # noqa: E501 + :type: str + """ + + self._manager = manager + @property def mfa(self): """Gets the mfa of this Systemuserreturn. # noqa: E501 @@ -867,6 +1030,27 @@ def mfa(self, mfa): self._mfa = mfa + @property + def mfa_enrollment(self): + """Gets the mfa_enrollment of this Systemuserreturn. # noqa: E501 + + + :return: The mfa_enrollment of this Systemuserreturn. # noqa: E501 + :rtype: MfaEnrollment + """ + return self._mfa_enrollment + + @mfa_enrollment.setter + def mfa_enrollment(self, mfa_enrollment): + """Sets the mfa_enrollment of this Systemuserreturn. + + + :param mfa_enrollment: The mfa_enrollment of this Systemuserreturn. # noqa: E501 + :type: MfaEnrollment + """ + + self._mfa_enrollment = mfa_enrollment + @property def middlename(self): """Gets the middlename of this Systemuserreturn. # noqa: E501 @@ -885,8 +1069,6 @@ def middlename(self, middlename): :param middlename: The middlename of this Systemuserreturn. # noqa: E501 :type: str """ - if middlename is not None and len(middlename) > 1024: - raise ValueError("Invalid value for `middlename`, length must be less than or equal to `1024`") # noqa: E501 self._middlename = middlename @@ -1037,13 +1219,34 @@ def public_key(self, public_key): self._public_key = public_key + @property + def recovery_email(self): + """Gets the recovery_email of this Systemuserreturn. # noqa: E501 + + + :return: The recovery_email of this Systemuserreturn. # noqa: E501 + :rtype: SystemuserreturnRecoveryEmail + """ + return self._recovery_email + + @recovery_email.setter + def recovery_email(self, recovery_email): + """Sets the recovery_email of this Systemuserreturn. + + + :param recovery_email: The recovery_email of this Systemuserreturn. # noqa: E501 + :type: SystemuserreturnRecoveryEmail + """ + + self._recovery_email = recovery_email + @property def relationships(self): """Gets the relationships of this Systemuserreturn. # noqa: E501 :return: The relationships of this Systemuserreturn. # noqa: E501 - :rtype: list[object] + :rtype: list[SystemuserputRelationships] """ return self._relationships @@ -1053,7 +1256,7 @@ def relationships(self, relationships): :param relationships: The relationships of this Systemuserreturn. # noqa: E501 - :type: list[object] + :type: list[SystemuserputRelationships] """ self._relationships = relationships @@ -1100,6 +1303,33 @@ def ssh_keys(self, ssh_keys): self._ssh_keys = ssh_keys + @property + def state(self): + """Gets the state of this Systemuserreturn. # noqa: E501 + + + :return: The state of this Systemuserreturn. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this Systemuserreturn. + + + :param state: The state of this Systemuserreturn. # noqa: E501 + :type: str + """ + allowed_values = ["STAGED", "ACTIVATED", "SUSPENDED"] # noqa: E501 + if state not in allowed_values: + raise ValueError( + "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 + .format(state, allowed_values) + ) + + self._state = state + @property def sudo(self): """Gets the sudo of this Systemuserreturn. # noqa: E501 @@ -1202,8 +1432,6 @@ def unix_guid(self, unix_guid): :param unix_guid: The unix_guid of this Systemuserreturn. # noqa: E501 :type: int """ - if unix_guid is not None and unix_guid < 1: # noqa: E501 - raise ValueError("Invalid value for `unix_guid`, must be a value greater than or equal to `1`") # noqa: E501 self._unix_guid = unix_guid @@ -1225,8 +1453,6 @@ def unix_uid(self, unix_uid): :param unix_uid: The unix_uid of this Systemuserreturn. # noqa: E501 :type: int """ - if unix_uid is not None and unix_uid < 1: # noqa: E501 - raise ValueError("Invalid value for `unix_uid`, must be a value greater than or equal to `1`") # noqa: E501 self._unix_uid = unix_uid @@ -1248,8 +1474,6 @@ def username(self, username): :param username: The username of this Systemuserreturn. # noqa: E501 :type: str """ - if username is not None and len(username) > 1024: - raise ValueError("Invalid value for `username`, length must be less than or equal to `1024`") # noqa: E501 self._username = username diff --git a/jcapiv1/jcapiv1/models/systemuserreturn_addresses.py b/jcapiv1/jcapiv1/models/systemuserreturn_addresses.py index a310d18..baa7dc4 100644 --- a/jcapiv1/jcapiv1/models/systemuserreturn_addresses.py +++ b/jcapiv1/jcapiv1/models/systemuserreturn_addresses.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemuserreturnAddresses(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -56,7 +53,6 @@ class SystemuserreturnAddresses(object): def __init__(self, country=None, extended_address=None, id=None, locality=None, po_box=None, postal_code=None, region=None, street_address=None, type=None): # noqa: E501 """SystemuserreturnAddresses - a model defined in Swagger""" # noqa: E501 - self._country = None self._extended_address = None self._id = None @@ -67,7 +63,6 @@ def __init__(self, country=None, extended_address=None, id=None, locality=None, self._street_address = None self._type = None self.discriminator = None - if country is not None: self.country = country if extended_address is not None: @@ -105,8 +100,6 @@ def country(self, country): :param country: The country of this SystemuserreturnAddresses. # noqa: E501 :type: str """ - if country is not None and len(country) > 1024: - raise ValueError("Invalid value for `country`, length must be less than or equal to `1024`") # noqa: E501 self._country = country @@ -128,8 +121,6 @@ def extended_address(self, extended_address): :param extended_address: The extended_address of this SystemuserreturnAddresses. # noqa: E501 :type: str """ - if extended_address is not None and len(extended_address) > 1024: - raise ValueError("Invalid value for `extended_address`, length must be less than or equal to `1024`") # noqa: E501 self._extended_address = extended_address @@ -172,8 +163,6 @@ def locality(self, locality): :param locality: The locality of this SystemuserreturnAddresses. # noqa: E501 :type: str """ - if locality is not None and len(locality) > 1024: - raise ValueError("Invalid value for `locality`, length must be less than or equal to `1024`") # noqa: E501 self._locality = locality @@ -195,8 +184,6 @@ def po_box(self, po_box): :param po_box: The po_box of this SystemuserreturnAddresses. # noqa: E501 :type: str """ - if po_box is not None and len(po_box) > 1024: - raise ValueError("Invalid value for `po_box`, length must be less than or equal to `1024`") # noqa: E501 self._po_box = po_box @@ -218,8 +205,6 @@ def postal_code(self, postal_code): :param postal_code: The postal_code of this SystemuserreturnAddresses. # noqa: E501 :type: str """ - if postal_code is not None and len(postal_code) > 1024: - raise ValueError("Invalid value for `postal_code`, length must be less than or equal to `1024`") # noqa: E501 self._postal_code = postal_code @@ -241,8 +226,6 @@ def region(self, region): :param region: The region of this SystemuserreturnAddresses. # noqa: E501 :type: str """ - if region is not None and len(region) > 1024: - raise ValueError("Invalid value for `region`, length must be less than or equal to `1024`") # noqa: E501 self._region = region @@ -264,8 +247,6 @@ def street_address(self, street_address): :param street_address: The street_address of this SystemuserreturnAddresses. # noqa: E501 :type: str """ - if street_address is not None and len(street_address) > 1024: - raise ValueError("Invalid value for `street_address`, length must be less than or equal to `1024`") # noqa: E501 self._street_address = street_address @@ -287,8 +268,6 @@ def type(self, type): :param type: The type of this SystemuserreturnAddresses. # noqa: E501 :type: str """ - if type is not None and len(type) > 1024: - raise ValueError("Invalid value for `type`, length must be less than or equal to `1024`") # noqa: E501 self._type = type diff --git a/jcapiv1/jcapiv1/models/systemuserreturn_phone_numbers.py b/jcapiv1/jcapiv1/models/systemuserreturn_phone_numbers.py index 7d53e12..189a2d5 100644 --- a/jcapiv1/jcapiv1/models/systemuserreturn_phone_numbers.py +++ b/jcapiv1/jcapiv1/models/systemuserreturn_phone_numbers.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemuserreturnPhoneNumbers(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,12 +41,10 @@ class SystemuserreturnPhoneNumbers(object): def __init__(self, id=None, number=None, type=None): # noqa: E501 """SystemuserreturnPhoneNumbers - a model defined in Swagger""" # noqa: E501 - self._id = None self._number = None self._type = None self.discriminator = None - if id is not None: self.id = id if number is not None: @@ -96,8 +91,6 @@ def number(self, number): :param number: The number of this SystemuserreturnPhoneNumbers. # noqa: E501 :type: str """ - if number is not None and len(number) > 1024: - raise ValueError("Invalid value for `number`, length must be less than or equal to `1024`") # noqa: E501 self._number = number @@ -119,8 +112,6 @@ def type(self, type): :param type: The type of this SystemuserreturnPhoneNumbers. # noqa: E501 :type: str """ - if type is not None and len(type) > 1024: - raise ValueError("Invalid value for `type`, length must be less than or equal to `1024`") # noqa: E501 self._type = type diff --git a/jcapiv1/jcapiv1/models/systemuserreturn_recovery_email.py b/jcapiv1/jcapiv1/models/systemuserreturn_recovery_email.py new file mode 100644 index 0000000..62f3b70 --- /dev/null +++ b/jcapiv1/jcapiv1/models/systemuserreturn_recovery_email.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemuserreturnRecoveryEmail(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'address': 'str', + 'verified': 'bool', + 'verified_at': 'str' + } + + attribute_map = { + 'address': 'address', + 'verified': 'verified', + 'verified_at': 'verifiedAt' + } + + def __init__(self, address=None, verified=None, verified_at=None): # noqa: E501 + """SystemuserreturnRecoveryEmail - a model defined in Swagger""" # noqa: E501 + self._address = None + self._verified = None + self._verified_at = None + self.discriminator = None + if address is not None: + self.address = address + if verified is not None: + self.verified = verified + if verified_at is not None: + self.verified_at = verified_at + + @property + def address(self): + """Gets the address of this SystemuserreturnRecoveryEmail. # noqa: E501 + + + :return: The address of this SystemuserreturnRecoveryEmail. # noqa: E501 + :rtype: str + """ + return self._address + + @address.setter + def address(self, address): + """Sets the address of this SystemuserreturnRecoveryEmail. + + + :param address: The address of this SystemuserreturnRecoveryEmail. # noqa: E501 + :type: str + """ + + self._address = address + + @property + def verified(self): + """Gets the verified of this SystemuserreturnRecoveryEmail. # noqa: E501 + + + :return: The verified of this SystemuserreturnRecoveryEmail. # noqa: E501 + :rtype: bool + """ + return self._verified + + @verified.setter + def verified(self, verified): + """Sets the verified of this SystemuserreturnRecoveryEmail. + + + :param verified: The verified of this SystemuserreturnRecoveryEmail. # noqa: E501 + :type: bool + """ + + self._verified = verified + + @property + def verified_at(self): + """Gets the verified_at of this SystemuserreturnRecoveryEmail. # noqa: E501 + + + :return: The verified_at of this SystemuserreturnRecoveryEmail. # noqa: E501 + :rtype: str + """ + return self._verified_at + + @verified_at.setter + def verified_at(self, verified_at): + """Sets the verified_at of this SystemuserreturnRecoveryEmail. + + + :param verified_at: The verified_at of this SystemuserreturnRecoveryEmail. # noqa: E501 + :type: str + """ + + self._verified_at = verified_at + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemuserreturnRecoveryEmail, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemuserreturnRecoveryEmail): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/systemuserslist.py b/jcapiv1/jcapiv1/models/systemuserslist.py index 09c22ee..4d7ffd2 100644 --- a/jcapiv1/jcapiv1/models/systemuserslist.py +++ b/jcapiv1/jcapiv1/models/systemuserslist.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv1.models.systemuserreturn import Systemuserreturn # noqa: F401,E501 - - class Systemuserslist(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,11 +39,9 @@ class Systemuserslist(object): def __init__(self, results=None, total_count=None): # noqa: E501 """Systemuserslist - a model defined in Swagger""" # noqa: E501 - self._results = None self._total_count = None self.discriminator = None - if results is not None: self.results = results if total_count is not None: diff --git a/jcapiv1/jcapiv1/models/tag.py b/jcapiv1/jcapiv1/models/tag.py deleted file mode 100644 index ca72330..0000000 --- a/jcapiv1/jcapiv1/models/tag.py +++ /dev/null @@ -1,407 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Tag(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'str', - 'expired': 'bool', - 'external_dn': 'str', - 'external_source_type': 'str', - 'externally_managed': 'bool', - 'group_gid': 'str', - 'group_name': 'str', - 'name': 'str', - 'regular_expressions': 'list[str]', - 'send_to_ldap': 'bool', - 'systems': 'list[str]', - 'systemusers': 'list[str]' - } - - attribute_map = { - 'id': '_id', - 'expired': 'expired', - 'external_dn': 'externalDN', - 'external_source_type': 'externalSourceType', - 'externally_managed': 'externallyManaged', - 'group_gid': 'groupGid', - 'group_name': 'groupName', - 'name': 'name', - 'regular_expressions': 'regularExpressions', - 'send_to_ldap': 'sendToLDAP', - 'systems': 'systems', - 'systemusers': 'systemusers' - } - - def __init__(self, id=None, expired=None, external_dn=None, external_source_type=None, externally_managed=None, group_gid=None, group_name=None, name=None, regular_expressions=None, send_to_ldap=None, systems=None, systemusers=None): # noqa: E501 - """Tag - a model defined in Swagger""" # noqa: E501 - - self._id = None - self._expired = None - self._external_dn = None - self._external_source_type = None - self._externally_managed = None - self._group_gid = None - self._group_name = None - self._name = None - self._regular_expressions = None - self._send_to_ldap = None - self._systems = None - self._systemusers = None - self.discriminator = None - - if id is not None: - self.id = id - if expired is not None: - self.expired = expired - if external_dn is not None: - self.external_dn = external_dn - if external_source_type is not None: - self.external_source_type = external_source_type - if externally_managed is not None: - self.externally_managed = externally_managed - if group_gid is not None: - self.group_gid = group_gid - if group_name is not None: - self.group_name = group_name - if name is not None: - self.name = name - if regular_expressions is not None: - self.regular_expressions = regular_expressions - if send_to_ldap is not None: - self.send_to_ldap = send_to_ldap - if systems is not None: - self.systems = systems - if systemusers is not None: - self.systemusers = systemusers - - @property - def id(self): - """Gets the id of this Tag. # noqa: E501 - - - :return: The id of this Tag. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Tag. - - - :param id: The id of this Tag. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def expired(self): - """Gets the expired of this Tag. # noqa: E501 - - - :return: The expired of this Tag. # noqa: E501 - :rtype: bool - """ - return self._expired - - @expired.setter - def expired(self, expired): - """Sets the expired of this Tag. - - - :param expired: The expired of this Tag. # noqa: E501 - :type: bool - """ - - self._expired = expired - - @property - def external_dn(self): - """Gets the external_dn of this Tag. # noqa: E501 - - - :return: The external_dn of this Tag. # noqa: E501 - :rtype: str - """ - return self._external_dn - - @external_dn.setter - def external_dn(self, external_dn): - """Sets the external_dn of this Tag. - - - :param external_dn: The external_dn of this Tag. # noqa: E501 - :type: str - """ - - self._external_dn = external_dn - - @property - def external_source_type(self): - """Gets the external_source_type of this Tag. # noqa: E501 - - - :return: The external_source_type of this Tag. # noqa: E501 - :rtype: str - """ - return self._external_source_type - - @external_source_type.setter - def external_source_type(self, external_source_type): - """Sets the external_source_type of this Tag. - - - :param external_source_type: The external_source_type of this Tag. # noqa: E501 - :type: str - """ - - self._external_source_type = external_source_type - - @property - def externally_managed(self): - """Gets the externally_managed of this Tag. # noqa: E501 - - - :return: The externally_managed of this Tag. # noqa: E501 - :rtype: bool - """ - return self._externally_managed - - @externally_managed.setter - def externally_managed(self, externally_managed): - """Sets the externally_managed of this Tag. - - - :param externally_managed: The externally_managed of this Tag. # noqa: E501 - :type: bool - """ - - self._externally_managed = externally_managed - - @property - def group_gid(self): - """Gets the group_gid of this Tag. # noqa: E501 - - - :return: The group_gid of this Tag. # noqa: E501 - :rtype: str - """ - return self._group_gid - - @group_gid.setter - def group_gid(self, group_gid): - """Sets the group_gid of this Tag. - - - :param group_gid: The group_gid of this Tag. # noqa: E501 - :type: str - """ - - self._group_gid = group_gid - - @property - def group_name(self): - """Gets the group_name of this Tag. # noqa: E501 - - - :return: The group_name of this Tag. # noqa: E501 - :rtype: str - """ - return self._group_name - - @group_name.setter - def group_name(self, group_name): - """Sets the group_name of this Tag. - - - :param group_name: The group_name of this Tag. # noqa: E501 - :type: str - """ - - self._group_name = group_name - - @property - def name(self): - """Gets the name of this Tag. # noqa: E501 - - A unique name for the Tag. # noqa: E501 - - :return: The name of this Tag. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Tag. - - A unique name for the Tag. # noqa: E501 - - :param name: The name of this Tag. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def regular_expressions(self): - """Gets the regular_expressions of this Tag. # noqa: E501 - - - :return: The regular_expressions of this Tag. # noqa: E501 - :rtype: list[str] - """ - return self._regular_expressions - - @regular_expressions.setter - def regular_expressions(self, regular_expressions): - """Sets the regular_expressions of this Tag. - - - :param regular_expressions: The regular_expressions of this Tag. # noqa: E501 - :type: list[str] - """ - - self._regular_expressions = regular_expressions - - @property - def send_to_ldap(self): - """Gets the send_to_ldap of this Tag. # noqa: E501 - - - :return: The send_to_ldap of this Tag. # noqa: E501 - :rtype: bool - """ - return self._send_to_ldap - - @send_to_ldap.setter - def send_to_ldap(self, send_to_ldap): - """Sets the send_to_ldap of this Tag. - - - :param send_to_ldap: The send_to_ldap of this Tag. # noqa: E501 - :type: bool - """ - - self._send_to_ldap = send_to_ldap - - @property - def systems(self): - """Gets the systems of this Tag. # noqa: E501 - - An array of system ids that are associated to the Tag. # noqa: E501 - - :return: The systems of this Tag. # noqa: E501 - :rtype: list[str] - """ - return self._systems - - @systems.setter - def systems(self, systems): - """Sets the systems of this Tag. - - An array of system ids that are associated to the Tag. # noqa: E501 - - :param systems: The systems of this Tag. # noqa: E501 - :type: list[str] - """ - - self._systems = systems - - @property - def systemusers(self): - """Gets the systemusers of this Tag. # noqa: E501 - - An array of system user ids that are associated to the Tag. # noqa: E501 - - :return: The systemusers of this Tag. # noqa: E501 - :rtype: list[str] - """ - return self._systemusers - - @systemusers.setter - def systemusers(self, systemusers): - """Sets the systemusers of this Tag. - - An array of system user ids that are associated to the Tag. # noqa: E501 - - :param systemusers: The systemusers of this Tag. # noqa: E501 - :type: list[str] - """ - - self._systemusers = systemusers - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Tag, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Tag): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv1/jcapiv1/models/tagpost.py b/jcapiv1/jcapiv1/models/tagpost.py deleted file mode 100644 index c5a20e4..0000000 --- a/jcapiv1/jcapiv1/models/tagpost.py +++ /dev/null @@ -1,356 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Tagpost(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'external_dn': 'str', - 'external_source_type': 'str', - 'externally_managed': 'bool', - 'group_gid': 'str', - 'group_name': 'str', - 'name': 'str', - 'regular_expressions': 'list[str]', - 'send_to_ldap': 'bool', - 'systems': 'list[str]', - 'systemusers': 'list[str]' - } - - attribute_map = { - 'external_dn': 'externalDN', - 'external_source_type': 'externalSourceType', - 'externally_managed': 'externallyManaged', - 'group_gid': 'groupGid', - 'group_name': 'groupName', - 'name': 'name', - 'regular_expressions': 'regularExpressions', - 'send_to_ldap': 'sendToLDAP', - 'systems': 'systems', - 'systemusers': 'systemusers' - } - - def __init__(self, external_dn=None, external_source_type=None, externally_managed=None, group_gid=None, group_name=None, name=None, regular_expressions=None, send_to_ldap=None, systems=None, systemusers=None): # noqa: E501 - """Tagpost - a model defined in Swagger""" # noqa: E501 - - self._external_dn = None - self._external_source_type = None - self._externally_managed = None - self._group_gid = None - self._group_name = None - self._name = None - self._regular_expressions = None - self._send_to_ldap = None - self._systems = None - self._systemusers = None - self.discriminator = None - - if external_dn is not None: - self.external_dn = external_dn - if external_source_type is not None: - self.external_source_type = external_source_type - if externally_managed is not None: - self.externally_managed = externally_managed - if group_gid is not None: - self.group_gid = group_gid - if group_name is not None: - self.group_name = group_name - self.name = name - if regular_expressions is not None: - self.regular_expressions = regular_expressions - if send_to_ldap is not None: - self.send_to_ldap = send_to_ldap - if systems is not None: - self.systems = systems - if systemusers is not None: - self.systemusers = systemusers - - @property - def external_dn(self): - """Gets the external_dn of this Tagpost. # noqa: E501 - - - :return: The external_dn of this Tagpost. # noqa: E501 - :rtype: str - """ - return self._external_dn - - @external_dn.setter - def external_dn(self, external_dn): - """Sets the external_dn of this Tagpost. - - - :param external_dn: The external_dn of this Tagpost. # noqa: E501 - :type: str - """ - - self._external_dn = external_dn - - @property - def external_source_type(self): - """Gets the external_source_type of this Tagpost. # noqa: E501 - - - :return: The external_source_type of this Tagpost. # noqa: E501 - :rtype: str - """ - return self._external_source_type - - @external_source_type.setter - def external_source_type(self, external_source_type): - """Sets the external_source_type of this Tagpost. - - - :param external_source_type: The external_source_type of this Tagpost. # noqa: E501 - :type: str - """ - - self._external_source_type = external_source_type - - @property - def externally_managed(self): - """Gets the externally_managed of this Tagpost. # noqa: E501 - - - :return: The externally_managed of this Tagpost. # noqa: E501 - :rtype: bool - """ - return self._externally_managed - - @externally_managed.setter - def externally_managed(self, externally_managed): - """Sets the externally_managed of this Tagpost. - - - :param externally_managed: The externally_managed of this Tagpost. # noqa: E501 - :type: bool - """ - - self._externally_managed = externally_managed - - @property - def group_gid(self): - """Gets the group_gid of this Tagpost. # noqa: E501 - - - :return: The group_gid of this Tagpost. # noqa: E501 - :rtype: str - """ - return self._group_gid - - @group_gid.setter - def group_gid(self, group_gid): - """Sets the group_gid of this Tagpost. - - - :param group_gid: The group_gid of this Tagpost. # noqa: E501 - :type: str - """ - - self._group_gid = group_gid - - @property - def group_name(self): - """Gets the group_name of this Tagpost. # noqa: E501 - - - :return: The group_name of this Tagpost. # noqa: E501 - :rtype: str - """ - return self._group_name - - @group_name.setter - def group_name(self, group_name): - """Sets the group_name of this Tagpost. - - - :param group_name: The group_name of this Tagpost. # noqa: E501 - :type: str - """ - - self._group_name = group_name - - @property - def name(self): - """Gets the name of this Tagpost. # noqa: E501 - - A unique name for the Tag. # noqa: E501 - - :return: The name of this Tagpost. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Tagpost. - - A unique name for the Tag. # noqa: E501 - - :param name: The name of this Tagpost. # noqa: E501 - :type: str - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def regular_expressions(self): - """Gets the regular_expressions of this Tagpost. # noqa: E501 - - - :return: The regular_expressions of this Tagpost. # noqa: E501 - :rtype: list[str] - """ - return self._regular_expressions - - @regular_expressions.setter - def regular_expressions(self, regular_expressions): - """Sets the regular_expressions of this Tagpost. - - - :param regular_expressions: The regular_expressions of this Tagpost. # noqa: E501 - :type: list[str] - """ - - self._regular_expressions = regular_expressions - - @property - def send_to_ldap(self): - """Gets the send_to_ldap of this Tagpost. # noqa: E501 - - - :return: The send_to_ldap of this Tagpost. # noqa: E501 - :rtype: bool - """ - return self._send_to_ldap - - @send_to_ldap.setter - def send_to_ldap(self, send_to_ldap): - """Sets the send_to_ldap of this Tagpost. - - - :param send_to_ldap: The send_to_ldap of this Tagpost. # noqa: E501 - :type: bool - """ - - self._send_to_ldap = send_to_ldap - - @property - def systems(self): - """Gets the systems of this Tagpost. # noqa: E501 - - An array of system ids that are associated to the Tag. # noqa: E501 - - :return: The systems of this Tagpost. # noqa: E501 - :rtype: list[str] - """ - return self._systems - - @systems.setter - def systems(self, systems): - """Sets the systems of this Tagpost. - - An array of system ids that are associated to the Tag. # noqa: E501 - - :param systems: The systems of this Tagpost. # noqa: E501 - :type: list[str] - """ - - self._systems = systems - - @property - def systemusers(self): - """Gets the systemusers of this Tagpost. # noqa: E501 - - An array of system user ids that are associated to the Tag. # noqa: E501 - - :return: The systemusers of this Tagpost. # noqa: E501 - :rtype: list[str] - """ - return self._systemusers - - @systemusers.setter - def systemusers(self, systemusers): - """Sets the systemusers of this Tagpost. - - An array of system user ids that are associated to the Tag. # noqa: E501 - - :param systemusers: The systemusers of this Tagpost. # noqa: E501 - :type: list[str] - """ - - self._systemusers = systemusers - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Tagpost, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Tagpost): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv1/jcapiv1/models/tagput.py b/jcapiv1/jcapiv1/models/tagput.py deleted file mode 100644 index bf42cec..0000000 --- a/jcapiv1/jcapiv1/models/tagput.py +++ /dev/null @@ -1,355 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Tagput(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'external_dn': 'str', - 'external_source_type': 'str', - 'externally_managed': 'bool', - 'group_gid': 'str', - 'group_name': 'str', - 'name': 'str', - 'regular_expressions': 'list[str]', - 'send_to_ldap': 'bool', - 'systems': 'list[str]', - 'systemusers': 'list[str]' - } - - attribute_map = { - 'external_dn': 'externalDN', - 'external_source_type': 'externalSourceType', - 'externally_managed': 'externallyManaged', - 'group_gid': 'groupGid', - 'group_name': 'groupName', - 'name': 'name', - 'regular_expressions': 'regularExpressions', - 'send_to_ldap': 'sendToLDAP', - 'systems': 'systems', - 'systemusers': 'systemusers' - } - - def __init__(self, external_dn=None, external_source_type=None, externally_managed=None, group_gid=None, group_name=None, name=None, regular_expressions=None, send_to_ldap=None, systems=None, systemusers=None): # noqa: E501 - """Tagput - a model defined in Swagger""" # noqa: E501 - - self._external_dn = None - self._external_source_type = None - self._externally_managed = None - self._group_gid = None - self._group_name = None - self._name = None - self._regular_expressions = None - self._send_to_ldap = None - self._systems = None - self._systemusers = None - self.discriminator = None - - if external_dn is not None: - self.external_dn = external_dn - if external_source_type is not None: - self.external_source_type = external_source_type - if externally_managed is not None: - self.externally_managed = externally_managed - if group_gid is not None: - self.group_gid = group_gid - if group_name is not None: - self.group_name = group_name - if name is not None: - self.name = name - if regular_expressions is not None: - self.regular_expressions = regular_expressions - if send_to_ldap is not None: - self.send_to_ldap = send_to_ldap - if systems is not None: - self.systems = systems - if systemusers is not None: - self.systemusers = systemusers - - @property - def external_dn(self): - """Gets the external_dn of this Tagput. # noqa: E501 - - - :return: The external_dn of this Tagput. # noqa: E501 - :rtype: str - """ - return self._external_dn - - @external_dn.setter - def external_dn(self, external_dn): - """Sets the external_dn of this Tagput. - - - :param external_dn: The external_dn of this Tagput. # noqa: E501 - :type: str - """ - - self._external_dn = external_dn - - @property - def external_source_type(self): - """Gets the external_source_type of this Tagput. # noqa: E501 - - - :return: The external_source_type of this Tagput. # noqa: E501 - :rtype: str - """ - return self._external_source_type - - @external_source_type.setter - def external_source_type(self, external_source_type): - """Sets the external_source_type of this Tagput. - - - :param external_source_type: The external_source_type of this Tagput. # noqa: E501 - :type: str - """ - - self._external_source_type = external_source_type - - @property - def externally_managed(self): - """Gets the externally_managed of this Tagput. # noqa: E501 - - - :return: The externally_managed of this Tagput. # noqa: E501 - :rtype: bool - """ - return self._externally_managed - - @externally_managed.setter - def externally_managed(self, externally_managed): - """Sets the externally_managed of this Tagput. - - - :param externally_managed: The externally_managed of this Tagput. # noqa: E501 - :type: bool - """ - - self._externally_managed = externally_managed - - @property - def group_gid(self): - """Gets the group_gid of this Tagput. # noqa: E501 - - - :return: The group_gid of this Tagput. # noqa: E501 - :rtype: str - """ - return self._group_gid - - @group_gid.setter - def group_gid(self, group_gid): - """Sets the group_gid of this Tagput. - - - :param group_gid: The group_gid of this Tagput. # noqa: E501 - :type: str - """ - - self._group_gid = group_gid - - @property - def group_name(self): - """Gets the group_name of this Tagput. # noqa: E501 - - - :return: The group_name of this Tagput. # noqa: E501 - :rtype: str - """ - return self._group_name - - @group_name.setter - def group_name(self, group_name): - """Sets the group_name of this Tagput. - - - :param group_name: The group_name of this Tagput. # noqa: E501 - :type: str - """ - - self._group_name = group_name - - @property - def name(self): - """Gets the name of this Tagput. # noqa: E501 - - A unique name for the Tag. # noqa: E501 - - :return: The name of this Tagput. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Tagput. - - A unique name for the Tag. # noqa: E501 - - :param name: The name of this Tagput. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def regular_expressions(self): - """Gets the regular_expressions of this Tagput. # noqa: E501 - - - :return: The regular_expressions of this Tagput. # noqa: E501 - :rtype: list[str] - """ - return self._regular_expressions - - @regular_expressions.setter - def regular_expressions(self, regular_expressions): - """Sets the regular_expressions of this Tagput. - - - :param regular_expressions: The regular_expressions of this Tagput. # noqa: E501 - :type: list[str] - """ - - self._regular_expressions = regular_expressions - - @property - def send_to_ldap(self): - """Gets the send_to_ldap of this Tagput. # noqa: E501 - - - :return: The send_to_ldap of this Tagput. # noqa: E501 - :rtype: bool - """ - return self._send_to_ldap - - @send_to_ldap.setter - def send_to_ldap(self, send_to_ldap): - """Sets the send_to_ldap of this Tagput. - - - :param send_to_ldap: The send_to_ldap of this Tagput. # noqa: E501 - :type: bool - """ - - self._send_to_ldap = send_to_ldap - - @property - def systems(self): - """Gets the systems of this Tagput. # noqa: E501 - - An array of system ids that are associated to the Tag. # noqa: E501 - - :return: The systems of this Tagput. # noqa: E501 - :rtype: list[str] - """ - return self._systems - - @systems.setter - def systems(self, systems): - """Sets the systems of this Tagput. - - An array of system ids that are associated to the Tag. # noqa: E501 - - :param systems: The systems of this Tagput. # noqa: E501 - :type: list[str] - """ - - self._systems = systems - - @property - def systemusers(self): - """Gets the systemusers of this Tagput. # noqa: E501 - - An array of system user ids that are associated to the Tag. # noqa: E501 - - :return: The systemusers of this Tagput. # noqa: E501 - :rtype: list[str] - """ - return self._systemusers - - @systemusers.setter - def systemusers(self, systemusers): - """Sets the systemusers of this Tagput. - - An array of system user ids that are associated to the Tag. # noqa: E501 - - :param systemusers: The systemusers of this Tagput. # noqa: E501 - :type: list[str] - """ - - self._systemusers = systemusers - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Tagput, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Tagput): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv1/jcapiv1/models/tagslist.py b/jcapiv1/jcapiv1/models/tagslist.py deleted file mode 100644 index b5de412..0000000 --- a/jcapiv1/jcapiv1/models/tagslist.py +++ /dev/null @@ -1,147 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - -from jcapiv1.models.tag import Tag # noqa: F401,E501 - - -class Tagslist(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'results': 'list[Tag]', - 'total_count': 'int' - } - - attribute_map = { - 'results': 'results', - 'total_count': 'totalCount' - } - - def __init__(self, results=None, total_count=None): # noqa: E501 - """Tagslist - a model defined in Swagger""" # noqa: E501 - - self._results = None - self._total_count = None - self.discriminator = None - - if results is not None: - self.results = results - if total_count is not None: - self.total_count = total_count - - @property - def results(self): - """Gets the results of this Tagslist. # noqa: E501 - - The list of tags. # noqa: E501 - - :return: The results of this Tagslist. # noqa: E501 - :rtype: list[Tag] - """ - return self._results - - @results.setter - def results(self, results): - """Sets the results of this Tagslist. - - The list of tags. # noqa: E501 - - :param results: The results of this Tagslist. # noqa: E501 - :type: list[Tag] - """ - - self._results = results - - @property - def total_count(self): - """Gets the total_count of this Tagslist. # noqa: E501 - - The total number of tags. # noqa: E501 - - :return: The total_count of this Tagslist. # noqa: E501 - :rtype: int - """ - return self._total_count - - @total_count.setter - def total_count(self, total_count): - """Sets the total_count of this Tagslist. - - The total number of tags. # noqa: E501 - - :param total_count: The total_count of this Tagslist. # noqa: E501 - :type: int - """ - - self._total_count = total_count - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Tagslist, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Tagslist): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv1/jcapiv1/models/triggerreturn.py b/jcapiv1/jcapiv1/models/triggerreturn.py new file mode 100644 index 0000000..38261af --- /dev/null +++ b/jcapiv1/jcapiv1/models/triggerreturn.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Triggerreturn(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'triggered': 'list[str]' + } + + attribute_map = { + 'triggered': 'triggered' + } + + def __init__(self, triggered=None): # noqa: E501 + """Triggerreturn - a model defined in Swagger""" # noqa: E501 + self._triggered = None + self.discriminator = None + if triggered is not None: + self.triggered = triggered + + @property + def triggered(self): + """Gets the triggered of this Triggerreturn. # noqa: E501 + + + :return: The triggered of this Triggerreturn. # noqa: E501 + :rtype: list[str] + """ + return self._triggered + + @triggered.setter + def triggered(self, triggered): + """Sets the triggered of this Triggerreturn. + + + :param triggered: The triggered of this Triggerreturn. # noqa: E501 + :type: list[str] + """ + + self._triggered = triggered + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Triggerreturn, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Triggerreturn): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/trustedapp_config_get.py b/jcapiv1/jcapiv1/models/trustedapp_config_get.py new file mode 100644 index 0000000..f8a1754 --- /dev/null +++ b/jcapiv1/jcapiv1/models/trustedapp_config_get.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TrustedappConfigGet(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'checksum': 'str', + 'trusted_apps': 'list[TrustedappConfigGetTrustedApps]' + } + + attribute_map = { + 'checksum': 'checksum', + 'trusted_apps': 'trustedApps' + } + + def __init__(self, checksum=None, trusted_apps=None): # noqa: E501 + """TrustedappConfigGet - a model defined in Swagger""" # noqa: E501 + self._checksum = None + self._trusted_apps = None + self.discriminator = None + self.checksum = checksum + self.trusted_apps = trusted_apps + + @property + def checksum(self): + """Gets the checksum of this TrustedappConfigGet. # noqa: E501 + + Checksum to validate the trustedApp configuration for the organization # noqa: E501 + + :return: The checksum of this TrustedappConfigGet. # noqa: E501 + :rtype: str + """ + return self._checksum + + @checksum.setter + def checksum(self, checksum): + """Sets the checksum of this TrustedappConfigGet. + + Checksum to validate the trustedApp configuration for the organization # noqa: E501 + + :param checksum: The checksum of this TrustedappConfigGet. # noqa: E501 + :type: str + """ + if checksum is None: + raise ValueError("Invalid value for `checksum`, must not be `None`") # noqa: E501 + + self._checksum = checksum + + @property + def trusted_apps(self): + """Gets the trusted_apps of this TrustedappConfigGet. # noqa: E501 + + List of authorized apps for the organization # noqa: E501 + + :return: The trusted_apps of this TrustedappConfigGet. # noqa: E501 + :rtype: list[TrustedappConfigGetTrustedApps] + """ + return self._trusted_apps + + @trusted_apps.setter + def trusted_apps(self, trusted_apps): + """Sets the trusted_apps of this TrustedappConfigGet. + + List of authorized apps for the organization # noqa: E501 + + :param trusted_apps: The trusted_apps of this TrustedappConfigGet. # noqa: E501 + :type: list[TrustedappConfigGetTrustedApps] + """ + if trusted_apps is None: + raise ValueError("Invalid value for `trusted_apps`, must not be `None`") # noqa: E501 + + self._trusted_apps = trusted_apps + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TrustedappConfigGet, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TrustedappConfigGet): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/trustedapp_config_get_trusted_apps.py b/jcapiv1/jcapiv1/models/trustedapp_config_get_trusted_apps.py new file mode 100644 index 0000000..2a47299 --- /dev/null +++ b/jcapiv1/jcapiv1/models/trustedapp_config_get_trusted_apps.py @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TrustedappConfigGetTrustedApps(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'path': 'str', + 'teamid': 'str' + } + + attribute_map = { + 'name': 'name', + 'path': 'path', + 'teamid': 'teamid' + } + + def __init__(self, name=None, path=None, teamid=None): # noqa: E501 + """TrustedappConfigGetTrustedApps - a model defined in Swagger""" # noqa: E501 + self._name = None + self._path = None + self._teamid = None + self.discriminator = None + self.name = name + if path is not None: + self.path = path + if teamid is not None: + self.teamid = teamid + + @property + def name(self): + """Gets the name of this TrustedappConfigGetTrustedApps. # noqa: E501 + + Name of the trusted application # noqa: E501 + + :return: The name of this TrustedappConfigGetTrustedApps. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this TrustedappConfigGetTrustedApps. + + Name of the trusted application # noqa: E501 + + :param name: The name of this TrustedappConfigGetTrustedApps. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def path(self): + """Gets the path of this TrustedappConfigGetTrustedApps. # noqa: E501 + + Absolute path for the app's location in user's device # noqa: E501 + + :return: The path of this TrustedappConfigGetTrustedApps. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this TrustedappConfigGetTrustedApps. + + Absolute path for the app's location in user's device # noqa: E501 + + :param path: The path of this TrustedappConfigGetTrustedApps. # noqa: E501 + :type: str + """ + + self._path = path + + @property + def teamid(self): + """Gets the teamid of this TrustedappConfigGetTrustedApps. # noqa: E501 + + App's Team ID # noqa: E501 + + :return: The teamid of this TrustedappConfigGetTrustedApps. # noqa: E501 + :rtype: str + """ + return self._teamid + + @teamid.setter + def teamid(self, teamid): + """Sets the teamid of this TrustedappConfigGetTrustedApps. + + App's Team ID # noqa: E501 + + :param teamid: The teamid of this TrustedappConfigGetTrustedApps. # noqa: E501 + :type: str + """ + + self._teamid = teamid + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TrustedappConfigGetTrustedApps, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TrustedappConfigGetTrustedApps): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/trustedapp_config_put.py b/jcapiv1/jcapiv1/models/trustedapp_config_put.py new file mode 100644 index 0000000..2b57584 --- /dev/null +++ b/jcapiv1/jcapiv1/models/trustedapp_config_put.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TrustedappConfigPut(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'trusted_apps': 'list[TrustedappConfigGetTrustedApps]' + } + + attribute_map = { + 'trusted_apps': 'trustedApps' + } + + def __init__(self, trusted_apps=None): # noqa: E501 + """TrustedappConfigPut - a model defined in Swagger""" # noqa: E501 + self._trusted_apps = None + self.discriminator = None + self.trusted_apps = trusted_apps + + @property + def trusted_apps(self): + """Gets the trusted_apps of this TrustedappConfigPut. # noqa: E501 + + List of authorized apps for the organization # noqa: E501 + + :return: The trusted_apps of this TrustedappConfigPut. # noqa: E501 + :rtype: list[TrustedappConfigGetTrustedApps] + """ + return self._trusted_apps + + @trusted_apps.setter + def trusted_apps(self, trusted_apps): + """Sets the trusted_apps of this TrustedappConfigPut. + + List of authorized apps for the organization # noqa: E501 + + :param trusted_apps: The trusted_apps of this TrustedappConfigPut. # noqa: E501 + :type: list[TrustedappConfigGetTrustedApps] + """ + if trusted_apps is None: + raise ValueError("Invalid value for `trusted_apps`, must not be `None`") # noqa: E501 + + self._trusted_apps = trusted_apps + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TrustedappConfigPut, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TrustedappConfigPut): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/userput.py b/jcapiv1/jcapiv1/models/userput.py new file mode 100644 index 0000000..ec2875b --- /dev/null +++ b/jcapiv1/jcapiv1/models/userput.py @@ -0,0 +1,266 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Userput(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'email': 'str', + 'enable_multi_factor': 'bool', + 'firstname': 'str', + 'growth_data': 'object', + 'last_whats_new_checked': 'date', + 'lastname': 'str', + 'role_name': 'str' + } + + attribute_map = { + 'email': 'email', + 'enable_multi_factor': 'enableMultiFactor', + 'firstname': 'firstname', + 'growth_data': 'growthData', + 'last_whats_new_checked': 'lastWhatsNewChecked', + 'lastname': 'lastname', + 'role_name': 'roleName' + } + + def __init__(self, email=None, enable_multi_factor=None, firstname=None, growth_data=None, last_whats_new_checked=None, lastname=None, role_name=None): # noqa: E501 + """Userput - a model defined in Swagger""" # noqa: E501 + self._email = None + self._enable_multi_factor = None + self._firstname = None + self._growth_data = None + self._last_whats_new_checked = None + self._lastname = None + self._role_name = None + self.discriminator = None + if email is not None: + self.email = email + if enable_multi_factor is not None: + self.enable_multi_factor = enable_multi_factor + if firstname is not None: + self.firstname = firstname + if growth_data is not None: + self.growth_data = growth_data + if last_whats_new_checked is not None: + self.last_whats_new_checked = last_whats_new_checked + if lastname is not None: + self.lastname = lastname + if role_name is not None: + self.role_name = role_name + + @property + def email(self): + """Gets the email of this Userput. # noqa: E501 + + + :return: The email of this Userput. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this Userput. + + + :param email: The email of this Userput. # noqa: E501 + :type: str + """ + + self._email = email + + @property + def enable_multi_factor(self): + """Gets the enable_multi_factor of this Userput. # noqa: E501 + + + :return: The enable_multi_factor of this Userput. # noqa: E501 + :rtype: bool + """ + return self._enable_multi_factor + + @enable_multi_factor.setter + def enable_multi_factor(self, enable_multi_factor): + """Sets the enable_multi_factor of this Userput. + + + :param enable_multi_factor: The enable_multi_factor of this Userput. # noqa: E501 + :type: bool + """ + + self._enable_multi_factor = enable_multi_factor + + @property + def firstname(self): + """Gets the firstname of this Userput. # noqa: E501 + + + :return: The firstname of this Userput. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this Userput. + + + :param firstname: The firstname of this Userput. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def growth_data(self): + """Gets the growth_data of this Userput. # noqa: E501 + + + :return: The growth_data of this Userput. # noqa: E501 + :rtype: object + """ + return self._growth_data + + @growth_data.setter + def growth_data(self, growth_data): + """Sets the growth_data of this Userput. + + + :param growth_data: The growth_data of this Userput. # noqa: E501 + :type: object + """ + + self._growth_data = growth_data + + @property + def last_whats_new_checked(self): + """Gets the last_whats_new_checked of this Userput. # noqa: E501 + + + :return: The last_whats_new_checked of this Userput. # noqa: E501 + :rtype: date + """ + return self._last_whats_new_checked + + @last_whats_new_checked.setter + def last_whats_new_checked(self, last_whats_new_checked): + """Sets the last_whats_new_checked of this Userput. + + + :param last_whats_new_checked: The last_whats_new_checked of this Userput. # noqa: E501 + :type: date + """ + + self._last_whats_new_checked = last_whats_new_checked + + @property + def lastname(self): + """Gets the lastname of this Userput. # noqa: E501 + + + :return: The lastname of this Userput. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this Userput. + + + :param lastname: The lastname of this Userput. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def role_name(self): + """Gets the role_name of this Userput. # noqa: E501 + + + :return: The role_name of this Userput. # noqa: E501 + :rtype: str + """ + return self._role_name + + @role_name.setter + def role_name(self, role_name): + """Sets the role_name of this Userput. + + + :param role_name: The role_name of this Userput. # noqa: E501 + :type: str + """ + + self._role_name = role_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Userput, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Userput): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/userreturn.py b/jcapiv1/jcapiv1/models/userreturn.py new file mode 100644 index 0000000..431bade --- /dev/null +++ b/jcapiv1/jcapiv1/models/userreturn.py @@ -0,0 +1,526 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Userreturn(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'created': 'datetime', + 'disable_introduction': 'bool', + 'email': 'str', + 'enable_multi_factor': 'bool', + 'firstname': 'str', + 'growth_data': 'UserreturnGrowthData', + 'last_whats_new_checked': 'datetime', + 'lastname': 'str', + 'organization': 'str', + 'provider': 'str', + 'role': 'str', + 'role_name': 'str', + 'session_count': 'int', + 'suspended': 'bool', + 'totp_enrolled': 'bool', + 'users_time_zone': 'str' + } + + attribute_map = { + 'id': '_id', + 'created': 'created', + 'disable_introduction': 'disableIntroduction', + 'email': 'email', + 'enable_multi_factor': 'enableMultiFactor', + 'firstname': 'firstname', + 'growth_data': 'growthData', + 'last_whats_new_checked': 'lastWhatsNewChecked', + 'lastname': 'lastname', + 'organization': 'organization', + 'provider': 'provider', + 'role': 'role', + 'role_name': 'roleName', + 'session_count': 'sessionCount', + 'suspended': 'suspended', + 'totp_enrolled': 'totpEnrolled', + 'users_time_zone': 'usersTimeZone' + } + + def __init__(self, id=None, created=None, disable_introduction=None, email=None, enable_multi_factor=None, firstname=None, growth_data=None, last_whats_new_checked=None, lastname=None, organization=None, provider=None, role=None, role_name=None, session_count=None, suspended=None, totp_enrolled=None, users_time_zone=None): # noqa: E501 + """Userreturn - a model defined in Swagger""" # noqa: E501 + self._id = None + self._created = None + self._disable_introduction = None + self._email = None + self._enable_multi_factor = None + self._firstname = None + self._growth_data = None + self._last_whats_new_checked = None + self._lastname = None + self._organization = None + self._provider = None + self._role = None + self._role_name = None + self._session_count = None + self._suspended = None + self._totp_enrolled = None + self._users_time_zone = None + self.discriminator = None + if id is not None: + self.id = id + if created is not None: + self.created = created + if disable_introduction is not None: + self.disable_introduction = disable_introduction + if email is not None: + self.email = email + if enable_multi_factor is not None: + self.enable_multi_factor = enable_multi_factor + if firstname is not None: + self.firstname = firstname + if growth_data is not None: + self.growth_data = growth_data + if last_whats_new_checked is not None: + self.last_whats_new_checked = last_whats_new_checked + if lastname is not None: + self.lastname = lastname + if organization is not None: + self.organization = organization + if provider is not None: + self.provider = provider + if role is not None: + self.role = role + if role_name is not None: + self.role_name = role_name + if session_count is not None: + self.session_count = session_count + if suspended is not None: + self.suspended = suspended + if totp_enrolled is not None: + self.totp_enrolled = totp_enrolled + if users_time_zone is not None: + self.users_time_zone = users_time_zone + + @property + def id(self): + """Gets the id of this Userreturn. # noqa: E501 + + + :return: The id of this Userreturn. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Userreturn. + + + :param id: The id of this Userreturn. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def created(self): + """Gets the created of this Userreturn. # noqa: E501 + + + :return: The created of this Userreturn. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this Userreturn. + + + :param created: The created of this Userreturn. # noqa: E501 + :type: datetime + """ + + self._created = created + + @property + def disable_introduction(self): + """Gets the disable_introduction of this Userreturn. # noqa: E501 + + + :return: The disable_introduction of this Userreturn. # noqa: E501 + :rtype: bool + """ + return self._disable_introduction + + @disable_introduction.setter + def disable_introduction(self, disable_introduction): + """Sets the disable_introduction of this Userreturn. + + + :param disable_introduction: The disable_introduction of this Userreturn. # noqa: E501 + :type: bool + """ + + self._disable_introduction = disable_introduction + + @property + def email(self): + """Gets the email of this Userreturn. # noqa: E501 + + + :return: The email of this Userreturn. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this Userreturn. + + + :param email: The email of this Userreturn. # noqa: E501 + :type: str + """ + + self._email = email + + @property + def enable_multi_factor(self): + """Gets the enable_multi_factor of this Userreturn. # noqa: E501 + + + :return: The enable_multi_factor of this Userreturn. # noqa: E501 + :rtype: bool + """ + return self._enable_multi_factor + + @enable_multi_factor.setter + def enable_multi_factor(self, enable_multi_factor): + """Sets the enable_multi_factor of this Userreturn. + + + :param enable_multi_factor: The enable_multi_factor of this Userreturn. # noqa: E501 + :type: bool + """ + + self._enable_multi_factor = enable_multi_factor + + @property + def firstname(self): + """Gets the firstname of this Userreturn. # noqa: E501 + + + :return: The firstname of this Userreturn. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this Userreturn. + + + :param firstname: The firstname of this Userreturn. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def growth_data(self): + """Gets the growth_data of this Userreturn. # noqa: E501 + + + :return: The growth_data of this Userreturn. # noqa: E501 + :rtype: UserreturnGrowthData + """ + return self._growth_data + + @growth_data.setter + def growth_data(self, growth_data): + """Sets the growth_data of this Userreturn. + + + :param growth_data: The growth_data of this Userreturn. # noqa: E501 + :type: UserreturnGrowthData + """ + + self._growth_data = growth_data + + @property + def last_whats_new_checked(self): + """Gets the last_whats_new_checked of this Userreturn. # noqa: E501 + + + :return: The last_whats_new_checked of this Userreturn. # noqa: E501 + :rtype: datetime + """ + return self._last_whats_new_checked + + @last_whats_new_checked.setter + def last_whats_new_checked(self, last_whats_new_checked): + """Sets the last_whats_new_checked of this Userreturn. + + + :param last_whats_new_checked: The last_whats_new_checked of this Userreturn. # noqa: E501 + :type: datetime + """ + + self._last_whats_new_checked = last_whats_new_checked + + @property + def lastname(self): + """Gets the lastname of this Userreturn. # noqa: E501 + + + :return: The lastname of this Userreturn. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this Userreturn. + + + :param lastname: The lastname of this Userreturn. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def organization(self): + """Gets the organization of this Userreturn. # noqa: E501 + + + :return: The organization of this Userreturn. # noqa: E501 + :rtype: str + """ + return self._organization + + @organization.setter + def organization(self, organization): + """Sets the organization of this Userreturn. + + + :param organization: The organization of this Userreturn. # noqa: E501 + :type: str + """ + + self._organization = organization + + @property + def provider(self): + """Gets the provider of this Userreturn. # noqa: E501 + + + :return: The provider of this Userreturn. # noqa: E501 + :rtype: str + """ + return self._provider + + @provider.setter + def provider(self, provider): + """Sets the provider of this Userreturn. + + + :param provider: The provider of this Userreturn. # noqa: E501 + :type: str + """ + + self._provider = provider + + @property + def role(self): + """Gets the role of this Userreturn. # noqa: E501 + + + :return: The role of this Userreturn. # noqa: E501 + :rtype: str + """ + return self._role + + @role.setter + def role(self, role): + """Sets the role of this Userreturn. + + + :param role: The role of this Userreturn. # noqa: E501 + :type: str + """ + + self._role = role + + @property + def role_name(self): + """Gets the role_name of this Userreturn. # noqa: E501 + + + :return: The role_name of this Userreturn. # noqa: E501 + :rtype: str + """ + return self._role_name + + @role_name.setter + def role_name(self, role_name): + """Sets the role_name of this Userreturn. + + + :param role_name: The role_name of this Userreturn. # noqa: E501 + :type: str + """ + + self._role_name = role_name + + @property + def session_count(self): + """Gets the session_count of this Userreturn. # noqa: E501 + + + :return: The session_count of this Userreturn. # noqa: E501 + :rtype: int + """ + return self._session_count + + @session_count.setter + def session_count(self, session_count): + """Sets the session_count of this Userreturn. + + + :param session_count: The session_count of this Userreturn. # noqa: E501 + :type: int + """ + + self._session_count = session_count + + @property + def suspended(self): + """Gets the suspended of this Userreturn. # noqa: E501 + + + :return: The suspended of this Userreturn. # noqa: E501 + :rtype: bool + """ + return self._suspended + + @suspended.setter + def suspended(self, suspended): + """Sets the suspended of this Userreturn. + + + :param suspended: The suspended of this Userreturn. # noqa: E501 + :type: bool + """ + + self._suspended = suspended + + @property + def totp_enrolled(self): + """Gets the totp_enrolled of this Userreturn. # noqa: E501 + + + :return: The totp_enrolled of this Userreturn. # noqa: E501 + :rtype: bool + """ + return self._totp_enrolled + + @totp_enrolled.setter + def totp_enrolled(self, totp_enrolled): + """Sets the totp_enrolled of this Userreturn. + + + :param totp_enrolled: The totp_enrolled of this Userreturn. # noqa: E501 + :type: bool + """ + + self._totp_enrolled = totp_enrolled + + @property + def users_time_zone(self): + """Gets the users_time_zone of this Userreturn. # noqa: E501 + + + :return: The users_time_zone of this Userreturn. # noqa: E501 + :rtype: str + """ + return self._users_time_zone + + @users_time_zone.setter + def users_time_zone(self, users_time_zone): + """Sets the users_time_zone of this Userreturn. + + + :param users_time_zone: The users_time_zone of this Userreturn. # noqa: E501 + :type: str + """ + + self._users_time_zone = users_time_zone + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Userreturn, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Userreturn): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/userreturn_growth_data.py b/jcapiv1/jcapiv1/models/userreturn_growth_data.py new file mode 100644 index 0000000..49e4add --- /dev/null +++ b/jcapiv1/jcapiv1/models/userreturn_growth_data.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class UserreturnGrowthData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'experiment_states': 'object', + 'onboarding_state': 'object' + } + + attribute_map = { + 'experiment_states': 'experimentStates', + 'onboarding_state': 'onboardingState' + } + + def __init__(self, experiment_states=None, onboarding_state=None): # noqa: E501 + """UserreturnGrowthData - a model defined in Swagger""" # noqa: E501 + self._experiment_states = None + self._onboarding_state = None + self.discriminator = None + if experiment_states is not None: + self.experiment_states = experiment_states + if onboarding_state is not None: + self.onboarding_state = onboarding_state + + @property + def experiment_states(self): + """Gets the experiment_states of this UserreturnGrowthData. # noqa: E501 + + + :return: The experiment_states of this UserreturnGrowthData. # noqa: E501 + :rtype: object + """ + return self._experiment_states + + @experiment_states.setter + def experiment_states(self, experiment_states): + """Sets the experiment_states of this UserreturnGrowthData. + + + :param experiment_states: The experiment_states of this UserreturnGrowthData. # noqa: E501 + :type: object + """ + + self._experiment_states = experiment_states + + @property + def onboarding_state(self): + """Gets the onboarding_state of this UserreturnGrowthData. # noqa: E501 + + + :return: The onboarding_state of this UserreturnGrowthData. # noqa: E501 + :rtype: object + """ + return self._onboarding_state + + @onboarding_state.setter + def onboarding_state(self, onboarding_state): + """Sets the onboarding_state of this UserreturnGrowthData. + + + :param onboarding_state: The onboarding_state of this UserreturnGrowthData. # noqa: E501 + :type: object + """ + + self._onboarding_state = onboarding_state + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UserreturnGrowthData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UserreturnGrowthData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv1/jcapiv1/models/usersystembinding.py b/jcapiv1/jcapiv1/models/usersystembinding.py deleted file mode 100644 index fd2c28d..0000000 --- a/jcapiv1/jcapiv1/models/usersystembinding.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Usersystembinding(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """Usersystembinding - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Usersystembinding, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Usersystembinding): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv1/jcapiv1/models/usersystembindingsput.py b/jcapiv1/jcapiv1/models/usersystembindingsput.py deleted file mode 100644 index 8a111bf..0000000 --- a/jcapiv1/jcapiv1/models/usersystembindingsput.py +++ /dev/null @@ -1,147 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Usersystembindingsput(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'add': 'list[str]', - 'remove': 'list[str]' - } - - attribute_map = { - 'add': 'add', - 'remove': 'remove' - } - - def __init__(self, add=None, remove=None): # noqa: E501 - """Usersystembindingsput - a model defined in Swagger""" # noqa: E501 - - self._add = None - self._remove = None - self.discriminator = None - - self.add = add - self.remove = remove - - @property - def add(self): - """Gets the add of this Usersystembindingsput. # noqa: E501 - - The list of system ids to be added to this user. # noqa: E501 - - :return: The add of this Usersystembindingsput. # noqa: E501 - :rtype: list[str] - """ - return self._add - - @add.setter - def add(self, add): - """Sets the add of this Usersystembindingsput. - - The list of system ids to be added to this user. # noqa: E501 - - :param add: The add of this Usersystembindingsput. # noqa: E501 - :type: list[str] - """ - if add is None: - raise ValueError("Invalid value for `add`, must not be `None`") # noqa: E501 - - self._add = add - - @property - def remove(self): - """Gets the remove of this Usersystembindingsput. # noqa: E501 - - The list of system ids to be removed from this user. # noqa: E501 - - :return: The remove of this Usersystembindingsput. # noqa: E501 - :rtype: list[str] - """ - return self._remove - - @remove.setter - def remove(self, remove): - """Sets the remove of this Usersystembindingsput. - - The list of system ids to be removed from this user. # noqa: E501 - - :param remove: The remove of this Usersystembindingsput. # noqa: E501 - :type: list[str] - """ - if remove is None: - raise ValueError("Invalid value for `remove`, must not be `None`") # noqa: E501 - - self._remove = remove - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Usersystembindingsput, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Usersystembindingsput): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv1/jcapiv1/rest.py b/jcapiv1/jcapiv1/rest.py index 3586af9..c7cc0e5 100644 --- a/jcapiv1/jcapiv1/rest.py +++ b/jcapiv1/jcapiv1/rest.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import io @@ -156,7 +155,7 @@ def request(self, method, url, query_params=None, headers=None, if query_params: url += '?' + urlencode(query_params) if re.search('json', headers['Content-Type'], re.IGNORECASE): - request_body = None + request_body = '{}' if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( @@ -216,11 +215,6 @@ def request(self, method, url, query_params=None, headers=None, if _preload_content: r = RESTResponse(r) - # In the python 3, the response.data is bytes. - # we need to decode it to string. - if six.PY3: - r.data = r.data.decode('utf8') - # log response body logger.debug("response body: %s", r.data) diff --git a/jcapiv1/setup.py b/jcapiv1/setup.py index 3113ba7..9edada9 100644 --- a/jcapiv1/setup.py +++ b/jcapiv1/setup.py @@ -1,20 +1,19 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from setuptools import setup, find_packages # noqa: H301 NAME = "jcapiv1" -VERSION = "4.0.0" +VERSION = "5.0.0" # To install the library, run the following # # python setup.py install @@ -27,14 +26,14 @@ setup( name=NAME, version=VERSION, - description="JumpCloud APIs", - author_email="", + description="JumpCloud API", + author_email="support@jumpcloud.com", url="", - keywords=["Swagger", "JumpCloud APIs"], + keywords=["Swagger", "JumpCloud API"], install_requires=REQUIRES, packages=find_packages(), include_package_data=True, long_description="""\ - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 """ ) diff --git a/jcapiv1/test/test_application.py b/jcapiv1/test/test_application.py index 2dac9d3..503271f 100644 --- a/jcapiv1/test/test_application.py +++ b/jcapiv1/test/test_application.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_application_config.py b/jcapiv1/test/test_application_config.py index b926f60..9b31819 100644 --- a/jcapiv1/test/test_application_config.py +++ b/jcapiv1/test/test_application_config.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_application_config_acs_url.py b/jcapiv1/test/test_application_config_acs_url.py index 4e8bc45..d938ea6 100644 --- a/jcapiv1/test/test_application_config_acs_url.py +++ b/jcapiv1/test/test_application_config_acs_url.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_application_config_acs_url_tooltip.py b/jcapiv1/test/test_application_config_acs_url_tooltip.py index 9f3ca87..ce291c8 100644 --- a/jcapiv1/test/test_application_config_acs_url_tooltip.py +++ b/jcapiv1/test/test_application_config_acs_url_tooltip.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_application_config_acs_url_tooltip_variables.py b/jcapiv1/test/test_application_config_acs_url_tooltip_variables.py index 1947ea3..574b9ce 100644 --- a/jcapiv1/test/test_application_config_acs_url_tooltip_variables.py +++ b/jcapiv1/test/test_application_config_acs_url_tooltip_variables.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_application_config_constant_attributes.py b/jcapiv1/test/test_application_config_constant_attributes.py index 1c4098a..d89597e 100644 --- a/jcapiv1/test/test_application_config_constant_attributes.py +++ b/jcapiv1/test/test_application_config_constant_attributes.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_application_config_constant_attributes_value.py b/jcapiv1/test/test_application_config_constant_attributes_value.py index 2480ec6..0ab85f1 100644 --- a/jcapiv1/test/test_application_config_constant_attributes_value.py +++ b/jcapiv1/test/test_application_config_constant_attributes_value.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_application_config_database_attributes.py b/jcapiv1/test/test_application_config_database_attributes.py index a7fd655..c44f780 100644 --- a/jcapiv1/test/test_application_config_database_attributes.py +++ b/jcapiv1/test/test_application_config_database_attributes.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_application_logo.py b/jcapiv1/test/test_application_logo.py new file mode 100644 index 0000000..6a0a17c --- /dev/null +++ b/jcapiv1/test/test_application_logo.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.application_logo import ApplicationLogo # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestApplicationLogo(unittest.TestCase): + """ApplicationLogo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApplicationLogo(self): + """Test ApplicationLogo""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.application_logo.ApplicationLogo() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_application_templates_api.py b/jcapiv1/test/test_application_templates_api.py index 8aae333..4292d45 100644 --- a/jcapiv1/test/test_application_templates_api.py +++ b/jcapiv1/test/test_application_templates_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestApplicationTemplatesApi(unittest.TestCase): """ApplicationTemplatesApi unit test stubs""" def setUp(self): - self.api = jcapiv1.api.application_templates_api.ApplicationTemplatesApi() # noqa: E501 + self.api = ApplicationTemplatesApi() # noqa: E501 def tearDown(self): pass diff --git a/jcapiv1/test/test_applications_api.py b/jcapiv1/test/test_applications_api.py index 3262266..b97b6ab 100644 --- a/jcapiv1/test/test_applications_api.py +++ b/jcapiv1/test/test_applications_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestApplicationsApi(unittest.TestCase): """ApplicationsApi unit test stubs""" def setUp(self): - self.api = jcapiv1.api.applications_api.ApplicationsApi() # noqa: E501 + self.api = ApplicationsApi() # noqa: E501 def tearDown(self): pass diff --git a/jcapiv1/test/test_applicationslist.py b/jcapiv1/test/test_applicationslist.py index 88c0ee0..76e58a6 100644 --- a/jcapiv1/test/test_applicationslist.py +++ b/jcapiv1/test/test_applicationslist.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_applicationtemplate.py b/jcapiv1/test/test_applicationtemplate.py index 54aa785..c910258 100644 --- a/jcapiv1/test/test_applicationtemplate.py +++ b/jcapiv1/test/test_applicationtemplate.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_applicationtemplate_jit.py b/jcapiv1/test/test_applicationtemplate_jit.py index ea25bbf..b8ece3f 100644 --- a/jcapiv1/test/test_applicationtemplate_jit.py +++ b/jcapiv1/test/test_applicationtemplate_jit.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_applicationtemplate_logo.py b/jcapiv1/test/test_applicationtemplate_logo.py new file mode 100644 index 0000000..b3fb2ba --- /dev/null +++ b/jcapiv1/test/test_applicationtemplate_logo.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.applicationtemplate_logo import ApplicationtemplateLogo # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestApplicationtemplateLogo(unittest.TestCase): + """ApplicationtemplateLogo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApplicationtemplateLogo(self): + """Test ApplicationtemplateLogo""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.applicationtemplate_logo.ApplicationtemplateLogo() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_applicationtemplate_oidc.py b/jcapiv1/test/test_applicationtemplate_oidc.py new file mode 100644 index 0000000..c3b391a --- /dev/null +++ b/jcapiv1/test/test_applicationtemplate_oidc.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.applicationtemplate_oidc import ApplicationtemplateOidc # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestApplicationtemplateOidc(unittest.TestCase): + """ApplicationtemplateOidc unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApplicationtemplateOidc(self): + """Test ApplicationtemplateOidc""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.applicationtemplate_oidc.ApplicationtemplateOidc() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_applicationtemplate_provision.py b/jcapiv1/test/test_applicationtemplate_provision.py new file mode 100644 index 0000000..8f69893 --- /dev/null +++ b/jcapiv1/test/test_applicationtemplate_provision.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.applicationtemplate_provision import ApplicationtemplateProvision # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestApplicationtemplateProvision(unittest.TestCase): + """ApplicationtemplateProvision unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApplicationtemplateProvision(self): + """Test ApplicationtemplateProvision""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.applicationtemplate_provision.ApplicationtemplateProvision() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_applicationtemplateslist.py b/jcapiv1/test/test_applicationtemplateslist.py index bc17838..572550e 100644 --- a/jcapiv1/test/test_applicationtemplateslist.py +++ b/jcapiv1/test/test_applicationtemplateslist.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_body.py b/jcapiv1/test/test_body.py deleted file mode 100644 index 03d25c5..0000000 --- a/jcapiv1/test/test_body.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv1 -from jcapiv1.models.body import Body # noqa: E501 -from jcapiv1.rest import ApiException - - -class TestBody(unittest.TestCase): - """Body unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBody(self): - """Test Body""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv1.models.body.Body() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv1/test/test_body1.py b/jcapiv1/test/test_body1.py deleted file mode 100644 index f2ac1e7..0000000 --- a/jcapiv1/test/test_body1.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv1 -from jcapiv1.models.body1 import Body1 # noqa: E501 -from jcapiv1.rest import ApiException - - -class TestBody1(unittest.TestCase): - """Body1 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBody1(self): - """Test Body1""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv1.models.body1.Body1() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv1/test/test_command.py b/jcapiv1/test/test_command.py index ea3ada6..fd297cc 100644 --- a/jcapiv1/test/test_command.py +++ b/jcapiv1/test/test_command.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_command_results_api.py b/jcapiv1/test/test_command_results_api.py index 8f34042..2935e27 100644 --- a/jcapiv1/test/test_command_results_api.py +++ b/jcapiv1/test/test_command_results_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestCommandResultsApi(unittest.TestCase): """CommandResultsApi unit test stubs""" def setUp(self): - self.api = jcapiv1.api.command_results_api.CommandResultsApi() # noqa: E501 + self.api = CommandResultsApi() # noqa: E501 def tearDown(self): pass diff --git a/jcapiv1/test/test_command_triggers_api.py b/jcapiv1/test/test_command_triggers_api.py index c15c80a..9faccd8 100644 --- a/jcapiv1/test/test_command_triggers_api.py +++ b/jcapiv1/test/test_command_triggers_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestCommandTriggersApi(unittest.TestCase): """CommandTriggersApi unit test stubs""" def setUp(self): - self.api = jcapiv1.api.command_triggers_api.CommandTriggersApi() # noqa: E501 + self.api = CommandTriggersApi() # noqa: E501 def tearDown(self): pass diff --git a/jcapiv1/test/test_commandfilereturn.py b/jcapiv1/test/test_commandfilereturn.py index d5d3514..e5ade93 100644 --- a/jcapiv1/test/test_commandfilereturn.py +++ b/jcapiv1/test/test_commandfilereturn.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_commandfilereturn_results.py b/jcapiv1/test/test_commandfilereturn_results.py index 3d1062c..2b680c5 100644 --- a/jcapiv1/test/test_commandfilereturn_results.py +++ b/jcapiv1/test/test_commandfilereturn_results.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_commandresult.py b/jcapiv1/test/test_commandresult.py index 0c0d8a1..81946a9 100644 --- a/jcapiv1/test/test_commandresult.py +++ b/jcapiv1/test/test_commandresult.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_commandresult_response.py b/jcapiv1/test/test_commandresult_response.py index 0c226b1..1acfb9e 100644 --- a/jcapiv1/test/test_commandresult_response.py +++ b/jcapiv1/test/test_commandresult_response.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_commandresult_response_data.py b/jcapiv1/test/test_commandresult_response_data.py index 84efd11..62926c2 100644 --- a/jcapiv1/test/test_commandresult_response_data.py +++ b/jcapiv1/test/test_commandresult_response_data.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_commandresultslist.py b/jcapiv1/test/test_commandresultslist.py index 04f5ccc..2dbd695 100644 --- a/jcapiv1/test/test_commandresultslist.py +++ b/jcapiv1/test/test_commandresultslist.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_commandresultslist_results.py b/jcapiv1/test/test_commandresultslist_results.py new file mode 100644 index 0000000..bea5d53 --- /dev/null +++ b/jcapiv1/test/test_commandresultslist_results.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.commandresultslist_results import CommandresultslistResults # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestCommandresultslistResults(unittest.TestCase): + """CommandresultslistResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCommandresultslistResults(self): + """Test CommandresultslistResults""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.commandresultslist_results.CommandresultslistResults() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_commands_api.py b/jcapiv1/test/test_commands_api.py index 706c93d..2678d6c 100644 --- a/jcapiv1/test/test_commands_api.py +++ b/jcapiv1/test/test_commands_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestCommandsApi(unittest.TestCase): """CommandsApi unit test stubs""" def setUp(self): - self.api = jcapiv1.api.commands_api.CommandsApi() # noqa: E501 + self.api = CommandsApi() # noqa: E501 def tearDown(self): pass @@ -50,6 +49,13 @@ def test_commands_get(self): """ pass + def test_commands_get_results(self): + """Test case for commands_get_results + + Get results for a specific command # noqa: E501 + """ + pass + def test_commands_list(self): """Test case for commands_list diff --git a/jcapiv1/test/test_commandslist.py b/jcapiv1/test/test_commandslist.py index e7a2ba9..70f4f26 100644 --- a/jcapiv1/test/test_commandslist.py +++ b/jcapiv1/test/test_commandslist.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_commandslist_results.py b/jcapiv1/test/test_commandslist_results.py index bd8ca02..0920ec8 100644 --- a/jcapiv1/test/test_commandslist_results.py +++ b/jcapiv1/test/test_commandslist_results.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_error.py b/jcapiv1/test/test_error.py new file mode 100644 index 0000000..32931bf --- /dev/null +++ b/jcapiv1/test/test_error.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.error import Error # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testError(self): + """Test Error""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.error.Error() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_error_details.py b/jcapiv1/test/test_error_details.py new file mode 100644 index 0000000..eacb5e3 --- /dev/null +++ b/jcapiv1/test/test_error_details.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.error_details import ErrorDetails # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestErrorDetails(unittest.TestCase): + """ErrorDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testErrorDetails(self): + """Test ErrorDetails""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.error_details.ErrorDetails() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_errorresponse.py b/jcapiv1/test/test_errorresponse.py deleted file mode 100644 index b3c3911..0000000 --- a/jcapiv1/test/test_errorresponse.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv1 -from jcapiv1.models.errorresponse import Errorresponse # noqa: E501 -from jcapiv1.rest import ApiException - - -class TestErrorresponse(unittest.TestCase): - """Errorresponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testErrorresponse(self): - """Test Errorresponse""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv1.models.errorresponse.Errorresponse() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv1/test/test_fde.py b/jcapiv1/test/test_fde.py index 380ef77..68a85b2 100644 --- a/jcapiv1/test/test_fde.py +++ b/jcapiv1/test/test_fde.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_id_resetmfa_body.py b/jcapiv1/test/test_id_resetmfa_body.py new file mode 100644 index 0000000..c7df4ab --- /dev/null +++ b/jcapiv1/test/test_id_resetmfa_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.id_resetmfa_body import IdResetmfaBody # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestIdResetmfaBody(unittest.TestCase): + """IdResetmfaBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testIdResetmfaBody(self): + """Test IdResetmfaBody""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.id_resetmfa_body.IdResetmfaBody() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_managed_service_provider_api.py b/jcapiv1/test/test_managed_service_provider_api.py new file mode 100644 index 0000000..8303bc6 --- /dev/null +++ b/jcapiv1/test/test_managed_service_provider_api.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.api.managed_service_provider_api import ManagedServiceProviderApi # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestManagedServiceProviderApi(unittest.TestCase): + """ManagedServiceProviderApi unit test stubs""" + + def setUp(self): + self.api = ManagedServiceProviderApi() # noqa: E501 + + def tearDown(self): + pass + + def test_admin_totpreset_begin(self): + """Test case for admin_totpreset_begin + + Administrator TOTP Reset Initiation # noqa: E501 + """ + pass + + def test_organization_list(self): + """Test case for organization_list + + Get Organization Details # noqa: E501 + """ + pass + + def test_users_put(self): + """Test case for users_put + + Update a user # noqa: E501 + """ + pass + + def test_users_reactivate_get(self): + """Test case for users_reactivate_get + + Administrator Password Reset Initiation # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_mfa.py b/jcapiv1/test/test_mfa.py index 3c47109..869f13c 100644 --- a/jcapiv1/test/test_mfa.py +++ b/jcapiv1/test/test_mfa.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_mfa_enrollment.py b/jcapiv1/test/test_mfa_enrollment.py new file mode 100644 index 0000000..cf292fd --- /dev/null +++ b/jcapiv1/test/test_mfa_enrollment.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.mfa_enrollment import MfaEnrollment # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestMfaEnrollment(unittest.TestCase): + """MfaEnrollment unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMfaEnrollment(self): + """Test MfaEnrollment""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.mfa_enrollment.MfaEnrollment() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_mfa_enrollment_status.py b/jcapiv1/test/test_mfa_enrollment_status.py new file mode 100644 index 0000000..77e8c06 --- /dev/null +++ b/jcapiv1/test/test_mfa_enrollment_status.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.mfa_enrollment_status import MfaEnrollmentStatus # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestMfaEnrollmentStatus(unittest.TestCase): + """MfaEnrollmentStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMfaEnrollmentStatus(self): + """Test MfaEnrollmentStatus""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.mfa_enrollment_status.MfaEnrollmentStatus() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organization.py b/jcapiv1/test/test_organization.py new file mode 100644 index 0000000..e0f067f --- /dev/null +++ b/jcapiv1/test/test_organization.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organization import Organization # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganization(unittest.TestCase): + """Organization unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganization(self): + """Test Organization""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organization.Organization() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationentitlement.py b/jcapiv1/test/test_organizationentitlement.py new file mode 100644 index 0000000..aaf6d32 --- /dev/null +++ b/jcapiv1/test/test_organizationentitlement.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationentitlement import Organizationentitlement # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationentitlement(unittest.TestCase): + """Organizationentitlement unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationentitlement(self): + """Test Organizationentitlement""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationentitlement.Organizationentitlement() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationentitlement_entitlement_products.py b/jcapiv1/test/test_organizationentitlement_entitlement_products.py new file mode 100644 index 0000000..6411cf2 --- /dev/null +++ b/jcapiv1/test/test_organizationentitlement_entitlement_products.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationentitlement_entitlement_products import OrganizationentitlementEntitlementProducts # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationentitlementEntitlementProducts(unittest.TestCase): + """OrganizationentitlementEntitlementProducts unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationentitlementEntitlementProducts(self): + """Test OrganizationentitlementEntitlementProducts""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationentitlement_entitlement_products.OrganizationentitlementEntitlementProducts() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizations_api.py b/jcapiv1/test/test_organizations_api.py index ba8872d..e83e3f8 100644 --- a/jcapiv1/test/test_organizations_api.py +++ b/jcapiv1/test/test_organizations_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestOrganizationsApi(unittest.TestCase): """OrganizationsApi unit test stubs""" def setUp(self): - self.api = jcapiv1.api.organizations_api.OrganizationsApi() # noqa: E501 + self.api = OrganizationsApi() # noqa: E501 def tearDown(self): pass @@ -36,6 +35,20 @@ def test_organization_list(self): """ pass + def test_organization_put(self): + """Test case for organization_put + + Update an Organization # noqa: E501 + """ + pass + + def test_organizations_get(self): + """Test case for organizations_get + + Get an Organization # noqa: E501 + """ + pass + if __name__ == '__main__': unittest.main() diff --git a/jcapiv1/test/test_organizations_id_body.py b/jcapiv1/test/test_organizations_id_body.py new file mode 100644 index 0000000..fe1cdf5 --- /dev/null +++ b/jcapiv1/test/test_organizations_id_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizations_id_body import OrganizationsIdBody # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsIdBody(unittest.TestCase): + """OrganizationsIdBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsIdBody(self): + """Test OrganizationsIdBody""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizations_id_body.OrganizationsIdBody() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationsettings.py b/jcapiv1/test/test_organizationsettings.py new file mode 100644 index 0000000..269e5e9 --- /dev/null +++ b/jcapiv1/test/test_organizationsettings.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationsettings import Organizationsettings # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsettings(unittest.TestCase): + """Organizationsettings unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsettings(self): + """Test Organizationsettings""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationsettings.Organizationsettings() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationsettings_display_preferences.py b/jcapiv1/test/test_organizationsettings_display_preferences.py new file mode 100644 index 0000000..42ef114 --- /dev/null +++ b/jcapiv1/test/test_organizationsettings_display_preferences.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationsettings_display_preferences import OrganizationsettingsDisplayPreferences # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsettingsDisplayPreferences(unittest.TestCase): + """OrganizationsettingsDisplayPreferences unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsettingsDisplayPreferences(self): + """Test OrganizationsettingsDisplayPreferences""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationsettings_display_preferences.OrganizationsettingsDisplayPreferences() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationsettings_display_preferences_org_insights.py b/jcapiv1/test/test_organizationsettings_display_preferences_org_insights.py new file mode 100644 index 0000000..d408246 --- /dev/null +++ b/jcapiv1/test/test_organizationsettings_display_preferences_org_insights.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationsettings_display_preferences_org_insights import OrganizationsettingsDisplayPreferencesOrgInsights # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsettingsDisplayPreferencesOrgInsights(unittest.TestCase): + """OrganizationsettingsDisplayPreferencesOrgInsights unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsettingsDisplayPreferencesOrgInsights(self): + """Test OrganizationsettingsDisplayPreferencesOrgInsights""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationsettings_display_preferences_org_insights.OrganizationsettingsDisplayPreferencesOrgInsights() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationsettings_display_preferences_org_insights_applications_usage.py b/jcapiv1/test/test_organizationsettings_display_preferences_org_insights_applications_usage.py new file mode 100644 index 0000000..95afc86 --- /dev/null +++ b/jcapiv1/test/test_organizationsettings_display_preferences_org_insights_applications_usage.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationsettings_display_preferences_org_insights_applications_usage import OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage(unittest.TestCase): + """OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage(self): + """Test OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationsettings_display_preferences_org_insights_applications_usage.OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationsettings_display_preferences_org_insights_console_stats.py b/jcapiv1/test/test_organizationsettings_display_preferences_org_insights_console_stats.py new file mode 100644 index 0000000..eb32a56 --- /dev/null +++ b/jcapiv1/test/test_organizationsettings_display_preferences_org_insights_console_stats.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationsettings_display_preferences_org_insights_console_stats import OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats(unittest.TestCase): + """OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats(self): + """Test OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationsettings_display_preferences_org_insights_console_stats.OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationsettings_display_preferences_org_insights_device_notifications.py b/jcapiv1/test/test_organizationsettings_display_preferences_org_insights_device_notifications.py new file mode 100644 index 0000000..1c60281 --- /dev/null +++ b/jcapiv1/test/test_organizationsettings_display_preferences_org_insights_device_notifications.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationsettings_display_preferences_org_insights_device_notifications import OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications(unittest.TestCase): + """OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications(self): + """Test OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationsettings_display_preferences_org_insights_device_notifications.OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationsettings_display_preferences_org_insights_user_notifications.py b/jcapiv1/test/test_organizationsettings_display_preferences_org_insights_user_notifications.py new file mode 100644 index 0000000..5b7f8a2 --- /dev/null +++ b/jcapiv1/test/test_organizationsettings_display_preferences_org_insights_user_notifications.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationsettings_display_preferences_org_insights_user_notifications import OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications(unittest.TestCase): + """OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications(self): + """Test OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationsettings_display_preferences_org_insights_user_notifications.OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationsettings_features.py b/jcapiv1/test/test_organizationsettings_features.py new file mode 100644 index 0000000..c0dc85a --- /dev/null +++ b/jcapiv1/test/test_organizationsettings_features.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationsettings_features import OrganizationsettingsFeatures # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsettingsFeatures(unittest.TestCase): + """OrganizationsettingsFeatures unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsettingsFeatures(self): + """Test OrganizationsettingsFeatures""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationsettings_features.OrganizationsettingsFeatures() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationsettings_features_directory_insights.py b/jcapiv1/test/test_organizationsettings_features_directory_insights.py new file mode 100644 index 0000000..73f38c6 --- /dev/null +++ b/jcapiv1/test/test_organizationsettings_features_directory_insights.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationsettings_features_directory_insights import OrganizationsettingsFeaturesDirectoryInsights # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsettingsFeaturesDirectoryInsights(unittest.TestCase): + """OrganizationsettingsFeaturesDirectoryInsights unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsettingsFeaturesDirectoryInsights(self): + """Test OrganizationsettingsFeaturesDirectoryInsights""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationsettings_features_directory_insights.OrganizationsettingsFeaturesDirectoryInsights() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationsettings_features_directory_insights_premium.py b/jcapiv1/test/test_organizationsettings_features_directory_insights_premium.py new file mode 100644 index 0000000..c90ca54 --- /dev/null +++ b/jcapiv1/test/test_organizationsettings_features_directory_insights_premium.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationsettings_features_directory_insights_premium import OrganizationsettingsFeaturesDirectoryInsightsPremium # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsettingsFeaturesDirectoryInsightsPremium(unittest.TestCase): + """OrganizationsettingsFeaturesDirectoryInsightsPremium unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsettingsFeaturesDirectoryInsightsPremium(self): + """Test OrganizationsettingsFeaturesDirectoryInsightsPremium""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationsettings_features_directory_insights_premium.OrganizationsettingsFeaturesDirectoryInsightsPremium() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationsettings_features_system_insights.py b/jcapiv1/test/test_organizationsettings_features_system_insights.py new file mode 100644 index 0000000..78b9b9d --- /dev/null +++ b/jcapiv1/test/test_organizationsettings_features_system_insights.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationsettings_features_system_insights import OrganizationsettingsFeaturesSystemInsights # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsettingsFeaturesSystemInsights(unittest.TestCase): + """OrganizationsettingsFeaturesSystemInsights unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsettingsFeaturesSystemInsights(self): + """Test OrganizationsettingsFeaturesSystemInsights""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationsettings_features_system_insights.OrganizationsettingsFeaturesSystemInsights() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationsettings_new_system_user_state_defaults.py b/jcapiv1/test/test_organizationsettings_new_system_user_state_defaults.py new file mode 100644 index 0000000..322d1fe --- /dev/null +++ b/jcapiv1/test/test_organizationsettings_new_system_user_state_defaults.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationsettings_new_system_user_state_defaults import OrganizationsettingsNewSystemUserStateDefaults # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsettingsNewSystemUserStateDefaults(unittest.TestCase): + """OrganizationsettingsNewSystemUserStateDefaults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsettingsNewSystemUserStateDefaults(self): + """Test OrganizationsettingsNewSystemUserStateDefaults""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationsettings_new_system_user_state_defaults.OrganizationsettingsNewSystemUserStateDefaults() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationsettings_password_policy.py b/jcapiv1/test/test_organizationsettings_password_policy.py new file mode 100644 index 0000000..70f2846 --- /dev/null +++ b/jcapiv1/test/test_organizationsettings_password_policy.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationsettings_password_policy import OrganizationsettingsPasswordPolicy # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsettingsPasswordPolicy(unittest.TestCase): + """OrganizationsettingsPasswordPolicy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsettingsPasswordPolicy(self): + """Test OrganizationsettingsPasswordPolicy""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationsettings_password_policy.OrganizationsettingsPasswordPolicy() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationsettings_user_portal.py b/jcapiv1/test/test_organizationsettings_user_portal.py new file mode 100644 index 0000000..d0a8b89 --- /dev/null +++ b/jcapiv1/test/test_organizationsettings_user_portal.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationsettings_user_portal import OrganizationsettingsUserPortal # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsettingsUserPortal(unittest.TestCase): + """OrganizationsettingsUserPortal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsettingsUserPortal(self): + """Test OrganizationsettingsUserPortal""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationsettings_user_portal.OrganizationsettingsUserPortal() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationsettingsput.py b/jcapiv1/test/test_organizationsettingsput.py new file mode 100644 index 0000000..cdb6123 --- /dev/null +++ b/jcapiv1/test/test_organizationsettingsput.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationsettingsput import Organizationsettingsput # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsettingsput(unittest.TestCase): + """Organizationsettingsput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsettingsput(self): + """Test Organizationsettingsput""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationsettingsput.Organizationsettingsput() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationsettingsput_new_system_user_state_defaults.py b/jcapiv1/test/test_organizationsettingsput_new_system_user_state_defaults.py new file mode 100644 index 0000000..5803d8a --- /dev/null +++ b/jcapiv1/test/test_organizationsettingsput_new_system_user_state_defaults.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationsettingsput_new_system_user_state_defaults import OrganizationsettingsputNewSystemUserStateDefaults # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsettingsputNewSystemUserStateDefaults(unittest.TestCase): + """OrganizationsettingsputNewSystemUserStateDefaults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsettingsputNewSystemUserStateDefaults(self): + """Test OrganizationsettingsputNewSystemUserStateDefaults""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationsettingsput_new_system_user_state_defaults.OrganizationsettingsputNewSystemUserStateDefaults() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationsettingsput_password_policy.py b/jcapiv1/test/test_organizationsettingsput_password_policy.py new file mode 100644 index 0000000..f63dfbd --- /dev/null +++ b/jcapiv1/test/test_organizationsettingsput_password_policy.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.organizationsettingsput_password_policy import OrganizationsettingsputPasswordPolicy # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestOrganizationsettingsputPasswordPolicy(unittest.TestCase): + """OrganizationsettingsputPasswordPolicy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationsettingsputPasswordPolicy(self): + """Test OrganizationsettingsputPasswordPolicy""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.organizationsettingsput_password_policy.OrganizationsettingsputPasswordPolicy() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_organizationslist.py b/jcapiv1/test/test_organizationslist.py index e6b96ef..735ad45 100644 --- a/jcapiv1/test/test_organizationslist.py +++ b/jcapiv1/test/test_organizationslist.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_organizationslist_results.py b/jcapiv1/test/test_organizationslist_results.py index cd95dae..938f449 100644 --- a/jcapiv1/test/test_organizationslist_results.py +++ b/jcapiv1/test/test_organizationslist_results.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_radius_servers_api.py b/jcapiv1/test/test_radius_servers_api.py index 6ae769c..b9645ae 100644 --- a/jcapiv1/test/test_radius_servers_api.py +++ b/jcapiv1/test/test_radius_servers_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,11 +23,25 @@ class TestRadiusServersApi(unittest.TestCase): """RadiusServersApi unit test stubs""" def setUp(self): - self.api = jcapiv1.api.radius_servers_api.RadiusServersApi() # noqa: E501 + self.api = RadiusServersApi() # noqa: E501 def tearDown(self): pass + def test_radius_servers_delete(self): + """Test case for radius_servers_delete + + Delete Radius Server # noqa: E501 + """ + pass + + def test_radius_servers_get(self): + """Test case for radius_servers_get + + Get Radius Server # noqa: E501 + """ + pass + def test_radius_servers_list(self): """Test case for radius_servers_list diff --git a/jcapiv1/test/test_radiusserver.py b/jcapiv1/test/test_radiusserver.py index 1cc46ca..a89e305 100644 --- a/jcapiv1/test/test_radiusserver.py +++ b/jcapiv1/test/test_radiusserver.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_radiusserverpost.py b/jcapiv1/test/test_radiusserverpost.py index 32d03b9..ada42c5 100644 --- a/jcapiv1/test/test_radiusserverpost.py +++ b/jcapiv1/test/test_radiusserverpost.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_radiusserverput.py b/jcapiv1/test/test_radiusserverput.py index 8c7951f..9fa89e5 100644 --- a/jcapiv1/test/test_radiusserverput.py +++ b/jcapiv1/test/test_radiusserverput.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_radiusservers_id_body.py b/jcapiv1/test/test_radiusservers_id_body.py new file mode 100644 index 0000000..2068c86 --- /dev/null +++ b/jcapiv1/test/test_radiusservers_id_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.radiusservers_id_body import RadiusserversIdBody # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestRadiusserversIdBody(unittest.TestCase): + """RadiusserversIdBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testRadiusserversIdBody(self): + """Test RadiusserversIdBody""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.radiusservers_id_body.RadiusserversIdBody() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_radiusserverslist.py b/jcapiv1/test/test_radiusserverslist.py index 5345a7c..3d8687c 100644 --- a/jcapiv1/test/test_radiusserverslist.py +++ b/jcapiv1/test/test_radiusserverslist.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_search.py b/jcapiv1/test/test_search.py index f6f4e6e..dd0cf0b 100644 --- a/jcapiv1/test/test_search.py +++ b/jcapiv1/test/test_search.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_search_api.py b/jcapiv1/test/test_search_api.py index c2215a6..0303063 100644 --- a/jcapiv1/test/test_search_api.py +++ b/jcapiv1/test/test_search_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,11 +23,25 @@ class TestSearchApi(unittest.TestCase): """SearchApi unit test stubs""" def setUp(self): - self.api = jcapiv1.api.search_api.SearchApi() # noqa: E501 + self.api = SearchApi() # noqa: E501 def tearDown(self): pass + def test_search_commandresults_post(self): + """Test case for search_commandresults_post + + Search Commands Results # noqa: E501 + """ + pass + + def test_search_commands_post(self): + """Test case for search_commands_post + + Search Commands # noqa: E501 + """ + pass + def test_search_organizations_post(self): """Test case for search_organizations_post diff --git a/jcapiv1/test/test_sshkeylist.py b/jcapiv1/test/test_sshkeylist.py index 5cb506a..a4f9062 100644 --- a/jcapiv1/test/test_sshkeylist.py +++ b/jcapiv1/test/test_sshkeylist.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_sshkeypost.py b/jcapiv1/test/test_sshkeypost.py index d74f823..4f992d0 100644 --- a/jcapiv1/test/test_sshkeypost.py +++ b/jcapiv1/test/test_sshkeypost.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_sso.py b/jcapiv1/test/test_sso.py new file mode 100644 index 0000000..22b42a8 --- /dev/null +++ b/jcapiv1/test/test_sso.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.sso import Sso # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestSso(unittest.TestCase): + """Sso unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSso(self): + """Test Sso""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.sso.Sso() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_state_activate_body.py b/jcapiv1/test/test_state_activate_body.py new file mode 100644 index 0000000..e347412 --- /dev/null +++ b/jcapiv1/test/test_state_activate_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.state_activate_body import StateActivateBody # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestStateActivateBody(unittest.TestCase): + """StateActivateBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testStateActivateBody(self): + """Test StateActivateBody""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.state_activate_body.StateActivateBody() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_system.py b/jcapiv1/test/test_system.py index f483233..862296f 100644 --- a/jcapiv1/test/test_system.py +++ b/jcapiv1/test/test_system.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_system_built_in_commands.py b/jcapiv1/test/test_system_built_in_commands.py new file mode 100644 index 0000000..0f30e8a --- /dev/null +++ b/jcapiv1/test/test_system_built_in_commands.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.system_built_in_commands import SystemBuiltInCommands # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestSystemBuiltInCommands(unittest.TestCase): + """SystemBuiltInCommands unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemBuiltInCommands(self): + """Test SystemBuiltInCommands""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.system_built_in_commands.SystemBuiltInCommands() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_system_domain_info.py b/jcapiv1/test/test_system_domain_info.py new file mode 100644 index 0000000..deada3c --- /dev/null +++ b/jcapiv1/test/test_system_domain_info.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.system_domain_info import SystemDomainInfo # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestSystemDomainInfo(unittest.TestCase): + """SystemDomainInfo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemDomainInfo(self): + """Test SystemDomainInfo""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.system_domain_info.SystemDomainInfo() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_system_mdm.py b/jcapiv1/test/test_system_mdm.py new file mode 100644 index 0000000..eeb6180 --- /dev/null +++ b/jcapiv1/test/test_system_mdm.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.system_mdm import SystemMdm # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestSystemMdm(unittest.TestCase): + """SystemMdm unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemMdm(self): + """Test SystemMdm""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.system_mdm.SystemMdm() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_system_mdm_internal.py b/jcapiv1/test/test_system_mdm_internal.py new file mode 100644 index 0000000..c32bb31 --- /dev/null +++ b/jcapiv1/test/test_system_mdm_internal.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.system_mdm_internal import SystemMdmInternal # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestSystemMdmInternal(unittest.TestCase): + """SystemMdmInternal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemMdmInternal(self): + """Test SystemMdmInternal""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.system_mdm_internal.SystemMdmInternal() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_system_network_interfaces.py b/jcapiv1/test/test_system_network_interfaces.py index 58a860f..6ac313a 100644 --- a/jcapiv1/test/test_system_network_interfaces.py +++ b/jcapiv1/test/test_system_network_interfaces.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_system_os_version_detail.py b/jcapiv1/test/test_system_os_version_detail.py new file mode 100644 index 0000000..0d1e88b --- /dev/null +++ b/jcapiv1/test/test_system_os_version_detail.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.system_os_version_detail import SystemOsVersionDetail # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestSystemOsVersionDetail(unittest.TestCase): + """SystemOsVersionDetail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemOsVersionDetail(self): + """Test SystemOsVersionDetail""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.system_os_version_detail.SystemOsVersionDetail() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_system_provision_metadata.py b/jcapiv1/test/test_system_provision_metadata.py new file mode 100644 index 0000000..522464a --- /dev/null +++ b/jcapiv1/test/test_system_provision_metadata.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.system_provision_metadata import SystemProvisionMetadata # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestSystemProvisionMetadata(unittest.TestCase): + """SystemProvisionMetadata unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemProvisionMetadata(self): + """Test SystemProvisionMetadata""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.system_provision_metadata.SystemProvisionMetadata() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_system_provision_metadata_provisioner.py b/jcapiv1/test/test_system_provision_metadata_provisioner.py new file mode 100644 index 0000000..a4d59fe --- /dev/null +++ b/jcapiv1/test/test_system_provision_metadata_provisioner.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.system_provision_metadata_provisioner import SystemProvisionMetadataProvisioner # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestSystemProvisionMetadataProvisioner(unittest.TestCase): + """SystemProvisionMetadataProvisioner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemProvisionMetadataProvisioner(self): + """Test SystemProvisionMetadataProvisioner""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.system_provision_metadata_provisioner.SystemProvisionMetadataProvisioner() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_system_service_account_state.py b/jcapiv1/test/test_system_service_account_state.py new file mode 100644 index 0000000..0ea92be --- /dev/null +++ b/jcapiv1/test/test_system_service_account_state.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.system_service_account_state import SystemServiceAccountState # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestSystemServiceAccountState(unittest.TestCase): + """SystemServiceAccountState unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemServiceAccountState(self): + """Test SystemServiceAccountState""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.system_service_account_state.SystemServiceAccountState() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_system_sshd_params.py b/jcapiv1/test/test_system_sshd_params.py index 21de188..b07b3ab 100644 --- a/jcapiv1/test/test_system_sshd_params.py +++ b/jcapiv1/test/test_system_sshd_params.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_system_system_insights.py b/jcapiv1/test/test_system_system_insights.py index 0ede023..e8cd49a 100644 --- a/jcapiv1/test/test_system_system_insights.py +++ b/jcapiv1/test/test_system_system_insights.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_system_user_metrics.py b/jcapiv1/test/test_system_user_metrics.py new file mode 100644 index 0000000..3fbb919 --- /dev/null +++ b/jcapiv1/test/test_system_user_metrics.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.system_user_metrics import SystemUserMetrics # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestSystemUserMetrics(unittest.TestCase): + """SystemUserMetrics unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemUserMetrics(self): + """Test SystemUserMetrics""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.system_user_metrics.SystemUserMetrics() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_systemput.py b/jcapiv1/test/test_systemput.py index 4c9c1ce..6f5d730 100644 --- a/jcapiv1/test/test_systemput.py +++ b/jcapiv1/test/test_systemput.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_systemput_agent_bound_messages.py b/jcapiv1/test/test_systemput_agent_bound_messages.py index 10eae5b..1bc084f 100644 --- a/jcapiv1/test/test_systemput_agent_bound_messages.py +++ b/jcapiv1/test/test_systemput_agent_bound_messages.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_systems_api.py b/jcapiv1/test/test_systems_api.py index 4b48e01..7bb2e43 100644 --- a/jcapiv1/test/test_systems_api.py +++ b/jcapiv1/test/test_systems_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,11 +23,39 @@ class TestSystemsApi(unittest.TestCase): """SystemsApi unit test stubs""" def setUp(self): - self.api = jcapiv1.api.systems_api.SystemsApi() # noqa: E501 + self.api = SystemsApi() # noqa: E501 def tearDown(self): pass + def test_systems_command_builtin_erase(self): + """Test case for systems_command_builtin_erase + + Erase a System # noqa: E501 + """ + pass + + def test_systems_command_builtin_lock(self): + """Test case for systems_command_builtin_lock + + Lock a System # noqa: E501 + """ + pass + + def test_systems_command_builtin_restart(self): + """Test case for systems_command_builtin_restart + + Restart a System # noqa: E501 + """ + pass + + def test_systems_command_builtin_shutdown(self): + """Test case for systems_command_builtin_shutdown + + Shutdown a System # noqa: E501 + """ + pass + def test_systems_delete(self): """Test case for systems_delete @@ -57,20 +84,6 @@ def test_systems_put(self): """ pass - def test_systems_systemusers_binding_list(self): - """Test case for systems_systemusers_binding_list - - List system user bindings # noqa: E501 - """ - pass - - def test_systems_systemusers_binding_put(self): - """Test case for systems_systemusers_binding_put - - Update a system's or user's binding # noqa: E501 - """ - pass - if __name__ == '__main__': unittest.main() diff --git a/jcapiv1/test/test_systemslist.py b/jcapiv1/test/test_systemslist.py index 05d17a3..b703132 100644 --- a/jcapiv1/test/test_systemslist.py +++ b/jcapiv1/test/test_systemslist.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_systemuser.py b/jcapiv1/test/test_systemuser.py deleted file mode 100644 index 5d4424e..0000000 --- a/jcapiv1/test/test_systemuser.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv1 -from jcapiv1.models.systemuser import Systemuser # noqa: E501 -from jcapiv1.rest import ApiException - - -class TestSystemuser(unittest.TestCase): - """Systemuser unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSystemuser(self): - """Test Systemuser""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv1.models.systemuser.Systemuser() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv1/test/test_systemuserbinding.py b/jcapiv1/test/test_systemuserbinding.py deleted file mode 100644 index fc60ff6..0000000 --- a/jcapiv1/test/test_systemuserbinding.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv1 -from jcapiv1.models.systemuserbinding import Systemuserbinding # noqa: E501 -from jcapiv1.rest import ApiException - - -class TestSystemuserbinding(unittest.TestCase): - """Systemuserbinding unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSystemuserbinding(self): - """Test Systemuserbinding""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv1.models.systemuserbinding.Systemuserbinding() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv1/test/test_systemuserbindingsput.py b/jcapiv1/test/test_systemuserbindingsput.py deleted file mode 100644 index 1d959b3..0000000 --- a/jcapiv1/test/test_systemuserbindingsput.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv1 -from jcapiv1.models.systemuserbindingsput import Systemuserbindingsput # noqa: E501 -from jcapiv1.rest import ApiException - - -class TestSystemuserbindingsput(unittest.TestCase): - """Systemuserbindingsput unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSystemuserbindingsput(self): - """Test Systemuserbindingsput""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv1.models.systemuserbindingsput.Systemuserbindingsput() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv1/test/test_systemuserput.py b/jcapiv1/test/test_systemuserput.py index ecb86bb..67d3ea4 100644 --- a/jcapiv1/test/test_systemuserput.py +++ b/jcapiv1/test/test_systemuserput.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_systemuserput_addresses.py b/jcapiv1/test/test_systemuserput_addresses.py index e9d66e0..1e33c42 100644 --- a/jcapiv1/test/test_systemuserput_addresses.py +++ b/jcapiv1/test/test_systemuserput_addresses.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_systemuserput_attributes.py b/jcapiv1/test/test_systemuserput_attributes.py new file mode 100644 index 0000000..411668a --- /dev/null +++ b/jcapiv1/test/test_systemuserput_attributes.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.systemuserput_attributes import SystemuserputAttributes # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestSystemuserputAttributes(unittest.TestCase): + """SystemuserputAttributes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemuserputAttributes(self): + """Test SystemuserputAttributes""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.systemuserput_attributes.SystemuserputAttributes() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_systemuserput_phone_numbers.py b/jcapiv1/test/test_systemuserput_phone_numbers.py index f99f823..d05687c 100644 --- a/jcapiv1/test/test_systemuserput_phone_numbers.py +++ b/jcapiv1/test/test_systemuserput_phone_numbers.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_systemuserput_relationships.py b/jcapiv1/test/test_systemuserput_relationships.py new file mode 100644 index 0000000..724a5c4 --- /dev/null +++ b/jcapiv1/test/test_systemuserput_relationships.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.systemuserput_relationships import SystemuserputRelationships # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestSystemuserputRelationships(unittest.TestCase): + """SystemuserputRelationships unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemuserputRelationships(self): + """Test SystemuserputRelationships""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.systemuserput_relationships.SystemuserputRelationships() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_systemuserputpost.py b/jcapiv1/test/test_systemuserputpost.py index 0373b73..cd6a6ab 100644 --- a/jcapiv1/test/test_systemuserputpost.py +++ b/jcapiv1/test/test_systemuserputpost.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_systemuserputpost_addresses.py b/jcapiv1/test/test_systemuserputpost_addresses.py index 7f4abbc..ee6b7f6 100644 --- a/jcapiv1/test/test_systemuserputpost_addresses.py +++ b/jcapiv1/test/test_systemuserputpost_addresses.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_systemuserputpost_phone_numbers.py b/jcapiv1/test/test_systemuserputpost_phone_numbers.py index 71f2924..860ee05 100644 --- a/jcapiv1/test/test_systemuserputpost_phone_numbers.py +++ b/jcapiv1/test/test_systemuserputpost_phone_numbers.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_systemuserputpost_recovery_email.py b/jcapiv1/test/test_systemuserputpost_recovery_email.py new file mode 100644 index 0000000..792772a --- /dev/null +++ b/jcapiv1/test/test_systemuserputpost_recovery_email.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.systemuserputpost_recovery_email import SystemuserputpostRecoveryEmail # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestSystemuserputpostRecoveryEmail(unittest.TestCase): + """SystemuserputpostRecoveryEmail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemuserputpostRecoveryEmail(self): + """Test SystemuserputpostRecoveryEmail""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.systemuserputpost_recovery_email.SystemuserputpostRecoveryEmail() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_systemuserreturn.py b/jcapiv1/test/test_systemuserreturn.py index 10ae8f7..e4ec4b3 100644 --- a/jcapiv1/test/test_systemuserreturn.py +++ b/jcapiv1/test/test_systemuserreturn.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_systemuserreturn_addresses.py b/jcapiv1/test/test_systemuserreturn_addresses.py index a8bcc0b..e3761f2 100644 --- a/jcapiv1/test/test_systemuserreturn_addresses.py +++ b/jcapiv1/test/test_systemuserreturn_addresses.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_systemuserreturn_phone_numbers.py b/jcapiv1/test/test_systemuserreturn_phone_numbers.py index 1d1948b..837d1e5 100644 --- a/jcapiv1/test/test_systemuserreturn_phone_numbers.py +++ b/jcapiv1/test/test_systemuserreturn_phone_numbers.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_systemuserreturn_recovery_email.py b/jcapiv1/test/test_systemuserreturn_recovery_email.py new file mode 100644 index 0000000..1718ddf --- /dev/null +++ b/jcapiv1/test/test_systemuserreturn_recovery_email.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.systemuserreturn_recovery_email import SystemuserreturnRecoveryEmail # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestSystemuserreturnRecoveryEmail(unittest.TestCase): + """SystemuserreturnRecoveryEmail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemuserreturnRecoveryEmail(self): + """Test SystemuserreturnRecoveryEmail""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.systemuserreturn_recovery_email.SystemuserreturnRecoveryEmail() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_systemusers_api.py b/jcapiv1/test/test_systemusers_api.py index adcb245..23fe0da 100644 --- a/jcapiv1/test/test_systemusers_api.py +++ b/jcapiv1/test/test_systemusers_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestSystemusersApi(unittest.TestCase): """SystemusersApi unit test stubs""" def setUp(self): - self.api = jcapiv1.api.systemusers_api.SystemusersApi() # noqa: E501 + self.api = SystemusersApi() # noqa: E501 def tearDown(self): pass @@ -57,6 +56,13 @@ def test_systemusers_delete(self): """ pass + def test_systemusers_expire(self): + """Test case for systemusers_expire + + Expire a system user's password # noqa: E501 + """ + pass + def test_systemusers_get(self): """Test case for systemusers_get @@ -71,6 +77,13 @@ def test_systemusers_list(self): """ pass + def test_systemusers_mfasync(self): + """Test case for systemusers_mfasync + + Sync a systemuser's mfa enrollment status # noqa: E501 + """ + pass + def test_systemusers_post(self): """Test case for systemusers_post @@ -92,17 +105,10 @@ def test_systemusers_resetmfa(self): """ pass - def test_systemusers_systems_binding_list(self): - """Test case for systemusers_systems_binding_list - - List system user binding # noqa: E501 - """ - pass - - def test_systemusers_systems_binding_put(self): - """Test case for systemusers_systems_binding_put + def test_systemusers_state_activate(self): + """Test case for systemusers_state_activate - Update a system user binding # noqa: E501 + Activate System User # noqa: E501 """ pass diff --git a/jcapiv1/test/test_systemuserslist.py b/jcapiv1/test/test_systemuserslist.py index 98d6e7b..c78a51f 100644 --- a/jcapiv1/test/test_systemuserslist.py +++ b/jcapiv1/test/test_systemuserslist.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 1.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv1/test/test_tag.py b/jcapiv1/test/test_tag.py deleted file mode 100644 index d3953ae..0000000 --- a/jcapiv1/test/test_tag.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv1 -from jcapiv1.models.tag import Tag # noqa: E501 -from jcapiv1.rest import ApiException - - -class TestTag(unittest.TestCase): - """Tag unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTag(self): - """Test Tag""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv1.models.tag.Tag() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv1/test/test_tagpost.py b/jcapiv1/test/test_tagpost.py deleted file mode 100644 index ec45fd8..0000000 --- a/jcapiv1/test/test_tagpost.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv1 -from jcapiv1.models.tagpost import Tagpost # noqa: E501 -from jcapiv1.rest import ApiException - - -class TestTagpost(unittest.TestCase): - """Tagpost unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTagpost(self): - """Test Tagpost""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv1.models.tagpost.Tagpost() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv1/test/test_tagput.py b/jcapiv1/test/test_tagput.py deleted file mode 100644 index 0ddb751..0000000 --- a/jcapiv1/test/test_tagput.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv1 -from jcapiv1.models.tagput import Tagput # noqa: E501 -from jcapiv1.rest import ApiException - - -class TestTagput(unittest.TestCase): - """Tagput unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTagput(self): - """Test Tagput""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv1.models.tagput.Tagput() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv1/test/test_tags_api.py b/jcapiv1/test/test_tags_api.py deleted file mode 100644 index f423cf0..0000000 --- a/jcapiv1/test/test_tags_api.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv1 -from jcapiv1.api.tags_api import TagsApi # noqa: E501 -from jcapiv1.rest import ApiException - - -class TestTagsApi(unittest.TestCase): - """TagsApi unit test stubs""" - - def setUp(self): - self.api = jcapiv1.api.tags_api.TagsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_tags_delete(self): - """Test case for tags_delete - - Delete a Tag # noqa: E501 - """ - pass - - def test_tags_get(self): - """Test case for tags_get - - List a Tag # noqa: E501 - """ - pass - - def test_tags_list(self): - """Test case for tags_list - - List All Tags # noqa: E501 - """ - pass - - def test_tags_post(self): - """Test case for tags_post - - Create a Tag # noqa: E501 - """ - pass - - def test_tags_put(self): - """Test case for tags_put - - Update a Tag # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv1/test/test_tagslist.py b/jcapiv1/test/test_tagslist.py deleted file mode 100644 index 60dc786..0000000 --- a/jcapiv1/test/test_tagslist.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv1 -from jcapiv1.models.tagslist import Tagslist # noqa: E501 -from jcapiv1.rest import ApiException - - -class TestTagslist(unittest.TestCase): - """Tagslist unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTagslist(self): - """Test Tagslist""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv1.models.tagslist.Tagslist() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv1/test/test_triggerreturn.py b/jcapiv1/test/test_triggerreturn.py new file mode 100644 index 0000000..4210429 --- /dev/null +++ b/jcapiv1/test/test_triggerreturn.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.triggerreturn import Triggerreturn # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestTriggerreturn(unittest.TestCase): + """Triggerreturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTriggerreturn(self): + """Test Triggerreturn""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.triggerreturn.Triggerreturn() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_trustedapp_config_get.py b/jcapiv1/test/test_trustedapp_config_get.py new file mode 100644 index 0000000..ab2ecf8 --- /dev/null +++ b/jcapiv1/test/test_trustedapp_config_get.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.trustedapp_config_get import TrustedappConfigGet # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestTrustedappConfigGet(unittest.TestCase): + """TrustedappConfigGet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTrustedappConfigGet(self): + """Test TrustedappConfigGet""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.trustedapp_config_get.TrustedappConfigGet() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_trustedapp_config_get_trusted_apps.py b/jcapiv1/test/test_trustedapp_config_get_trusted_apps.py new file mode 100644 index 0000000..cf59cb3 --- /dev/null +++ b/jcapiv1/test/test_trustedapp_config_get_trusted_apps.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.trustedapp_config_get_trusted_apps import TrustedappConfigGetTrustedApps # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestTrustedappConfigGetTrustedApps(unittest.TestCase): + """TrustedappConfigGetTrustedApps unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTrustedappConfigGetTrustedApps(self): + """Test TrustedappConfigGetTrustedApps""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.trustedapp_config_get_trusted_apps.TrustedappConfigGetTrustedApps() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_trustedapp_config_put.py b/jcapiv1/test/test_trustedapp_config_put.py new file mode 100644 index 0000000..6ed6394 --- /dev/null +++ b/jcapiv1/test/test_trustedapp_config_put.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.trustedapp_config_put import TrustedappConfigPut # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestTrustedappConfigPut(unittest.TestCase): + """TrustedappConfigPut unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTrustedappConfigPut(self): + """Test TrustedappConfigPut""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.trustedapp_config_put.TrustedappConfigPut() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_userput.py b/jcapiv1/test/test_userput.py new file mode 100644 index 0000000..d08aa6c --- /dev/null +++ b/jcapiv1/test/test_userput.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.userput import Userput # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestUserput(unittest.TestCase): + """Userput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUserput(self): + """Test Userput""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.userput.Userput() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_userreturn.py b/jcapiv1/test/test_userreturn.py new file mode 100644 index 0000000..d85bdbe --- /dev/null +++ b/jcapiv1/test/test_userreturn.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.userreturn import Userreturn # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestUserreturn(unittest.TestCase): + """Userreturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUserreturn(self): + """Test Userreturn""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.userreturn.Userreturn() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_userreturn_growth_data.py b/jcapiv1/test/test_userreturn_growth_data.py new file mode 100644 index 0000000..8747fac --- /dev/null +++ b/jcapiv1/test/test_userreturn_growth_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.models.userreturn_growth_data import UserreturnGrowthData # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestUserreturnGrowthData(unittest.TestCase): + """UserreturnGrowthData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUserreturnGrowthData(self): + """Test UserreturnGrowthData""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv1.models.userreturn_growth_data.UserreturnGrowthData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_users_api.py b/jcapiv1/test/test_users_api.py new file mode 100644 index 0000000..c6eafb5 --- /dev/null +++ b/jcapiv1/test/test_users_api.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 1.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv1 +from jcapiv1.api.users_api import UsersApi # noqa: E501 +from jcapiv1.rest import ApiException + + +class TestUsersApi(unittest.TestCase): + """UsersApi unit test stubs""" + + def setUp(self): + self.api = UsersApi() # noqa: E501 + + def tearDown(self): + pass + + def test_admin_totpreset_begin(self): + """Test case for admin_totpreset_begin + + Administrator TOTP Reset Initiation # noqa: E501 + """ + pass + + def test_users_put(self): + """Test case for users_put + + Update a user # noqa: E501 + """ + pass + + def test_users_reactivate_get(self): + """Test case for users_reactivate_get + + Administrator Password Reset Initiation # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv1/test/test_usersystembinding.py b/jcapiv1/test/test_usersystembinding.py deleted file mode 100644 index 275be9e..0000000 --- a/jcapiv1/test/test_usersystembinding.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv1 -from jcapiv1.models.usersystembinding import Usersystembinding # noqa: E501 -from jcapiv1.rest import ApiException - - -class TestUsersystembinding(unittest.TestCase): - """Usersystembinding unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUsersystembinding(self): - """Test Usersystembinding""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv1.models.usersystembinding.Usersystembinding() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv1/test/test_usersystembindingsput.py b/jcapiv1/test/test_usersystembindingsput.py deleted file mode 100644 index ba74bb8..0000000 --- a/jcapiv1/test/test_usersystembindingsput.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. # noqa: E501 - - OpenAPI spec version: 1.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv1 -from jcapiv1.models.usersystembindingsput import Usersystembindingsput # noqa: E501 -from jcapiv1.rest import ApiException - - -class TestUsersystembindingsput(unittest.TestCase): - """Usersystembindingsput unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUsersystembindingsput(self): - """Test Usersystembindingsput""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv1.models.usersystembindingsput.Usersystembindingsput() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv1/tox.ini b/jcapiv1/tox.ini index 3d0be61..a310bec 100644 --- a/jcapiv1/tox.ini +++ b/jcapiv1/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py3 +envlist = py3 [testenv] deps=-r{toxinidir}/requirements.txt diff --git a/jcapiv2/.swagger-codegen/VERSION b/jcapiv2/.swagger-codegen/VERSION index acdc3f1..8d87cde 100644 --- a/jcapiv2/.swagger-codegen/VERSION +++ b/jcapiv2/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.2 \ No newline at end of file +3.0.32 \ No newline at end of file diff --git a/jcapiv2/.travis.yml b/jcapiv2/.travis.yml index 86211e2..dd6c445 100644 --- a/jcapiv2/.travis.yml +++ b/jcapiv2/.travis.yml @@ -1,7 +1,6 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "2.7" - "3.2" - "3.3" - "3.4" diff --git a/jcapiv2/README.md b/jcapiv2/README.md index 23f106f..65ddaa1 100644 --- a/jcapiv2/README.md +++ b/jcapiv2/README.md @@ -1,11 +1,12 @@ # jcapiv2 - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. +# Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 2.0 -- Package version: 4.0.0 -- Build package: io.swagger.codegen.languages.PythonClientCodegen +- Package version: 5.0.0 +- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen +For more information, please visit [https://support.jumpcloud.com/support/s/](https://support.jumpcloud.com/support/s/) ## Requirements. @@ -51,20 +52,239 @@ import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + # create an instance of the API class api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) activedirectory_id = 'activedirectory_id_example' # str | agent_id = 'agent_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Delete Active Directory Agent - api_instance.activedirectories_agents_delete(activedirectory_id, agent_id, content_type, accept, x_org_id=x_org_id) + api_instance.activedirectories_agents_delete(activedirectory_id, agent_id, x_org_id=x_org_id) except ApiException as e: print("Exception when calling ActiveDirectoryApi->activedirectories_agents_delete: %s\n" % e) +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) +activedirectory_id = 'activedirectory_id_example' # str | +agent_id = 'agent_id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Get Active Directory Agent + api_response = api_instance.activedirectories_agents_get(activedirectory_id, agent_id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ActiveDirectoryApi->activedirectories_agents_get: %s\n" % e) + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) +activedirectory_id = 'activedirectory_id_example' # str | +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List Active Directory Agents + api_response = api_instance.activedirectories_agents_list(activedirectory_id, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ActiveDirectoryApi->activedirectories_agents_list: %s\n" % e) + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) +activedirectory_id = 'activedirectory_id_example' # str | +body = jcapiv2.ActiveDirectoryAgentInput() # ActiveDirectoryAgentInput | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Create a new Active Directory Agent + api_response = api_instance.activedirectories_agents_post(activedirectory_id, body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ActiveDirectoryApi->activedirectories_agents_post: %s\n" % e) + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | ObjectID of this Active Directory instance. +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Delete an Active Directory + api_response = api_instance.activedirectories_delete(id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ActiveDirectoryApi->activedirectories_delete: %s\n" % e) + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | ObjectID of this Active Directory instance. +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Get an Active Directory + api_response = api_instance.activedirectories_get(id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ActiveDirectoryApi->activedirectories_get: %s\n" % e) + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List Active Directories + api_response = api_instance.activedirectories_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ActiveDirectoryApi->activedirectories_list: %s\n" % e) + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) +body = jcapiv2.ActiveDirectoryInput() # ActiveDirectoryInput | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Create a new Active Directory + api_response = api_instance.activedirectories_post(body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ActiveDirectoryApi->activedirectories_post: %s\n" % e) + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) +activedirectory_id = 'activedirectory_id_example' # str | +targets = ['targets_example'] # list[str] | Targets which a \"active_directory\" can be associated to. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List the associations of an Active Directory instance + api_response = api_instance.graph_active_directory_associations_list(activedirectory_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ActiveDirectoryApi->graph_active_directory_associations_list: %s\n" % e) + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) +activedirectory_id = 'activedirectory_id_example' # str | +body = jcapiv2.GraphOperationActiveDirectory() # GraphOperationActiveDirectory | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Manage the associations of an Active Directory instance + api_instance.graph_active_directory_associations_post(activedirectory_id, body=body, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling ActiveDirectoryApi->graph_active_directory_associations_post: %s\n" % e) + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) +activedirectory_id = 'activedirectory_id_example' # str | ObjectID of the Active Directory instance. +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) + +try: + # List the Users bound to an Active Directory instance + api_response = api_instance.graph_active_directory_traverse_user(activedirectory_id, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip) + pprint(api_response) +except ApiException as e: + print("Exception when calling ActiveDirectoryApi->graph_active_directory_traverse_user: %s\n" % e) + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) +activedirectory_id = 'activedirectory_id_example' # str | ObjectID of the Active Directory instance. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) + +try: + # List the User Groups bound to an Active Directory instance + api_response = api_instance.graph_active_directory_traverse_user_group(activedirectory_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + pprint(api_response) +except ApiException as e: + print("Exception when calling ActiveDirectoryApi->graph_active_directory_traverse_user_group: %s\n" % e) ``` ## Documentation for API Endpoints @@ -83,30 +303,65 @@ Class | Method | HTTP request | Description *ActiveDirectoryApi* | [**activedirectories_post**](docs/ActiveDirectoryApi.md#activedirectories_post) | **POST** /activedirectories | Create a new Active Directory *ActiveDirectoryApi* | [**graph_active_directory_associations_list**](docs/ActiveDirectoryApi.md#graph_active_directory_associations_list) | **GET** /activedirectories/{activedirectory_id}/associations | List the associations of an Active Directory instance *ActiveDirectoryApi* | [**graph_active_directory_associations_post**](docs/ActiveDirectoryApi.md#graph_active_directory_associations_post) | **POST** /activedirectories/{activedirectory_id}/associations | Manage the associations of an Active Directory instance +*ActiveDirectoryApi* | [**graph_active_directory_traverse_user**](docs/ActiveDirectoryApi.md#graph_active_directory_traverse_user) | **GET** /activedirectories/{activedirectory_id}/users | List the Users bound to an Active Directory instance *ActiveDirectoryApi* | [**graph_active_directory_traverse_user_group**](docs/ActiveDirectoryApi.md#graph_active_directory_traverse_user_group) | **GET** /activedirectories/{activedirectory_id}/usergroups | List the User Groups bound to an Active Directory instance -*AppleMDMApi* | [**applemdms_delete**](docs/AppleMDMApi.md#applemdms_delete) | **DELETE** /applemdms/{apple_mdm_id} | Delete an Apple MDM +*AdministratorsApi* | [**administrator_organizations_create_by_administrator**](docs/AdministratorsApi.md#administrator_organizations_create_by_administrator) | **POST** /administrators/{id}/organizationlinks | Allow Adminstrator access to an Organization. +*AdministratorsApi* | [**administrator_organizations_list_by_administrator**](docs/AdministratorsApi.md#administrator_organizations_list_by_administrator) | **GET** /administrators/{id}/organizationlinks | List the association links between an Administrator and Organizations. +*AdministratorsApi* | [**administrator_organizations_list_by_organization**](docs/AdministratorsApi.md#administrator_organizations_list_by_organization) | **GET** /organizations/{id}/administratorlinks | List the association links between an Organization and Administrators. +*AdministratorsApi* | [**administrator_organizations_remove_by_administrator**](docs/AdministratorsApi.md#administrator_organizations_remove_by_administrator) | **DELETE** /administrators/{administrator_id}/organizationlinks/{id} | Remove association between an Administrator and an Organization. +*AppleMDMApi* | [**applemdms_csrget**](docs/AppleMDMApi.md#applemdms_csrget) | **GET** /applemdms/{apple_mdm_id}/csr | Get Apple MDM CSR Plist +*AppleMDMApi* | [**applemdms_delete**](docs/AppleMDMApi.md#applemdms_delete) | **DELETE** /applemdms/{id} | Delete an Apple MDM +*AppleMDMApi* | [**applemdms_deletedevice**](docs/AppleMDMApi.md#applemdms_deletedevice) | **DELETE** /applemdms/{apple_mdm_id}/devices/{device_id} | Remove an Apple MDM Device's Enrollment +*AppleMDMApi* | [**applemdms_depkeyget**](docs/AppleMDMApi.md#applemdms_depkeyget) | **GET** /applemdms/{apple_mdm_id}/depkey | Get Apple MDM DEP Public Key +*AppleMDMApi* | [**applemdms_devices_clear_activation_lock**](docs/AppleMDMApi.md#applemdms_devices_clear_activation_lock) | **POST** /applemdms/{apple_mdm_id}/devices/{device_id}/clearActivationLock | Clears the Activation Lock for a Device +*AppleMDMApi* | [**applemdms_devices_refresh_activation_lock_information**](docs/AppleMDMApi.md#applemdms_devices_refresh_activation_lock_information) | **POST** /applemdms/{apple_mdm_id}/devices/{device_id}/refreshActivationLockInformation | Refresh activation lock information for a device +*AppleMDMApi* | [**applemdms_deviceserase**](docs/AppleMDMApi.md#applemdms_deviceserase) | **POST** /applemdms/{apple_mdm_id}/devices/{device_id}/erase | Erase Device +*AppleMDMApi* | [**applemdms_deviceslist**](docs/AppleMDMApi.md#applemdms_deviceslist) | **GET** /applemdms/{apple_mdm_id}/devices | List AppleMDM Devices +*AppleMDMApi* | [**applemdms_deviceslock**](docs/AppleMDMApi.md#applemdms_deviceslock) | **POST** /applemdms/{apple_mdm_id}/devices/{device_id}/lock | Lock Device +*AppleMDMApi* | [**applemdms_devicesrestart**](docs/AppleMDMApi.md#applemdms_devicesrestart) | **POST** /applemdms/{apple_mdm_id}/devices/{device_id}/restart | Restart Device +*AppleMDMApi* | [**applemdms_devicesshutdown**](docs/AppleMDMApi.md#applemdms_devicesshutdown) | **POST** /applemdms/{apple_mdm_id}/devices/{device_id}/shutdown | Shut Down Device +*AppleMDMApi* | [**applemdms_enrollmentprofilesget**](docs/AppleMDMApi.md#applemdms_enrollmentprofilesget) | **GET** /applemdms/{apple_mdm_id}/enrollmentprofiles/{id} | Get an Apple MDM Enrollment Profile +*AppleMDMApi* | [**applemdms_enrollmentprofileslist**](docs/AppleMDMApi.md#applemdms_enrollmentprofileslist) | **GET** /applemdms/{apple_mdm_id}/enrollmentprofiles | List Apple MDM Enrollment Profiles +*AppleMDMApi* | [**applemdms_getdevice**](docs/AppleMDMApi.md#applemdms_getdevice) | **GET** /applemdms/{apple_mdm_id}/devices/{device_id} | Details of an AppleMDM Device *AppleMDMApi* | [**applemdms_list**](docs/AppleMDMApi.md#applemdms_list) | **GET** /applemdms | List Apple MDMs -*AppleMDMApi* | [**applemdms_post**](docs/AppleMDMApi.md#applemdms_post) | **POST** /applemdms | Create Apple MDM -*AppleMDMApi* | [**applemdms_put**](docs/AppleMDMApi.md#applemdms_put) | **PUT** /applemdms/{apple_mdm_id} | Update an Apple MDM -*AppleMDMApi* | [**enrollmentprofiles_get**](docs/AppleMDMApi.md#enrollmentprofiles_get) | **GET** /applemdms/{apple_mdm_id}/enrollmentprofiles/{enrollment_profile_id} | Get an Apple MDM Enrollment Profile -*AppleMDMApi* | [**enrollmentprofiles_list**](docs/AppleMDMApi.md#enrollmentprofiles_list) | **GET** /applemdms/{apple_mdm_id}/enrollmentprofiles | List Apple MDM Enrollment Profiles +*AppleMDMApi* | [**applemdms_put**](docs/AppleMDMApi.md#applemdms_put) | **PUT** /applemdms/{id} | Update an Apple MDM +*AppleMDMApi* | [**applemdms_refreshdepdevices**](docs/AppleMDMApi.md#applemdms_refreshdepdevices) | **POST** /applemdms/{apple_mdm_id}/refreshdepdevices | Refresh DEP Devices +*ApplicationsApi* | [**applications_delete_logo**](docs/ApplicationsApi.md#applications_delete_logo) | **DELETE** /applications/{application_id}/logo | Delete application image +*ApplicationsApi* | [**applications_get**](docs/ApplicationsApi.md#applications_get) | **GET** /applications/{application_id} | Get an Application +*ApplicationsApi* | [**applications_post_logo**](docs/ApplicationsApi.md#applications_post_logo) | **POST** /applications/{application_id}/logo | *ApplicationsApi* | [**graph_application_associations_list**](docs/ApplicationsApi.md#graph_application_associations_list) | **GET** /applications/{application_id}/associations | List the associations of an Application *ApplicationsApi* | [**graph_application_associations_post**](docs/ApplicationsApi.md#graph_application_associations_post) | **POST** /applications/{application_id}/associations | Manage the associations of an Application *ApplicationsApi* | [**graph_application_traverse_user**](docs/ApplicationsApi.md#graph_application_traverse_user) | **GET** /applications/{application_id}/users | List the Users bound to an Application *ApplicationsApi* | [**graph_application_traverse_user_group**](docs/ApplicationsApi.md#graph_application_traverse_user_group) | **GET** /applications/{application_id}/usergroups | List the User Groups bound to an Application +*ApplicationsApi* | [**import_users**](docs/ApplicationsApi.md#import_users) | **GET** /applications/{application_id}/import/users | Get a list of users to import from an Application IdM service provider +*AuthenticationPoliciesApi* | [**authnpolicies_delete**](docs/AuthenticationPoliciesApi.md#authnpolicies_delete) | **DELETE** /authn/policies/{id} | Delete Authentication Policy +*AuthenticationPoliciesApi* | [**authnpolicies_get**](docs/AuthenticationPoliciesApi.md#authnpolicies_get) | **GET** /authn/policies/{id} | Get an authentication policy +*AuthenticationPoliciesApi* | [**authnpolicies_list**](docs/AuthenticationPoliciesApi.md#authnpolicies_list) | **GET** /authn/policies | List Authentication Policies +*AuthenticationPoliciesApi* | [**authnpolicies_patch**](docs/AuthenticationPoliciesApi.md#authnpolicies_patch) | **PATCH** /authn/policies/{id} | Patch Authentication Policy +*AuthenticationPoliciesApi* | [**authnpolicies_post**](docs/AuthenticationPoliciesApi.md#authnpolicies_post) | **POST** /authn/policies | Create an Authentication Policy +*BulkJobRequestsApi* | [**bulk_user_states_create**](docs/BulkJobRequestsApi.md#bulk_user_states_create) | **POST** /bulk/userstates | Create Scheduled Userstate Job +*BulkJobRequestsApi* | [**bulk_user_states_delete**](docs/BulkJobRequestsApi.md#bulk_user_states_delete) | **DELETE** /bulk/userstates/{id} | Delete Scheduled Userstate Job +*BulkJobRequestsApi* | [**bulk_user_states_get_next_scheduled**](docs/BulkJobRequestsApi.md#bulk_user_states_get_next_scheduled) | **GET** /bulk/userstates/eventlist/next | Gets the next scheduled state change for each user in a list of system users +*BulkJobRequestsApi* | [**bulk_user_states_list**](docs/BulkJobRequestsApi.md#bulk_user_states_list) | **GET** /bulk/userstates | List Scheduled Userstate Change Jobs *BulkJobRequestsApi* | [**bulk_users_create**](docs/BulkJobRequestsApi.md#bulk_users_create) | **POST** /bulk/users | Bulk Users Create *BulkJobRequestsApi* | [**bulk_users_create_results**](docs/BulkJobRequestsApi.md#bulk_users_create_results) | **GET** /bulk/users/{job_id}/results | List Bulk Users Results *BulkJobRequestsApi* | [**bulk_users_update**](docs/BulkJobRequestsApi.md#bulk_users_update) | **PATCH** /bulk/users | Bulk Users Update -*BulkJobRequestsApi* | [**jobs_get**](docs/BulkJobRequestsApi.md#jobs_get) | **GET** /jobs/{id} | Get Job (incomplete) -*BulkJobRequestsApi* | [**jobs_results**](docs/BulkJobRequestsApi.md#jobs_results) | **GET** /jobs/{id}/results | List Job Results +*CommandResultsApi* | [**commands_list_results_by_workflow**](docs/CommandResultsApi.md#commands_list_results_by_workflow) | **GET** /commandresult/workflows | List all Command Results by Workflow +*CommandsApi* | [**commands_cancel_queued_commands_by_workflow_instance_id**](docs/CommandsApi.md#commands_cancel_queued_commands_by_workflow_instance_id) | **DELETE** /commandqueue/{workflow_instance_id} | Cancel all queued commands for an organization by workflow instance Id +*CommandsApi* | [**commands_get_queued_commands_by_workflow**](docs/CommandsApi.md#commands_get_queued_commands_by_workflow) | **GET** /queuedcommand/workflows | Fetch the queued Commands for an Organization *CommandsApi* | [**graph_command_associations_list**](docs/CommandsApi.md#graph_command_associations_list) | **GET** /commands/{command_id}/associations | List the associations of a Command *CommandsApi* | [**graph_command_associations_post**](docs/CommandsApi.md#graph_command_associations_post) | **POST** /commands/{command_id}/associations | Manage the associations of a Command *CommandsApi* | [**graph_command_traverse_system**](docs/CommandsApi.md#graph_command_traverse_system) | **GET** /commands/{command_id}/systems | List the Systems bound to a Command *CommandsApi* | [**graph_command_traverse_system_group**](docs/CommandsApi.md#graph_command_traverse_system_group) | **GET** /commands/{command_id}/systemgroups | List the System Groups bound to a Command +*CustomEmailsApi* | [**custom_emails_create**](docs/CustomEmailsApi.md#custom_emails_create) | **POST** /customemails | Create custom email configuration +*CustomEmailsApi* | [**custom_emails_destroy**](docs/CustomEmailsApi.md#custom_emails_destroy) | **DELETE** /customemails/{custom_email_type} | Delete custom email configuration +*CustomEmailsApi* | [**custom_emails_get_templates**](docs/CustomEmailsApi.md#custom_emails_get_templates) | **GET** /customemail/templates | List custom email templates +*CustomEmailsApi* | [**custom_emails_read**](docs/CustomEmailsApi.md#custom_emails_read) | **GET** /customemails/{custom_email_type} | Get custom email configuration +*CustomEmailsApi* | [**custom_emails_update**](docs/CustomEmailsApi.md#custom_emails_update) | **PUT** /customemails/{custom_email_type} | Update custom email configuration *DirectoriesApi* | [**directories_list**](docs/DirectoriesApi.md#directories_list) | **GET** /directories | List All Directories *DuoApi* | [**duo_account_delete**](docs/DuoApi.md#duo_account_delete) | **DELETE** /duo/accounts/{id} | Delete a Duo Account *DuoApi* | [**duo_account_get**](docs/DuoApi.md#duo_account_get) | **GET** /duo/accounts/{id} | Get a Duo Acount -*DuoApi* | [**duo_account_list**](docs/DuoApi.md#duo_account_list) | **GET** /duo/accounts | List Duo Acounts +*DuoApi* | [**duo_account_list**](docs/DuoApi.md#duo_account_list) | **GET** /duo/accounts | List Duo Accounts *DuoApi* | [**duo_account_post**](docs/DuoApi.md#duo_account_post) | **POST** /duo/accounts | Create Duo Account *DuoApi* | [**duo_application_delete**](docs/DuoApi.md#duo_application_delete) | **DELETE** /duo/accounts/{account_id}/applications/{application_id} | Delete a Duo Application *DuoApi* | [**duo_application_get**](docs/DuoApi.md#duo_application_get) | **GET** /duo/accounts/{account_id}/applications/{application_id} | Get a Duo application @@ -118,11 +373,15 @@ Class | Method | HTTP request | Description *GSuiteApi* | [**graph_g_suite_traverse_user**](docs/GSuiteApi.md#graph_g_suite_traverse_user) | **GET** /gsuites/{gsuite_id}/users | List the Users bound to a G Suite instance *GSuiteApi* | [**graph_g_suite_traverse_user_group**](docs/GSuiteApi.md#graph_g_suite_traverse_user_group) | **GET** /gsuites/{gsuite_id}/usergroups | List the User Groups bound to a G Suite instance *GSuiteApi* | [**gsuites_get**](docs/GSuiteApi.md#gsuites_get) | **GET** /gsuites/{id} | Get G Suite +*GSuiteApi* | [**gsuites_list_import_jumpcloud_users**](docs/GSuiteApi.md#gsuites_list_import_jumpcloud_users) | **GET** /gsuites/{gsuite_id}/import/jumpcloudusers | Get a list of users in Jumpcloud format to import from a Google Workspace account. +*GSuiteApi* | [**gsuites_list_import_users**](docs/GSuiteApi.md#gsuites_list_import_users) | **GET** /gsuites/{gsuite_id}/import/users | Get a list of users to import from a G Suite instance *GSuiteApi* | [**gsuites_patch**](docs/GSuiteApi.md#gsuites_patch) | **PATCH** /gsuites/{id} | Update existing G Suite *GSuiteApi* | [**translation_rules_g_suite_delete**](docs/GSuiteApi.md#translation_rules_g_suite_delete) | **DELETE** /gsuites/{gsuite_id}/translationrules/{id} | Deletes a G Suite translation rule *GSuiteApi* | [**translation_rules_g_suite_get**](docs/GSuiteApi.md#translation_rules_g_suite_get) | **GET** /gsuites/{gsuite_id}/translationrules/{id} | Gets a specific G Suite translation rule *GSuiteApi* | [**translation_rules_g_suite_list**](docs/GSuiteApi.md#translation_rules_g_suite_list) | **GET** /gsuites/{gsuite_id}/translationrules | List all the G Suite Translation Rules *GSuiteApi* | [**translation_rules_g_suite_post**](docs/GSuiteApi.md#translation_rules_g_suite_post) | **POST** /gsuites/{gsuite_id}/translationrules | Create a new G Suite Translation Rule +*GSuiteImportApi* | [**gsuites_list_import_jumpcloud_users**](docs/GSuiteImportApi.md#gsuites_list_import_jumpcloud_users) | **GET** /gsuites/{gsuite_id}/import/jumpcloudusers | Get a list of users in Jumpcloud format to import from a Google Workspace account. +*GSuiteImportApi* | [**gsuites_list_import_users**](docs/GSuiteImportApi.md#gsuites_list_import_users) | **GET** /gsuites/{gsuite_id}/import/users | Get a list of users to import from a G Suite instance *GraphApi* | [**graph_active_directory_associations_list**](docs/GraphApi.md#graph_active_directory_associations_list) | **GET** /activedirectories/{activedirectory_id}/associations | List the associations of an Active Directory instance *GraphApi* | [**graph_active_directory_associations_post**](docs/GraphApi.md#graph_active_directory_associations_post) | **POST** /activedirectories/{activedirectory_id}/associations | Manage the associations of an Active Directory instance *GraphApi* | [**graph_active_directory_traverse_user**](docs/GraphApi.md#graph_active_directory_traverse_user) | **GET** /activedirectories/{activedirectory_id}/users | List the Users bound to an Active Directory instance @@ -149,37 +408,49 @@ Class | Method | HTTP request | Description *GraphApi* | [**graph_office365_traverse_user_group**](docs/GraphApi.md#graph_office365_traverse_user_group) | **GET** /office365s/{office365_id}/usergroups | List the User Groups bound to an Office 365 instance *GraphApi* | [**graph_policy_associations_list**](docs/GraphApi.md#graph_policy_associations_list) | **GET** /policies/{policy_id}/associations | List the associations of a Policy *GraphApi* | [**graph_policy_associations_post**](docs/GraphApi.md#graph_policy_associations_post) | **POST** /policies/{policy_id}/associations | Manage the associations of a Policy +*GraphApi* | [**graph_policy_group_associations_list**](docs/GraphApi.md#graph_policy_group_associations_list) | **GET** /policygroups/{group_id}/associations | List the associations of a Policy Group. +*GraphApi* | [**graph_policy_group_associations_post**](docs/GraphApi.md#graph_policy_group_associations_post) | **POST** /policygroups/{group_id}/associations | Manage the associations of a Policy Group +*GraphApi* | [**graph_policy_group_members_list**](docs/GraphApi.md#graph_policy_group_members_list) | **GET** /policygroups/{group_id}/members | List the members of a Policy Group +*GraphApi* | [**graph_policy_group_members_post**](docs/GraphApi.md#graph_policy_group_members_post) | **POST** /policygroups/{group_id}/members | Manage the members of a Policy Group +*GraphApi* | [**graph_policy_group_membership**](docs/GraphApi.md#graph_policy_group_membership) | **GET** /policygroups/{group_id}/membership | List the Policy Group's membership +*GraphApi* | [**graph_policy_group_traverse_system**](docs/GraphApi.md#graph_policy_group_traverse_system) | **GET** /policygroups/{group_id}/systems | List the Systems bound to a Policy Group +*GraphApi* | [**graph_policy_group_traverse_system_group**](docs/GraphApi.md#graph_policy_group_traverse_system_group) | **GET** /policygroups/{group_id}/systemgroups | List the System Groups bound to Policy Groups +*GraphApi* | [**graph_policy_member_of**](docs/GraphApi.md#graph_policy_member_of) | **GET** /policies/{policy_id}/memberof | List the parent Groups of a Policy *GraphApi* | [**graph_policy_traverse_system**](docs/GraphApi.md#graph_policy_traverse_system) | **GET** /policies/{policy_id}/systems | List the Systems bound to a Policy *GraphApi* | [**graph_policy_traverse_system_group**](docs/GraphApi.md#graph_policy_traverse_system_group) | **GET** /policies/{policy_id}/systemgroups | List the System Groups bound to a Policy *GraphApi* | [**graph_radius_server_associations_list**](docs/GraphApi.md#graph_radius_server_associations_list) | **GET** /radiusservers/{radiusserver_id}/associations | List the associations of a RADIUS Server *GraphApi* | [**graph_radius_server_associations_post**](docs/GraphApi.md#graph_radius_server_associations_post) | **POST** /radiusservers/{radiusserver_id}/associations | Manage the associations of a RADIUS Server *GraphApi* | [**graph_radius_server_traverse_user**](docs/GraphApi.md#graph_radius_server_traverse_user) | **GET** /radiusservers/{radiusserver_id}/users | List the Users bound to a RADIUS Server *GraphApi* | [**graph_radius_server_traverse_user_group**](docs/GraphApi.md#graph_radius_server_traverse_user_group) | **GET** /radiusservers/{radiusserver_id}/usergroups | List the User Groups bound to a RADIUS Server +*GraphApi* | [**graph_softwareapps_associations_list**](docs/GraphApi.md#graph_softwareapps_associations_list) | **GET** /softwareapps/{software_app_id}/associations | List the associations of a Software Application +*GraphApi* | [**graph_softwareapps_associations_post**](docs/GraphApi.md#graph_softwareapps_associations_post) | **POST** /softwareapps/{software_app_id}/associations | Manage the associations of a software application. +*GraphApi* | [**graph_softwareapps_traverse_system**](docs/GraphApi.md#graph_softwareapps_traverse_system) | **GET** /softwareapps/{software_app_id}/systems | List the Systems bound to a Software App. +*GraphApi* | [**graph_softwareapps_traverse_system_group**](docs/GraphApi.md#graph_softwareapps_traverse_system_group) | **GET** /softwareapps/{software_app_id}/systemgroups | List the System Groups bound to a Software App. *GraphApi* | [**graph_system_associations_list**](docs/GraphApi.md#graph_system_associations_list) | **GET** /systems/{system_id}/associations | List the associations of a System *GraphApi* | [**graph_system_associations_post**](docs/GraphApi.md#graph_system_associations_post) | **POST** /systems/{system_id}/associations | Manage associations of a System *GraphApi* | [**graph_system_group_associations_list**](docs/GraphApi.md#graph_system_group_associations_list) | **GET** /systemgroups/{group_id}/associations | List the associations of a System Group *GraphApi* | [**graph_system_group_associations_post**](docs/GraphApi.md#graph_system_group_associations_post) | **POST** /systemgroups/{group_id}/associations | Manage the associations of a System Group -*GraphApi* | [**graph_system_group_member_of**](docs/GraphApi.md#graph_system_group_member_of) | **GET** /systemgroups/{group_id}/memberof | List the System Group's parents *GraphApi* | [**graph_system_group_members_list**](docs/GraphApi.md#graph_system_group_members_list) | **GET** /systemgroups/{group_id}/members | List the members of a System Group *GraphApi* | [**graph_system_group_members_post**](docs/GraphApi.md#graph_system_group_members_post) | **POST** /systemgroups/{group_id}/members | Manage the members of a System Group -*GraphApi* | [**graph_system_group_membership**](docs/GraphApi.md#graph_system_group_membership) | **GET** /systemgroups/{group_id}/membership | List the System Group's membership +*GraphApi* | [**graph_system_group_membership**](docs/GraphApi.md#graph_system_group_membership) | **GET** /systemgroups/{group_id}/membership | List the System Group's membership *GraphApi* | [**graph_system_group_traverse_command**](docs/GraphApi.md#graph_system_group_traverse_command) | **GET** /systemgroups/{group_id}/commands | List the Commands bound to a System Group *GraphApi* | [**graph_system_group_traverse_policy**](docs/GraphApi.md#graph_system_group_traverse_policy) | **GET** /systemgroups/{group_id}/policies | List the Policies bound to a System Group +*GraphApi* | [**graph_system_group_traverse_policy_group**](docs/GraphApi.md#graph_system_group_traverse_policy_group) | **GET** /systemgroups/{group_id}/policygroups | List the Policy Groups bound to a System Group *GraphApi* | [**graph_system_group_traverse_user**](docs/GraphApi.md#graph_system_group_traverse_user) | **GET** /systemgroups/{group_id}/users | List the Users bound to a System Group *GraphApi* | [**graph_system_group_traverse_user_group**](docs/GraphApi.md#graph_system_group_traverse_user_group) | **GET** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group *GraphApi* | [**graph_system_member_of**](docs/GraphApi.md#graph_system_member_of) | **GET** /systems/{system_id}/memberof | List the parent Groups of a System *GraphApi* | [**graph_system_traverse_command**](docs/GraphApi.md#graph_system_traverse_command) | **GET** /systems/{system_id}/commands | List the Commands bound to a System *GraphApi* | [**graph_system_traverse_policy**](docs/GraphApi.md#graph_system_traverse_policy) | **GET** /systems/{system_id}/policies | List the Policies bound to a System +*GraphApi* | [**graph_system_traverse_policy_group**](docs/GraphApi.md#graph_system_traverse_policy_group) | **GET** /systems/{system_id}/policygroups | List the Policy Groups bound to a System *GraphApi* | [**graph_system_traverse_user**](docs/GraphApi.md#graph_system_traverse_user) | **GET** /systems/{system_id}/users | List the Users bound to a System *GraphApi* | [**graph_system_traverse_user_group**](docs/GraphApi.md#graph_system_traverse_user_group) | **GET** /systems/{system_id}/usergroups | List the User Groups bound to a System *GraphApi* | [**graph_user_associations_list**](docs/GraphApi.md#graph_user_associations_list) | **GET** /users/{user_id}/associations | List the associations of a User *GraphApi* | [**graph_user_associations_post**](docs/GraphApi.md#graph_user_associations_post) | **POST** /users/{user_id}/associations | Manage the associations of a User *GraphApi* | [**graph_user_group_associations_list**](docs/GraphApi.md#graph_user_group_associations_list) | **GET** /usergroups/{group_id}/associations | List the associations of a User Group. *GraphApi* | [**graph_user_group_associations_post**](docs/GraphApi.md#graph_user_group_associations_post) | **POST** /usergroups/{group_id}/associations | Manage the associations of a User Group -*GraphApi* | [**graph_user_group_member_of**](docs/GraphApi.md#graph_user_group_member_of) | **GET** /usergroups/{group_id}/memberof | List the User Group's parents *GraphApi* | [**graph_user_group_members_list**](docs/GraphApi.md#graph_user_group_members_list) | **GET** /usergroups/{group_id}/members | List the members of a User Group *GraphApi* | [**graph_user_group_members_post**](docs/GraphApi.md#graph_user_group_members_post) | **POST** /usergroups/{group_id}/members | Manage the members of a User Group -*GraphApi* | [**graph_user_group_membership**](docs/GraphApi.md#graph_user_group_membership) | **GET** /usergroups/{group_id}/membership | List the User Group's membership +*GraphApi* | [**graph_user_group_membership**](docs/GraphApi.md#graph_user_group_membership) | **GET** /usergroups/{group_id}/membership | List the User Group's membership *GraphApi* | [**graph_user_group_traverse_active_directory**](docs/GraphApi.md#graph_user_group_traverse_active_directory) | **GET** /usergroups/{group_id}/activedirectories | List the Active Directories bound to a User Group *GraphApi* | [**graph_user_group_traverse_application**](docs/GraphApi.md#graph_user_group_traverse_application) | **GET** /usergroups/{group_id}/applications | List the Applications bound to a User Group *GraphApi* | [**graph_user_group_traverse_directory**](docs/GraphApi.md#graph_user_group_traverse_directory) | **GET** /usergroups/{group_id}/directories | List the Directories bound to a User Group @@ -199,9 +470,15 @@ Class | Method | HTTP request | Description *GraphApi* | [**graph_user_traverse_radius_server**](docs/GraphApi.md#graph_user_traverse_radius_server) | **GET** /users/{user_id}/radiusservers | List the RADIUS Servers bound to a User *GraphApi* | [**graph_user_traverse_system**](docs/GraphApi.md#graph_user_traverse_system) | **GET** /users/{user_id}/systems | List the Systems bound to a User *GraphApi* | [**graph_user_traverse_system_group**](docs/GraphApi.md#graph_user_traverse_system_group) | **GET** /users/{user_id}/systemgroups | List the System Groups bound to a User -*GraphApi* | [**policystatuses_list**](docs/GraphApi.md#policystatuses_list) | **GET** /systems/{system_id}/policystatuses | List the policy statuses for a system +*GraphApi* | [**policystatuses_systems_list**](docs/GraphApi.md#policystatuses_systems_list) | **GET** /systems/{system_id}/policystatuses | List the policy statuses for a system *GroupsApi* | [**groups_list**](docs/GroupsApi.md#groups_list) | **GET** /groups | List All Groups -*KnowledgeApi* | [**knowledge_salesforce_list**](docs/KnowledgeApi.md#knowledge_salesforce_list) | **GET** /knowledge/salesforce | List Knowledge Articles +*IPListsApi* | [**iplists_delete**](docs/IPListsApi.md#iplists_delete) | **DELETE** /iplists/{id} | Delete an IP list +*IPListsApi* | [**iplists_get**](docs/IPListsApi.md#iplists_get) | **GET** /iplists/{id} | Get an IP list +*IPListsApi* | [**iplists_list**](docs/IPListsApi.md#iplists_list) | **GET** /iplists | List IP Lists +*IPListsApi* | [**iplists_patch**](docs/IPListsApi.md#iplists_patch) | **PATCH** /iplists/{id} | Update an IP list +*IPListsApi* | [**iplists_post**](docs/IPListsApi.md#iplists_post) | **POST** /iplists | Create IP List +*IPListsApi* | [**iplists_put**](docs/IPListsApi.md#iplists_put) | **PUT** /iplists/{id} | Replace an IP list +*ImageApi* | [**applications_delete_logo**](docs/ImageApi.md#applications_delete_logo) | **DELETE** /applications/{application_id}/logo | Delete application image *LDAPServersApi* | [**graph_ldap_server_associations_list**](docs/LDAPServersApi.md#graph_ldap_server_associations_list) | **GET** /ldapservers/{ldapserver_id}/associations | List the associations of a LDAP Server *LDAPServersApi* | [**graph_ldap_server_associations_post**](docs/LDAPServersApi.md#graph_ldap_server_associations_post) | **POST** /ldapservers/{ldapserver_id}/associations | Manage the associations of a LDAP Server *LDAPServersApi* | [**graph_ldap_server_traverse_user**](docs/LDAPServersApi.md#graph_ldap_server_traverse_user) | **GET** /ldapservers/{ldapserver_id}/users | List the Users bound to a LDAP Server @@ -209,18 +486,38 @@ Class | Method | HTTP request | Description *LDAPServersApi* | [**ldapservers_get**](docs/LDAPServersApi.md#ldapservers_get) | **GET** /ldapservers/{id} | Get LDAP Server *LDAPServersApi* | [**ldapservers_list**](docs/LDAPServersApi.md#ldapservers_list) | **GET** /ldapservers | List LDAP Servers *LDAPServersApi* | [**ldapservers_patch**](docs/LDAPServersApi.md#ldapservers_patch) | **PATCH** /ldapservers/{id} | Update existing LDAP server +*LogosApi* | [**logos_get**](docs/LogosApi.md#logos_get) | **GET** /logos/{id} | Get the logo associated with the specified id +*ManagedServiceProviderApi* | [**administrator_organizations_create_by_administrator**](docs/ManagedServiceProviderApi.md#administrator_organizations_create_by_administrator) | **POST** /administrators/{id}/organizationlinks | Allow Adminstrator access to an Organization. +*ManagedServiceProviderApi* | [**administrator_organizations_list_by_administrator**](docs/ManagedServiceProviderApi.md#administrator_organizations_list_by_administrator) | **GET** /administrators/{id}/organizationlinks | List the association links between an Administrator and Organizations. +*ManagedServiceProviderApi* | [**administrator_organizations_list_by_organization**](docs/ManagedServiceProviderApi.md#administrator_organizations_list_by_organization) | **GET** /organizations/{id}/administratorlinks | List the association links between an Organization and Administrators. +*ManagedServiceProviderApi* | [**administrator_organizations_remove_by_administrator**](docs/ManagedServiceProviderApi.md#administrator_organizations_remove_by_administrator) | **DELETE** /administrators/{administrator_id}/organizationlinks/{id} | Remove association between an Administrator and an Organization. +*ManagedServiceProviderApi* | [**provider_organizations_update_org**](docs/ManagedServiceProviderApi.md#provider_organizations_update_org) | **PUT** /providers/{provider_id}/organizations/{id} | Update Provider Organization +*ManagedServiceProviderApi* | [**providers_get_provider**](docs/ManagedServiceProviderApi.md#providers_get_provider) | **GET** /providers/{provider_id} | Retrieve Provider +*ManagedServiceProviderApi* | [**providers_list_administrators**](docs/ManagedServiceProviderApi.md#providers_list_administrators) | **GET** /providers/{provider_id}/administrators | List Provider Administrators +*ManagedServiceProviderApi* | [**providers_list_organizations**](docs/ManagedServiceProviderApi.md#providers_list_organizations) | **GET** /providers/{provider_id}/organizations | List Provider Organizations +*ManagedServiceProviderApi* | [**providers_post_admins**](docs/ManagedServiceProviderApi.md#providers_post_admins) | **POST** /providers/{provider_id}/administrators | Create a new Provider Administrator +*ManagedServiceProviderApi* | [**providers_retrieve_invoice**](docs/ManagedServiceProviderApi.md#providers_retrieve_invoice) | **GET** /providers/{provider_id}/invoices/{ID} | Download a provider's invoice. +*ManagedServiceProviderApi* | [**providers_retrieve_invoices**](docs/ManagedServiceProviderApi.md#providers_retrieve_invoices) | **GET** /providers/{provider_id}/invoices | List a provider's invoices. *Office365Api* | [**graph_office365_associations_list**](docs/Office365Api.md#graph_office365_associations_list) | **GET** /office365s/{office365_id}/associations | List the associations of an Office 365 instance *Office365Api* | [**graph_office365_associations_post**](docs/Office365Api.md#graph_office365_associations_post) | **POST** /office365s/{office365_id}/associations | Manage the associations of an Office 365 instance *Office365Api* | [**graph_office365_traverse_user**](docs/Office365Api.md#graph_office365_traverse_user) | **GET** /office365s/{office365_id}/users | List the Users bound to an Office 365 instance *Office365Api* | [**graph_office365_traverse_user_group**](docs/Office365Api.md#graph_office365_traverse_user_group) | **GET** /office365s/{office365_id}/usergroups | List the User Groups bound to an Office 365 instance +*Office365Api* | [**office365s_get**](docs/Office365Api.md#office365s_get) | **GET** /office365s/{office365_id} | Get Office 365 instance +*Office365Api* | [**office365s_list_import_users**](docs/Office365Api.md#office365s_list_import_users) | **GET** /office365s/{office365_id}/import/users | Get a list of users to import from an Office 365 instance +*Office365Api* | [**office365s_patch**](docs/Office365Api.md#office365s_patch) | **PATCH** /office365s/{office365_id} | Update existing Office 365 instance. *Office365Api* | [**translation_rules_office365_delete**](docs/Office365Api.md#translation_rules_office365_delete) | **DELETE** /office365s/{office365_id}/translationrules/{id} | Deletes a Office 365 translation rule *Office365Api* | [**translation_rules_office365_get**](docs/Office365Api.md#translation_rules_office365_get) | **GET** /office365s/{office365_id}/translationrules/{id} | Gets a specific Office 365 translation rule *Office365Api* | [**translation_rules_office365_list**](docs/Office365Api.md#translation_rules_office365_list) | **GET** /office365s/{office365_id}/translationrules | List all the Office 365 Translation Rules *Office365Api* | [**translation_rules_office365_post**](docs/Office365Api.md#translation_rules_office365_post) | **POST** /office365s/{office365_id}/translationrules | Create a new Office 365 Translation Rule -*OrganizationsApi* | [**org_crypto_get**](docs/OrganizationsApi.md#org_crypto_get) | **GET** /organizations/{id}/crypto | Get Crypto Settings -*OrganizationsApi* | [**org_crypto_put**](docs/OrganizationsApi.md#org_crypto_put) | **PUT** /organizations/{id}/crypto | Edit Crypto Settings +*Office365ImportApi* | [**office365s_list_import_users**](docs/Office365ImportApi.md#office365s_list_import_users) | **GET** /office365s/{office365_id}/import/users | Get a list of users to import from an Office 365 instance +*OrganizationsApi* | [**administrator_organizations_create_by_administrator**](docs/OrganizationsApi.md#administrator_organizations_create_by_administrator) | **POST** /administrators/{id}/organizationlinks | Allow Adminstrator access to an Organization. +*OrganizationsApi* | [**administrator_organizations_list_by_administrator**](docs/OrganizationsApi.md#administrator_organizations_list_by_administrator) | **GET** /administrators/{id}/organizationlinks | List the association links between an Administrator and Organizations. +*OrganizationsApi* | [**administrator_organizations_list_by_organization**](docs/OrganizationsApi.md#administrator_organizations_list_by_organization) | **GET** /organizations/{id}/administratorlinks | List the association links between an Organization and Administrators. +*OrganizationsApi* | [**administrator_organizations_remove_by_administrator**](docs/OrganizationsApi.md#administrator_organizations_remove_by_administrator) | **DELETE** /administrators/{administrator_id}/organizationlinks/{id} | Remove association between an Administrator and an Organization. +*OrganizationsApi* | [**organizations_list_cases**](docs/OrganizationsApi.md#organizations_list_cases) | **GET** /organizations/cases | Get all cases (Support/Feature requests) for organization *PoliciesApi* | [**graph_policy_associations_list**](docs/PoliciesApi.md#graph_policy_associations_list) | **GET** /policies/{policy_id}/associations | List the associations of a Policy *PoliciesApi* | [**graph_policy_associations_post**](docs/PoliciesApi.md#graph_policy_associations_post) | **POST** /policies/{policy_id}/associations | Manage the associations of a Policy +*PoliciesApi* | [**graph_policy_member_of**](docs/PoliciesApi.md#graph_policy_member_of) | **GET** /policies/{policy_id}/memberof | List the parent Groups of a Policy *PoliciesApi* | [**graph_policy_traverse_system**](docs/PoliciesApi.md#graph_policy_traverse_system) | **GET** /policies/{policy_id}/systems | List the Systems bound to a Policy *PoliciesApi* | [**graph_policy_traverse_system_group**](docs/PoliciesApi.md#graph_policy_traverse_system_group) | **GET** /policies/{policy_id}/systemgroups | List the System Groups bound to a Policy *PoliciesApi* | [**policies_delete**](docs/PoliciesApi.md#policies_delete) | **DELETE** /policies/{id} | Deletes a Policy @@ -230,107 +527,191 @@ Class | Method | HTTP request | Description *PoliciesApi* | [**policies_put**](docs/PoliciesApi.md#policies_put) | **PUT** /policies/{id} | Update an existing Policy *PoliciesApi* | [**policyresults_get**](docs/PoliciesApi.md#policyresults_get) | **GET** /policyresults/{id} | Get a specific Policy Result. *PoliciesApi* | [**policyresults_list**](docs/PoliciesApi.md#policyresults_list) | **GET** /policies/{policy_id}/policyresults | Lists all the policy results of a policy. -*PoliciesApi* | [**policyresults_org_list**](docs/PoliciesApi.md#policyresults_org_list) | **GET** /policyresults | Lists all the policy results for an organization. -*PoliciesApi* | [**policystatuses_list**](docs/PoliciesApi.md#policystatuses_list) | **GET** /policies/{policy_id}/policystatuses | Lists the latest policy results of a policy. -*PoliciesApi* | [**policystatuses_list_0**](docs/PoliciesApi.md#policystatuses_list_0) | **GET** /systems/{system_id}/policystatuses | List the policy statuses for a system +*PoliciesApi* | [**policyresults_org_list**](docs/PoliciesApi.md#policyresults_org_list) | **GET** /policyresults | Lists all of the policy results for an organization. +*PoliciesApi* | [**policystatuses_policies_list**](docs/PoliciesApi.md#policystatuses_policies_list) | **GET** /policies/{policy_id}/policystatuses | Lists the latest policy results of a policy. +*PoliciesApi* | [**policystatuses_systems_list**](docs/PoliciesApi.md#policystatuses_systems_list) | **GET** /systems/{system_id}/policystatuses | List the policy statuses for a system *PoliciesApi* | [**policytemplates_get**](docs/PoliciesApi.md#policytemplates_get) | **GET** /policytemplates/{id} | Get a specific Policy Template *PoliciesApi* | [**policytemplates_list**](docs/PoliciesApi.md#policytemplates_list) | **GET** /policytemplates | Lists all of the Policy Templates +*PolicyGroupAssociationsApi* | [**graph_policy_group_associations_list**](docs/PolicyGroupAssociationsApi.md#graph_policy_group_associations_list) | **GET** /policygroups/{group_id}/associations | List the associations of a Policy Group. +*PolicyGroupAssociationsApi* | [**graph_policy_group_associations_post**](docs/PolicyGroupAssociationsApi.md#graph_policy_group_associations_post) | **POST** /policygroups/{group_id}/associations | Manage the associations of a Policy Group +*PolicyGroupAssociationsApi* | [**graph_policy_group_traverse_system**](docs/PolicyGroupAssociationsApi.md#graph_policy_group_traverse_system) | **GET** /policygroups/{group_id}/systems | List the Systems bound to a Policy Group +*PolicyGroupAssociationsApi* | [**graph_policy_group_traverse_system_group**](docs/PolicyGroupAssociationsApi.md#graph_policy_group_traverse_system_group) | **GET** /policygroups/{group_id}/systemgroups | List the System Groups bound to Policy Groups +*PolicyGroupMembersMembershipApi* | [**graph_policy_group_members_list**](docs/PolicyGroupMembersMembershipApi.md#graph_policy_group_members_list) | **GET** /policygroups/{group_id}/members | List the members of a Policy Group +*PolicyGroupMembersMembershipApi* | [**graph_policy_group_members_post**](docs/PolicyGroupMembersMembershipApi.md#graph_policy_group_members_post) | **POST** /policygroups/{group_id}/members | Manage the members of a Policy Group +*PolicyGroupMembersMembershipApi* | [**graph_policy_group_membership**](docs/PolicyGroupMembersMembershipApi.md#graph_policy_group_membership) | **GET** /policygroups/{group_id}/membership | List the Policy Group's membership +*PolicyGroupsApi* | [**graph_policy_group_associations_list**](docs/PolicyGroupsApi.md#graph_policy_group_associations_list) | **GET** /policygroups/{group_id}/associations | List the associations of a Policy Group. +*PolicyGroupsApi* | [**graph_policy_group_associations_post**](docs/PolicyGroupsApi.md#graph_policy_group_associations_post) | **POST** /policygroups/{group_id}/associations | Manage the associations of a Policy Group +*PolicyGroupsApi* | [**graph_policy_group_members_list**](docs/PolicyGroupsApi.md#graph_policy_group_members_list) | **GET** /policygroups/{group_id}/members | List the members of a Policy Group +*PolicyGroupsApi* | [**graph_policy_group_members_post**](docs/PolicyGroupsApi.md#graph_policy_group_members_post) | **POST** /policygroups/{group_id}/members | Manage the members of a Policy Group +*PolicyGroupsApi* | [**graph_policy_group_membership**](docs/PolicyGroupsApi.md#graph_policy_group_membership) | **GET** /policygroups/{group_id}/membership | List the Policy Group's membership +*PolicyGroupsApi* | [**graph_policy_group_traverse_system**](docs/PolicyGroupsApi.md#graph_policy_group_traverse_system) | **GET** /policygroups/{group_id}/systems | List the Systems bound to a Policy Group +*PolicyGroupsApi* | [**graph_policy_group_traverse_system_group**](docs/PolicyGroupsApi.md#graph_policy_group_traverse_system_group) | **GET** /policygroups/{group_id}/systemgroups | List the System Groups bound to Policy Groups +*PolicyGroupsApi* | [**groups_policy_delete**](docs/PolicyGroupsApi.md#groups_policy_delete) | **DELETE** /policygroups/{id} | Delete a Policy Group +*PolicyGroupsApi* | [**groups_policy_get**](docs/PolicyGroupsApi.md#groups_policy_get) | **GET** /policygroups/{id} | View an individual Policy Group details +*PolicyGroupsApi* | [**groups_policy_list**](docs/PolicyGroupsApi.md#groups_policy_list) | **GET** /policygroups | List all Policy Groups +*PolicyGroupsApi* | [**groups_policy_post**](docs/PolicyGroupsApi.md#groups_policy_post) | **POST** /policygroups | Create a new Policy Group +*PolicyGroupsApi* | [**groups_policy_put**](docs/PolicyGroupsApi.md#groups_policy_put) | **PUT** /policygroups/{id} | Update a Policy Group *PolicytemplatesApi* | [**policytemplates_get**](docs/PolicytemplatesApi.md#policytemplates_get) | **GET** /policytemplates/{id} | Get a specific Policy Template *PolicytemplatesApi* | [**policytemplates_list**](docs/PolicytemplatesApi.md#policytemplates_list) | **GET** /policytemplates | Lists all of the Policy Templates +*ProvidersApi* | [**autotask_create_configuration**](docs/ProvidersApi.md#autotask_create_configuration) | **POST** /providers/{provider_id}/integrations/autotask | Creates a new Autotask integration for the provider +*ProvidersApi* | [**autotask_delete_configuration**](docs/ProvidersApi.md#autotask_delete_configuration) | **DELETE** /integrations/autotask/{UUID} | Delete Autotask Integration +*ProvidersApi* | [**autotask_get_configuration**](docs/ProvidersApi.md#autotask_get_configuration) | **GET** /integrations/autotask/{UUID} | Retrieve Autotask Integration Configuration +*ProvidersApi* | [**autotask_patch_mappings**](docs/ProvidersApi.md#autotask_patch_mappings) | **PATCH** /integrations/autotask/{UUID}/mappings | Create, edit, and/or delete Autotask Mappings +*ProvidersApi* | [**autotask_patch_settings**](docs/ProvidersApi.md#autotask_patch_settings) | **PATCH** /integrations/autotask/{UUID}/settings | Create, edit, and/or delete Autotask Integration settings +*ProvidersApi* | [**autotask_retrieve_all_alert_configuration_options**](docs/ProvidersApi.md#autotask_retrieve_all_alert_configuration_options) | **GET** /providers/{provider_id}/integrations/autotask/alerts/configuration/options | Get all Autotask ticketing alert configuration options for a provider +*ProvidersApi* | [**autotask_retrieve_all_alert_configurations**](docs/ProvidersApi.md#autotask_retrieve_all_alert_configurations) | **GET** /providers/{provider_id}/integrations/autotask/alerts/configuration | Get all Autotask ticketing alert configurations for a provider +*ProvidersApi* | [**autotask_retrieve_companies**](docs/ProvidersApi.md#autotask_retrieve_companies) | **GET** /integrations/autotask/{UUID}/companies | Retrieve Autotask Companies +*ProvidersApi* | [**autotask_retrieve_company_types**](docs/ProvidersApi.md#autotask_retrieve_company_types) | **GET** /integrations/autotask/{UUID}/companytypes | Retrieve Autotask Company Types +*ProvidersApi* | [**autotask_retrieve_contracts**](docs/ProvidersApi.md#autotask_retrieve_contracts) | **GET** /integrations/autotask/{UUID}/contracts | Retrieve Autotask Contracts +*ProvidersApi* | [**autotask_retrieve_contracts_fields**](docs/ProvidersApi.md#autotask_retrieve_contracts_fields) | **GET** /integrations/autotask/{UUID}/contracts/fields | Retrieve Autotask Contract Fields +*ProvidersApi* | [**autotask_retrieve_mappings**](docs/ProvidersApi.md#autotask_retrieve_mappings) | **GET** /integrations/autotask/{UUID}/mappings | Retrieve Autotask mappings +*ProvidersApi* | [**autotask_retrieve_services**](docs/ProvidersApi.md#autotask_retrieve_services) | **GET** /integrations/autotask/{UUID}/contracts/services | Retrieve Autotask Contract Services +*ProvidersApi* | [**autotask_retrieve_settings**](docs/ProvidersApi.md#autotask_retrieve_settings) | **GET** /integrations/autotask/{UUID}/settings | Retrieve Autotask Integration settings +*ProvidersApi* | [**autotask_update_alert_configuration**](docs/ProvidersApi.md#autotask_update_alert_configuration) | **PUT** /providers/{provider_id}/integrations/autotask/alerts/{alert_UUID}/configuration | Update an Autotask ticketing alert's configuration +*ProvidersApi* | [**autotask_update_configuration**](docs/ProvidersApi.md#autotask_update_configuration) | **PATCH** /integrations/autotask/{UUID} | Update Autotask Integration configuration +*ProvidersApi* | [**connectwise_create_configuration**](docs/ProvidersApi.md#connectwise_create_configuration) | **POST** /providers/{provider_id}/integrations/connectwise | Creates a new ConnectWise integration for the provider +*ProvidersApi* | [**connectwise_delete_configuration**](docs/ProvidersApi.md#connectwise_delete_configuration) | **DELETE** /integrations/connectwise/{UUID} | Delete ConnectWise Integration +*ProvidersApi* | [**connectwise_get_configuration**](docs/ProvidersApi.md#connectwise_get_configuration) | **GET** /integrations/connectwise/{UUID} | Retrieve ConnectWise Integration Configuration +*ProvidersApi* | [**connectwise_patch_mappings**](docs/ProvidersApi.md#connectwise_patch_mappings) | **PATCH** /integrations/connectwise/{UUID}/mappings | Create, edit, and/or delete ConnectWise Mappings +*ProvidersApi* | [**connectwise_patch_settings**](docs/ProvidersApi.md#connectwise_patch_settings) | **PATCH** /integrations/connectwise/{UUID}/settings | Create, edit, and/or delete ConnectWise Integration settings +*ProvidersApi* | [**connectwise_retrieve_additions**](docs/ProvidersApi.md#connectwise_retrieve_additions) | **GET** /integrations/connectwise/{UUID}/agreements/{agreement_ID}/additions | Retrieve ConnectWise Additions +*ProvidersApi* | [**connectwise_retrieve_agreements**](docs/ProvidersApi.md#connectwise_retrieve_agreements) | **GET** /integrations/connectwise/{UUID}/agreements | Retrieve ConnectWise Agreements +*ProvidersApi* | [**connectwise_retrieve_all_alert_configuration_options**](docs/ProvidersApi.md#connectwise_retrieve_all_alert_configuration_options) | **GET** /providers/{provider_id}/integrations/connectwise/alerts/configuration/options | Get all ConnectWise ticketing alert configuration options for a provider +*ProvidersApi* | [**connectwise_retrieve_all_alert_configurations**](docs/ProvidersApi.md#connectwise_retrieve_all_alert_configurations) | **GET** /providers/{provider_id}/integrations/connectwise/alerts/configuration | Get all ConnectWise ticketing alert configurations for a provider +*ProvidersApi* | [**connectwise_retrieve_companies**](docs/ProvidersApi.md#connectwise_retrieve_companies) | **GET** /integrations/connectwise/{UUID}/companies | Retrieve ConnectWise Companies +*ProvidersApi* | [**connectwise_retrieve_company_types**](docs/ProvidersApi.md#connectwise_retrieve_company_types) | **GET** /integrations/connectwise/{UUID}/companytypes | Retrieve ConnectWise Company Types +*ProvidersApi* | [**connectwise_retrieve_mappings**](docs/ProvidersApi.md#connectwise_retrieve_mappings) | **GET** /integrations/connectwise/{UUID}/mappings | Retrieve ConnectWise mappings +*ProvidersApi* | [**connectwise_retrieve_settings**](docs/ProvidersApi.md#connectwise_retrieve_settings) | **GET** /integrations/connectwise/{UUID}/settings | Retrieve ConnectWise Integration settings +*ProvidersApi* | [**connectwise_update_alert_configuration**](docs/ProvidersApi.md#connectwise_update_alert_configuration) | **PUT** /providers/{provider_id}/integrations/connectwise/alerts/{alert_UUID}/configuration | Update a ConnectWise ticketing alert's configuration +*ProvidersApi* | [**connectwise_update_configuration**](docs/ProvidersApi.md#connectwise_update_configuration) | **PATCH** /integrations/connectwise/{UUID} | Update ConnectWise Integration configuration +*ProvidersApi* | [**mtp_integration_retrieve_alerts**](docs/ProvidersApi.md#mtp_integration_retrieve_alerts) | **GET** /providers/{provider_id}/integrations/ticketing/alerts | Get all ticketing alerts available for a provider's ticketing integration. +*ProvidersApi* | [**mtp_integration_retrieve_sync_errors**](docs/ProvidersApi.md#mtp_integration_retrieve_sync_errors) | **GET** /integrations/{integration_type}/{UUID}/errors | Retrieve Recent Integration Sync Errors +*ProvidersApi* | [**provider_organizations_update_org**](docs/ProvidersApi.md#provider_organizations_update_org) | **PUT** /providers/{provider_id}/organizations/{id} | Update Provider Organization +*ProvidersApi* | [**providers_get_provider**](docs/ProvidersApi.md#providers_get_provider) | **GET** /providers/{provider_id} | Retrieve Provider *ProvidersApi* | [**providers_list_administrators**](docs/ProvidersApi.md#providers_list_administrators) | **GET** /providers/{provider_id}/administrators | List Provider Administrators +*ProvidersApi* | [**providers_list_organizations**](docs/ProvidersApi.md#providers_list_organizations) | **GET** /providers/{provider_id}/organizations | List Provider Organizations *ProvidersApi* | [**providers_post_admins**](docs/ProvidersApi.md#providers_post_admins) | **POST** /providers/{provider_id}/administrators | Create a new Provider Administrator +*ProvidersApi* | [**providers_remove_administrator**](docs/ProvidersApi.md#providers_remove_administrator) | **DELETE** /providers/{provider_id}/administrators/{id} | Delete Provider Administrator +*ProvidersApi* | [**providers_retrieve_integrations**](docs/ProvidersApi.md#providers_retrieve_integrations) | **GET** /providers/{provider_id}/integrations | Retrieve Integrations for Provider +*ProvidersApi* | [**providers_retrieve_invoice**](docs/ProvidersApi.md#providers_retrieve_invoice) | **GET** /providers/{provider_id}/invoices/{ID} | Download a provider's invoice. +*ProvidersApi* | [**providers_retrieve_invoices**](docs/ProvidersApi.md#providers_retrieve_invoices) | **GET** /providers/{provider_id}/invoices | List a provider's invoices. *RADIUSServersApi* | [**graph_radius_server_associations_list**](docs/RADIUSServersApi.md#graph_radius_server_associations_list) | **GET** /radiusservers/{radiusserver_id}/associations | List the associations of a RADIUS Server *RADIUSServersApi* | [**graph_radius_server_associations_post**](docs/RADIUSServersApi.md#graph_radius_server_associations_post) | **POST** /radiusservers/{radiusserver_id}/associations | Manage the associations of a RADIUS Server *RADIUSServersApi* | [**graph_radius_server_traverse_user**](docs/RADIUSServersApi.md#graph_radius_server_traverse_user) | **GET** /radiusservers/{radiusserver_id}/users | List the Users bound to a RADIUS Server *RADIUSServersApi* | [**graph_radius_server_traverse_user_group**](docs/RADIUSServersApi.md#graph_radius_server_traverse_user_group) | **GET** /radiusservers/{radiusserver_id}/usergroups | List the User Groups bound to a RADIUS Server +*SCIMImportApi* | [**import_users**](docs/SCIMImportApi.md#import_users) | **GET** /applications/{application_id}/import/users | Get a list of users to import from an Application IdM service provider *SambaDomainsApi* | [**ldapservers_samba_domains_delete**](docs/SambaDomainsApi.md#ldapservers_samba_domains_delete) | **DELETE** /ldapservers/{ldapserver_id}/sambadomains/{id} | Delete Samba Domain *SambaDomainsApi* | [**ldapservers_samba_domains_get**](docs/SambaDomainsApi.md#ldapservers_samba_domains_get) | **GET** /ldapservers/{ldapserver_id}/sambadomains/{id} | Get Samba Domain *SambaDomainsApi* | [**ldapservers_samba_domains_list**](docs/SambaDomainsApi.md#ldapservers_samba_domains_list) | **GET** /ldapservers/{ldapserver_id}/sambadomains | List Samba Domains *SambaDomainsApi* | [**ldapservers_samba_domains_post**](docs/SambaDomainsApi.md#ldapservers_samba_domains_post) | **POST** /ldapservers/{ldapserver_id}/sambadomains | Create Samba Domain *SambaDomainsApi* | [**ldapservers_samba_domains_put**](docs/SambaDomainsApi.md#ldapservers_samba_domains_put) | **PUT** /ldapservers/{ldapserver_id}/sambadomains/{id} | Update Samba Domain +*SoftwareAppsApi* | [**graph_softwareapps_associations_list**](docs/SoftwareAppsApi.md#graph_softwareapps_associations_list) | **GET** /softwareapps/{software_app_id}/associations | List the associations of a Software Application +*SoftwareAppsApi* | [**graph_softwareapps_associations_post**](docs/SoftwareAppsApi.md#graph_softwareapps_associations_post) | **POST** /softwareapps/{software_app_id}/associations | Manage the associations of a software application. +*SoftwareAppsApi* | [**graph_softwareapps_traverse_system**](docs/SoftwareAppsApi.md#graph_softwareapps_traverse_system) | **GET** /softwareapps/{software_app_id}/systems | List the Systems bound to a Software App. +*SoftwareAppsApi* | [**graph_softwareapps_traverse_system_group**](docs/SoftwareAppsApi.md#graph_softwareapps_traverse_system_group) | **GET** /softwareapps/{software_app_id}/systemgroups | List the System Groups bound to a Software App. +*SoftwareAppsApi* | [**software_app_statuses_list**](docs/SoftwareAppsApi.md#software_app_statuses_list) | **GET** /softwareapps/{software_app_id}/statuses | Get the status of the provided Software Application +*SoftwareAppsApi* | [**software_apps_delete**](docs/SoftwareAppsApi.md#software_apps_delete) | **DELETE** /softwareapps/{id} | Delete a configured Software Application +*SoftwareAppsApi* | [**software_apps_get**](docs/SoftwareAppsApi.md#software_apps_get) | **GET** /softwareapps/{id} | Retrieve a configured Software Application. +*SoftwareAppsApi* | [**software_apps_list**](docs/SoftwareAppsApi.md#software_apps_list) | **GET** /softwareapps | Get all configured Software Applications. +*SoftwareAppsApi* | [**software_apps_post**](docs/SoftwareAppsApi.md#software_apps_post) | **POST** /softwareapps | Create a Software Application that will be managed by JumpCloud. +*SoftwareAppsApi* | [**software_apps_reclaim_licenses**](docs/SoftwareAppsApi.md#software_apps_reclaim_licenses) | **POST** /softwareapps/{software_app_id}/reclaim-licenses | Reclaim Licenses for a Software Application. +*SoftwareAppsApi* | [**software_apps_retry_installation**](docs/SoftwareAppsApi.md#software_apps_retry_installation) | **POST** /softwareapps/{software_app_id}/retry-installation | Retry Installation for a Software Application +*SoftwareAppsApi* | [**software_apps_update**](docs/SoftwareAppsApi.md#software_apps_update) | **PUT** /softwareapps/{id} | Update a Software Application Configuration. +*SubscriptionsApi* | [**subscriptions_get**](docs/SubscriptionsApi.md#subscriptions_get) | **GET** /subscriptions | Lists all the Pricing & Packaging Subscriptions *SystemGroupAssociationsApi* | [**graph_system_group_associations_list**](docs/SystemGroupAssociationsApi.md#graph_system_group_associations_list) | **GET** /systemgroups/{group_id}/associations | List the associations of a System Group *SystemGroupAssociationsApi* | [**graph_system_group_associations_post**](docs/SystemGroupAssociationsApi.md#graph_system_group_associations_post) | **POST** /systemgroups/{group_id}/associations | Manage the associations of a System Group *SystemGroupAssociationsApi* | [**graph_system_group_traverse_command**](docs/SystemGroupAssociationsApi.md#graph_system_group_traverse_command) | **GET** /systemgroups/{group_id}/commands | List the Commands bound to a System Group *SystemGroupAssociationsApi* | [**graph_system_group_traverse_policy**](docs/SystemGroupAssociationsApi.md#graph_system_group_traverse_policy) | **GET** /systemgroups/{group_id}/policies | List the Policies bound to a System Group +*SystemGroupAssociationsApi* | [**graph_system_group_traverse_policy_group**](docs/SystemGroupAssociationsApi.md#graph_system_group_traverse_policy_group) | **GET** /systemgroups/{group_id}/policygroups | List the Policy Groups bound to a System Group *SystemGroupAssociationsApi* | [**graph_system_group_traverse_user**](docs/SystemGroupAssociationsApi.md#graph_system_group_traverse_user) | **GET** /systemgroups/{group_id}/users | List the Users bound to a System Group *SystemGroupAssociationsApi* | [**graph_system_group_traverse_user_group**](docs/SystemGroupAssociationsApi.md#graph_system_group_traverse_user_group) | **GET** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group -*SystemGroupMembersMembershipApi* | [**graph_system_group_member_of**](docs/SystemGroupMembersMembershipApi.md#graph_system_group_member_of) | **GET** /systemgroups/{group_id}/memberof | List the System Group's parents *SystemGroupMembersMembershipApi* | [**graph_system_group_members_list**](docs/SystemGroupMembersMembershipApi.md#graph_system_group_members_list) | **GET** /systemgroups/{group_id}/members | List the members of a System Group *SystemGroupMembersMembershipApi* | [**graph_system_group_members_post**](docs/SystemGroupMembersMembershipApi.md#graph_system_group_members_post) | **POST** /systemgroups/{group_id}/members | Manage the members of a System Group -*SystemGroupMembersMembershipApi* | [**graph_system_group_membership**](docs/SystemGroupMembersMembershipApi.md#graph_system_group_membership) | **GET** /systemgroups/{group_id}/membership | List the System Group's membership +*SystemGroupMembersMembershipApi* | [**graph_system_group_membership**](docs/SystemGroupMembersMembershipApi.md#graph_system_group_membership) | **GET** /systemgroups/{group_id}/membership | List the System Group's membership *SystemGroupsApi* | [**graph_system_group_associations_list**](docs/SystemGroupsApi.md#graph_system_group_associations_list) | **GET** /systemgroups/{group_id}/associations | List the associations of a System Group *SystemGroupsApi* | [**graph_system_group_associations_post**](docs/SystemGroupsApi.md#graph_system_group_associations_post) | **POST** /systemgroups/{group_id}/associations | Manage the associations of a System Group -*SystemGroupsApi* | [**graph_system_group_member_of**](docs/SystemGroupsApi.md#graph_system_group_member_of) | **GET** /systemgroups/{group_id}/memberof | List the System Group's parents *SystemGroupsApi* | [**graph_system_group_members_list**](docs/SystemGroupsApi.md#graph_system_group_members_list) | **GET** /systemgroups/{group_id}/members | List the members of a System Group *SystemGroupsApi* | [**graph_system_group_members_post**](docs/SystemGroupsApi.md#graph_system_group_members_post) | **POST** /systemgroups/{group_id}/members | Manage the members of a System Group -*SystemGroupsApi* | [**graph_system_group_membership**](docs/SystemGroupsApi.md#graph_system_group_membership) | **GET** /systemgroups/{group_id}/membership | List the System Group's membership +*SystemGroupsApi* | [**graph_system_group_membership**](docs/SystemGroupsApi.md#graph_system_group_membership) | **GET** /systemgroups/{group_id}/membership | List the System Group's membership *SystemGroupsApi* | [**graph_system_group_traverse_policy**](docs/SystemGroupsApi.md#graph_system_group_traverse_policy) | **GET** /systemgroups/{group_id}/policies | List the Policies bound to a System Group +*SystemGroupsApi* | [**graph_system_group_traverse_policy_group**](docs/SystemGroupsApi.md#graph_system_group_traverse_policy_group) | **GET** /systemgroups/{group_id}/policygroups | List the Policy Groups bound to a System Group *SystemGroupsApi* | [**graph_system_group_traverse_user**](docs/SystemGroupsApi.md#graph_system_group_traverse_user) | **GET** /systemgroups/{group_id}/users | List the Users bound to a System Group *SystemGroupsApi* | [**graph_system_group_traverse_user_group**](docs/SystemGroupsApi.md#graph_system_group_traverse_user_group) | **GET** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group *SystemGroupsApi* | [**groups_system_delete**](docs/SystemGroupsApi.md#groups_system_delete) | **DELETE** /systemgroups/{id} | Delete a System Group *SystemGroupsApi* | [**groups_system_get**](docs/SystemGroupsApi.md#groups_system_get) | **GET** /systemgroups/{id} | View an individual System Group details *SystemGroupsApi* | [**groups_system_list**](docs/SystemGroupsApi.md#groups_system_list) | **GET** /systemgroups | List all System Groups -*SystemGroupsApi* | [**groups_system_patch**](docs/SystemGroupsApi.md#groups_system_patch) | **PATCH** /systemgroups/{id} | Partial update a System Group *SystemGroupsApi* | [**groups_system_post**](docs/SystemGroupsApi.md#groups_system_post) | **POST** /systemgroups | Create a new System Group *SystemGroupsApi* | [**groups_system_put**](docs/SystemGroupsApi.md#groups_system_put) | **PUT** /systemgroups/{id} | Update a System Group +*SystemInsightsApi* | [**systeminsights_list_alf**](docs/SystemInsightsApi.md#systeminsights_list_alf) | **GET** /systeminsights/alf | List System Insights ALF +*SystemInsightsApi* | [**systeminsights_list_alf_exceptions**](docs/SystemInsightsApi.md#systeminsights_list_alf_exceptions) | **GET** /systeminsights/alf_exceptions | List System Insights ALF Exceptions +*SystemInsightsApi* | [**systeminsights_list_alf_explicit_auths**](docs/SystemInsightsApi.md#systeminsights_list_alf_explicit_auths) | **GET** /systeminsights/alf_explicit_auths | List System Insights ALF Explicit Authentications +*SystemInsightsApi* | [**systeminsights_list_appcompat_shims**](docs/SystemInsightsApi.md#systeminsights_list_appcompat_shims) | **GET** /systeminsights/appcompat_shims | List System Insights Application Compatibility Shims *SystemInsightsApi* | [**systeminsights_list_apps**](docs/SystemInsightsApi.md#systeminsights_list_apps) | **GET** /systeminsights/apps | List System Insights Apps +*SystemInsightsApi* | [**systeminsights_list_authorized_keys**](docs/SystemInsightsApi.md#systeminsights_list_authorized_keys) | **GET** /systeminsights/authorized_keys | List System Insights Authorized Keys +*SystemInsightsApi* | [**systeminsights_list_azure_instance_metadata**](docs/SystemInsightsApi.md#systeminsights_list_azure_instance_metadata) | **GET** /systeminsights/azure_instance_metadata | List System Insights Azure Instance Metadata +*SystemInsightsApi* | [**systeminsights_list_azure_instance_tags**](docs/SystemInsightsApi.md#systeminsights_list_azure_instance_tags) | **GET** /systeminsights/azure_instance_tags | List System Insights Azure Instance Tags *SystemInsightsApi* | [**systeminsights_list_battery**](docs/SystemInsightsApi.md#systeminsights_list_battery) | **GET** /systeminsights/battery | List System Insights Battery *SystemInsightsApi* | [**systeminsights_list_bitlocker_info**](docs/SystemInsightsApi.md#systeminsights_list_bitlocker_info) | **GET** /systeminsights/bitlocker_info | List System Insights Bitlocker Info *SystemInsightsApi* | [**systeminsights_list_browser_plugins**](docs/SystemInsightsApi.md#systeminsights_list_browser_plugins) | **GET** /systeminsights/browser_plugins | List System Insights Browser Plugins +*SystemInsightsApi* | [**systeminsights_list_certificates**](docs/SystemInsightsApi.md#systeminsights_list_certificates) | **GET** /systeminsights/certificates | List System Insights Certificates +*SystemInsightsApi* | [**systeminsights_list_chassis_info**](docs/SystemInsightsApi.md#systeminsights_list_chassis_info) | **GET** /systeminsights/chassis_info | List System Insights Chassis Info *SystemInsightsApi* | [**systeminsights_list_chrome_extensions**](docs/SystemInsightsApi.md#systeminsights_list_chrome_extensions) | **GET** /systeminsights/chrome_extensions | List System Insights Chrome Extensions +*SystemInsightsApi* | [**systeminsights_list_connectivity**](docs/SystemInsightsApi.md#systeminsights_list_connectivity) | **GET** /systeminsights/connectivity | List System Insights Connectivity *SystemInsightsApi* | [**systeminsights_list_crashes**](docs/SystemInsightsApi.md#systeminsights_list_crashes) | **GET** /systeminsights/crashes | List System Insights Crashes +*SystemInsightsApi* | [**systeminsights_list_cups_destinations**](docs/SystemInsightsApi.md#systeminsights_list_cups_destinations) | **GET** /systeminsights/cups_destinations | List System Insights CUPS Destinations *SystemInsightsApi* | [**systeminsights_list_disk_encryption**](docs/SystemInsightsApi.md#systeminsights_list_disk_encryption) | **GET** /systeminsights/disk_encryption | List System Insights Disk Encryption *SystemInsightsApi* | [**systeminsights_list_disk_info**](docs/SystemInsightsApi.md#systeminsights_list_disk_info) | **GET** /systeminsights/disk_info | List System Insights Disk Info +*SystemInsightsApi* | [**systeminsights_list_dns_resolvers**](docs/SystemInsightsApi.md#systeminsights_list_dns_resolvers) | **GET** /systeminsights/dns_resolvers | List System Insights DNS Resolvers *SystemInsightsApi* | [**systeminsights_list_etc_hosts**](docs/SystemInsightsApi.md#systeminsights_list_etc_hosts) | **GET** /systeminsights/etc_hosts | List System Insights Etc Hosts *SystemInsightsApi* | [**systeminsights_list_firefox_addons**](docs/SystemInsightsApi.md#systeminsights_list_firefox_addons) | **GET** /systeminsights/firefox_addons | List System Insights Firefox Addons *SystemInsightsApi* | [**systeminsights_list_groups**](docs/SystemInsightsApi.md#systeminsights_list_groups) | **GET** /systeminsights/groups | List System Insights Groups *SystemInsightsApi* | [**systeminsights_list_ie_extensions**](docs/SystemInsightsApi.md#systeminsights_list_ie_extensions) | **GET** /systeminsights/ie_extensions | List System Insights IE Extensions *SystemInsightsApi* | [**systeminsights_list_interface_addresses**](docs/SystemInsightsApi.md#systeminsights_list_interface_addresses) | **GET** /systeminsights/interface_addresses | List System Insights Interface Addresses +*SystemInsightsApi* | [**systeminsights_list_interface_details**](docs/SystemInsightsApi.md#systeminsights_list_interface_details) | **GET** /systeminsights/interface_details | List System Insights Interface Details *SystemInsightsApi* | [**systeminsights_list_kernel_info**](docs/SystemInsightsApi.md#systeminsights_list_kernel_info) | **GET** /systeminsights/kernel_info | List System Insights Kernel Info *SystemInsightsApi* | [**systeminsights_list_launchd**](docs/SystemInsightsApi.md#systeminsights_list_launchd) | **GET** /systeminsights/launchd | List System Insights Launchd +*SystemInsightsApi* | [**systeminsights_list_linux_packages**](docs/SystemInsightsApi.md#systeminsights_list_linux_packages) | **GET** /systeminsights/linux_packages | List System Insights Linux Packages *SystemInsightsApi* | [**systeminsights_list_logged_in_users**](docs/SystemInsightsApi.md#systeminsights_list_logged_in_users) | **GET** /systeminsights/logged_in_users | List System Insights Logged-In Users *SystemInsightsApi* | [**systeminsights_list_logical_drives**](docs/SystemInsightsApi.md#systeminsights_list_logical_drives) | **GET** /systeminsights/logical_drives | List System Insights Logical Drives +*SystemInsightsApi* | [**systeminsights_list_managed_policies**](docs/SystemInsightsApi.md#systeminsights_list_managed_policies) | **GET** /systeminsights/managed_policies | List System Insights Managed Policies *SystemInsightsApi* | [**systeminsights_list_mounts**](docs/SystemInsightsApi.md#systeminsights_list_mounts) | **GET** /systeminsights/mounts | List System Insights Mounts *SystemInsightsApi* | [**systeminsights_list_os_version**](docs/SystemInsightsApi.md#systeminsights_list_os_version) | **GET** /systeminsights/os_version | List System Insights OS Version *SystemInsightsApi* | [**systeminsights_list_patches**](docs/SystemInsightsApi.md#systeminsights_list_patches) | **GET** /systeminsights/patches | List System Insights Patches *SystemInsightsApi* | [**systeminsights_list_programs**](docs/SystemInsightsApi.md#systeminsights_list_programs) | **GET** /systeminsights/programs | List System Insights Programs +*SystemInsightsApi* | [**systeminsights_list_python_packages**](docs/SystemInsightsApi.md#systeminsights_list_python_packages) | **GET** /systeminsights/python_packages | List System Insights Python Packages *SystemInsightsApi* | [**systeminsights_list_safari_extensions**](docs/SystemInsightsApi.md#systeminsights_list_safari_extensions) | **GET** /systeminsights/safari_extensions | List System Insights Safari Extensions -*SystemInsightsApi* | [**systeminsights_list_system_apps**](docs/SystemInsightsApi.md#systeminsights_list_system_apps) | **GET** /systeminsights/{system_id}/apps | List System Insights System Apps -*SystemInsightsApi* | [**systeminsights_list_system_bitlocker_info**](docs/SystemInsightsApi.md#systeminsights_list_system_bitlocker_info) | **GET** /systeminsights/{system_id}/bitlocker_info | List System Insights System Bitlocker Info -*SystemInsightsApi* | [**systeminsights_list_system_browser_plugins**](docs/SystemInsightsApi.md#systeminsights_list_system_browser_plugins) | **GET** /systeminsights/{system_id}/browser_plugins | List System Insights System Browser Plugins -*SystemInsightsApi* | [**systeminsights_list_system_chrome_extensions**](docs/SystemInsightsApi.md#systeminsights_list_system_chrome_extensions) | **GET** /systeminsights/{system_id}/chrome_extensions | List System Insights System Chrome Extensions +*SystemInsightsApi* | [**systeminsights_list_scheduled_tasks**](docs/SystemInsightsApi.md#systeminsights_list_scheduled_tasks) | **GET** /systeminsights/scheduled_tasks | List System Insights Scheduled Tasks +*SystemInsightsApi* | [**systeminsights_list_secureboot**](docs/SystemInsightsApi.md#systeminsights_list_secureboot) | **GET** /systeminsights/secureboot | List System Insights Secure Boot +*SystemInsightsApi* | [**systeminsights_list_services**](docs/SystemInsightsApi.md#systeminsights_list_services) | **GET** /systeminsights/services | List System Insights Services +*SystemInsightsApi* | [**systeminsights_list_shadow**](docs/SystemInsightsApi.md#systeminsights_list_shadow) | **GET** /systeminsights/shadow | LIst System Insights Shadow +*SystemInsightsApi* | [**systeminsights_list_shared_folders**](docs/SystemInsightsApi.md#systeminsights_list_shared_folders) | **GET** /systeminsights/shared_folders | List System Insights Shared Folders +*SystemInsightsApi* | [**systeminsights_list_shared_resources**](docs/SystemInsightsApi.md#systeminsights_list_shared_resources) | **GET** /systeminsights/shared_resources | List System Insights Shared Resources +*SystemInsightsApi* | [**systeminsights_list_sharing_preferences**](docs/SystemInsightsApi.md#systeminsights_list_sharing_preferences) | **GET** /systeminsights/sharing_preferences | List System Insights Sharing Preferences +*SystemInsightsApi* | [**systeminsights_list_sip_config**](docs/SystemInsightsApi.md#systeminsights_list_sip_config) | **GET** /systeminsights/sip_config | List System Insights SIP Config +*SystemInsightsApi* | [**systeminsights_list_startup_items**](docs/SystemInsightsApi.md#systeminsights_list_startup_items) | **GET** /systeminsights/startup_items | List System Insights Startup Items *SystemInsightsApi* | [**systeminsights_list_system_controls**](docs/SystemInsightsApi.md#systeminsights_list_system_controls) | **GET** /systeminsights/system_controls | List System Insights System Control -*SystemInsightsApi* | [**systeminsights_list_system_disk_encryption**](docs/SystemInsightsApi.md#systeminsights_list_system_disk_encryption) | **GET** /systeminsights/{system_id}/disk_encryption | List System Insights System Disk Encryption -*SystemInsightsApi* | [**systeminsights_list_system_disk_info**](docs/SystemInsightsApi.md#systeminsights_list_system_disk_info) | **GET** /systeminsights/{system_id}/disk_info | List System Insights System Disk Info -*SystemInsightsApi* | [**systeminsights_list_system_etc_hosts**](docs/SystemInsightsApi.md#systeminsights_list_system_etc_hosts) | **GET** /systeminsights/{system_id}/etc_hosts | List System Insights System Etc Hosts -*SystemInsightsApi* | [**systeminsights_list_system_firefox_addons**](docs/SystemInsightsApi.md#systeminsights_list_system_firefox_addons) | **GET** /systeminsights/{system_id}/firefox_addons | List System Insights System Firefox Addons -*SystemInsightsApi* | [**systeminsights_list_system_groups**](docs/SystemInsightsApi.md#systeminsights_list_system_groups) | **GET** /systeminsights/{system_id}/groups | List System Insights System Groups *SystemInsightsApi* | [**systeminsights_list_system_info**](docs/SystemInsightsApi.md#systeminsights_list_system_info) | **GET** /systeminsights/system_info | List System Insights System Info -*SystemInsightsApi* | [**systeminsights_list_system_interface_addresses**](docs/SystemInsightsApi.md#systeminsights_list_system_interface_addresses) | **GET** /systeminsights/{system_id}/interface_addresses | List System Insights System Interface Addresses -*SystemInsightsApi* | [**systeminsights_list_system_kernel_info**](docs/SystemInsightsApi.md#systeminsights_list_system_kernel_info) | **GET** /systeminsights/{system_id}/kernel_info | List System Insights System Kernel Info -*SystemInsightsApi* | [**systeminsights_list_system_logical_drives**](docs/SystemInsightsApi.md#systeminsights_list_system_logical_drives) | **GET** /systeminsights/{system_id}/logical_drives | List System Insights System Logical Drives -*SystemInsightsApi* | [**systeminsights_list_system_mounts**](docs/SystemInsightsApi.md#systeminsights_list_system_mounts) | **GET** /systeminsights/{system_id}/mounts | List System Insights System Mounts -*SystemInsightsApi* | [**systeminsights_list_system_os_version**](docs/SystemInsightsApi.md#systeminsights_list_system_os_version) | **GET** /systeminsights/{system_id}/os_version | List System Insights System OS Version -*SystemInsightsApi* | [**systeminsights_list_system_patches**](docs/SystemInsightsApi.md#systeminsights_list_system_patches) | **GET** /systeminsights/{system_id}/patches | List System Insights System Patches -*SystemInsightsApi* | [**systeminsights_list_system_programs**](docs/SystemInsightsApi.md#systeminsights_list_system_programs) | **GET** /systeminsights/{system_id}/programs | List System Insights System Programs -*SystemInsightsApi* | [**systeminsights_list_system_safari_extensions**](docs/SystemInsightsApi.md#systeminsights_list_system_safari_extensions) | **GET** /systeminsights/{system_id}/safari_extensions | List System Insights System Safari Extensions -*SystemInsightsApi* | [**systeminsights_list_system_system_controls**](docs/SystemInsightsApi.md#systeminsights_list_system_system_controls) | **GET** /systeminsights/{system_id}/system_controls | List System Insights System System Controls -*SystemInsightsApi* | [**systeminsights_list_system_system_info**](docs/SystemInsightsApi.md#systeminsights_list_system_system_info) | **GET** /systeminsights/{system_id}/system_info | List System Insights System System Info -*SystemInsightsApi* | [**systeminsights_list_system_uptime**](docs/SystemInsightsApi.md#systeminsights_list_system_uptime) | **GET** /systeminsights/{system_id}/uptime | List System Insights System Uptime -*SystemInsightsApi* | [**systeminsights_list_system_users**](docs/SystemInsightsApi.md#systeminsights_list_system_users) | **GET** /systeminsights/{system_id}/users | List System Insights System Users +*SystemInsightsApi* | [**systeminsights_list_tpm_info**](docs/SystemInsightsApi.md#systeminsights_list_tpm_info) | **GET** /systeminsights/tpm_info | List System Insights TPM Info *SystemInsightsApi* | [**systeminsights_list_uptime**](docs/SystemInsightsApi.md#systeminsights_list_uptime) | **GET** /systeminsights/uptime | List System Insights Uptime *SystemInsightsApi* | [**systeminsights_list_usb_devices**](docs/SystemInsightsApi.md#systeminsights_list_usb_devices) | **GET** /systeminsights/usb_devices | List System Insights USB Devices *SystemInsightsApi* | [**systeminsights_list_user_groups**](docs/SystemInsightsApi.md#systeminsights_list_user_groups) | **GET** /systeminsights/user_groups | List System Insights User Groups +*SystemInsightsApi* | [**systeminsights_list_user_ssh_keys**](docs/SystemInsightsApi.md#systeminsights_list_user_ssh_keys) | **GET** /systeminsights/user_ssh_keys | List System Insights User SSH Keys +*SystemInsightsApi* | [**systeminsights_list_userassist**](docs/SystemInsightsApi.md#systeminsights_list_userassist) | **GET** /systeminsights/userassist | List System Insights User Assist *SystemInsightsApi* | [**systeminsights_list_users**](docs/SystemInsightsApi.md#systeminsights_list_users) | **GET** /systeminsights/users | List System Insights Users -*SystemInsightsApi* | [**systeminsights_list_windows_crashes**](docs/SystemInsightsApi.md#systeminsights_list_windows_crashes) | **GET** /systeminsights/windows_crashes | List System Insights Windows Crashes +*SystemInsightsApi* | [**systeminsights_list_wifi_networks**](docs/SystemInsightsApi.md#systeminsights_list_wifi_networks) | **GET** /systeminsights/wifi_networks | List System Insights WiFi Networks +*SystemInsightsApi* | [**systeminsights_list_wifi_status**](docs/SystemInsightsApi.md#systeminsights_list_wifi_status) | **GET** /systeminsights/wifi_status | List System Insights WiFi Status +*SystemInsightsApi* | [**systeminsights_list_windows_security_center**](docs/SystemInsightsApi.md#systeminsights_list_windows_security_center) | **GET** /systeminsights/windows_security_center | List System Insights Windows Security Center +*SystemInsightsApi* | [**systeminsights_list_windows_security_products**](docs/SystemInsightsApi.md#systeminsights_list_windows_security_products) | **GET** /systeminsights/windows_security_products | List System Insights Windows Security Products *SystemsApi* | [**graph_system_associations_list**](docs/SystemsApi.md#graph_system_associations_list) | **GET** /systems/{system_id}/associations | List the associations of a System *SystemsApi* | [**graph_system_associations_post**](docs/SystemsApi.md#graph_system_associations_post) | **POST** /systems/{system_id}/associations | Manage associations of a System *SystemsApi* | [**graph_system_member_of**](docs/SystemsApi.md#graph_system_member_of) | **GET** /systems/{system_id}/memberof | List the parent Groups of a System *SystemsApi* | [**graph_system_traverse_command**](docs/SystemsApi.md#graph_system_traverse_command) | **GET** /systems/{system_id}/commands | List the Commands bound to a System *SystemsApi* | [**graph_system_traverse_policy**](docs/SystemsApi.md#graph_system_traverse_policy) | **GET** /systems/{system_id}/policies | List the Policies bound to a System +*SystemsApi* | [**graph_system_traverse_policy_group**](docs/SystemsApi.md#graph_system_traverse_policy_group) | **GET** /systems/{system_id}/policygroups | List the Policy Groups bound to a System *SystemsApi* | [**graph_system_traverse_user**](docs/SystemsApi.md#graph_system_traverse_user) | **GET** /systems/{system_id}/users | List the Users bound to a System *SystemsApi* | [**graph_system_traverse_user_group**](docs/SystemsApi.md#graph_system_traverse_user_group) | **GET** /systems/{system_id}/usergroups | List the User Groups bound to a System *SystemsApi* | [**systems_get_fde_key**](docs/SystemsApi.md#systems_get_fde_key) | **GET** /systems/{system_id}/fdekey | Get System FDE Key +*SystemsApi* | [**systems_list_software_apps_with_statuses**](docs/SystemsApi.md#systems_list_software_apps_with_statuses) | **GET** /systems/{system_id}/softwareappstatuses | List the associated Software Application Statuses of a System *UserGroupAssociationsApi* | [**graph_user_group_associations_list**](docs/UserGroupAssociationsApi.md#graph_user_group_associations_list) | **GET** /usergroups/{group_id}/associations | List the associations of a User Group. *UserGroupAssociationsApi* | [**graph_user_group_associations_post**](docs/UserGroupAssociationsApi.md#graph_user_group_associations_post) | **POST** /usergroups/{group_id}/associations | Manage the associations of a User Group *UserGroupAssociationsApi* | [**graph_user_group_traverse_active_directory**](docs/UserGroupAssociationsApi.md#graph_user_group_traverse_active_directory) | **GET** /usergroups/{group_id}/activedirectories | List the Active Directories bound to a User Group @@ -342,16 +723,14 @@ Class | Method | HTTP request | Description *UserGroupAssociationsApi* | [**graph_user_group_traverse_radius_server**](docs/UserGroupAssociationsApi.md#graph_user_group_traverse_radius_server) | **GET** /usergroups/{group_id}/radiusservers | List the RADIUS Servers bound to a User Group *UserGroupAssociationsApi* | [**graph_user_group_traverse_system**](docs/UserGroupAssociationsApi.md#graph_user_group_traverse_system) | **GET** /usergroups/{group_id}/systems | List the Systems bound to a User Group *UserGroupAssociationsApi* | [**graph_user_group_traverse_system_group**](docs/UserGroupAssociationsApi.md#graph_user_group_traverse_system_group) | **GET** /usergroups/{group_id}/systemgroups | List the System Groups bound to User Groups -*UserGroupMembersMembershipApi* | [**graph_user_group_member_of**](docs/UserGroupMembersMembershipApi.md#graph_user_group_member_of) | **GET** /usergroups/{group_id}/memberof | List the User Group's parents *UserGroupMembersMembershipApi* | [**graph_user_group_members_list**](docs/UserGroupMembersMembershipApi.md#graph_user_group_members_list) | **GET** /usergroups/{group_id}/members | List the members of a User Group *UserGroupMembersMembershipApi* | [**graph_user_group_members_post**](docs/UserGroupMembersMembershipApi.md#graph_user_group_members_post) | **POST** /usergroups/{group_id}/members | Manage the members of a User Group -*UserGroupMembersMembershipApi* | [**graph_user_group_membership**](docs/UserGroupMembersMembershipApi.md#graph_user_group_membership) | **GET** /usergroups/{group_id}/membership | List the User Group's membership +*UserGroupMembersMembershipApi* | [**graph_user_group_membership**](docs/UserGroupMembersMembershipApi.md#graph_user_group_membership) | **GET** /usergroups/{group_id}/membership | List the User Group's membership *UserGroupsApi* | [**graph_user_group_associations_list**](docs/UserGroupsApi.md#graph_user_group_associations_list) | **GET** /usergroups/{group_id}/associations | List the associations of a User Group. *UserGroupsApi* | [**graph_user_group_associations_post**](docs/UserGroupsApi.md#graph_user_group_associations_post) | **POST** /usergroups/{group_id}/associations | Manage the associations of a User Group -*UserGroupsApi* | [**graph_user_group_member_of**](docs/UserGroupsApi.md#graph_user_group_member_of) | **GET** /usergroups/{group_id}/memberof | List the User Group's parents *UserGroupsApi* | [**graph_user_group_members_list**](docs/UserGroupsApi.md#graph_user_group_members_list) | **GET** /usergroups/{group_id}/members | List the members of a User Group *UserGroupsApi* | [**graph_user_group_members_post**](docs/UserGroupsApi.md#graph_user_group_members_post) | **POST** /usergroups/{group_id}/members | Manage the members of a User Group -*UserGroupsApi* | [**graph_user_group_membership**](docs/UserGroupsApi.md#graph_user_group_membership) | **GET** /usergroups/{group_id}/membership | List the User Group's membership +*UserGroupsApi* | [**graph_user_group_membership**](docs/UserGroupsApi.md#graph_user_group_membership) | **GET** /usergroups/{group_id}/membership | List the User Group's membership *UserGroupsApi* | [**graph_user_group_traverse_active_directory**](docs/UserGroupsApi.md#graph_user_group_traverse_active_directory) | **GET** /usergroups/{group_id}/activedirectories | List the Active Directories bound to a User Group *UserGroupsApi* | [**graph_user_group_traverse_application**](docs/UserGroupsApi.md#graph_user_group_traverse_application) | **GET** /usergroups/{group_id}/applications | List the Applications bound to a User Group *UserGroupsApi* | [**graph_user_group_traverse_directory**](docs/UserGroupsApi.md#graph_user_group_traverse_directory) | **GET** /usergroups/{group_id}/directories | List the Directories bound to a User Group @@ -361,15 +740,17 @@ Class | Method | HTTP request | Description *UserGroupsApi* | [**graph_user_group_traverse_radius_server**](docs/UserGroupsApi.md#graph_user_group_traverse_radius_server) | **GET** /usergroups/{group_id}/radiusservers | List the RADIUS Servers bound to a User Group *UserGroupsApi* | [**graph_user_group_traverse_system**](docs/UserGroupsApi.md#graph_user_group_traverse_system) | **GET** /usergroups/{group_id}/systems | List the Systems bound to a User Group *UserGroupsApi* | [**graph_user_group_traverse_system_group**](docs/UserGroupsApi.md#graph_user_group_traverse_system_group) | **GET** /usergroups/{group_id}/systemgroups | List the System Groups bound to User Groups +*UserGroupsApi* | [**groups_suggestions_get**](docs/UserGroupsApi.md#groups_suggestions_get) | **GET** /usergroups/{group_id}/suggestions | List Suggestions for a User Group +*UserGroupsApi* | [**groups_suggestions_post**](docs/UserGroupsApi.md#groups_suggestions_post) | **POST** /usergroups/{group_id}/suggestions | List Suggestions for a User Group *UserGroupsApi* | [**groups_user_delete**](docs/UserGroupsApi.md#groups_user_delete) | **DELETE** /usergroups/{id} | Delete a User Group *UserGroupsApi* | [**groups_user_get**](docs/UserGroupsApi.md#groups_user_get) | **GET** /usergroups/{id} | View an individual User Group details *UserGroupsApi* | [**groups_user_list**](docs/UserGroupsApi.md#groups_user_list) | **GET** /usergroups | List all User Groups -*UserGroupsApi* | [**groups_user_patch**](docs/UserGroupsApi.md#groups_user_patch) | **PATCH** /usergroups/{id} | Partial update a User Group *UserGroupsApi* | [**groups_user_post**](docs/UserGroupsApi.md#groups_user_post) | **POST** /usergroups | Create a new User Group *UserGroupsApi* | [**groups_user_put**](docs/UserGroupsApi.md#groups_user_put) | **PUT** /usergroups/{id} | Update a User Group *UsersApi* | [**graph_user_associations_list**](docs/UsersApi.md#graph_user_associations_list) | **GET** /users/{user_id}/associations | List the associations of a User *UsersApi* | [**graph_user_associations_post**](docs/UsersApi.md#graph_user_associations_post) | **POST** /users/{user_id}/associations | Manage the associations of a User *UsersApi* | [**graph_user_member_of**](docs/UsersApi.md#graph_user_member_of) | **GET** /users/{user_id}/memberof | List the parent Groups of a User +*UsersApi* | [**graph_user_traverse_active_directory**](docs/UsersApi.md#graph_user_traverse_active_directory) | **GET** /users/{user_id}/activedirectories | List the Active Directory instances bound to a User *UsersApi* | [**graph_user_traverse_application**](docs/UsersApi.md#graph_user_traverse_application) | **GET** /users/{user_id}/applications | List the Applications bound to a User *UsersApi* | [**graph_user_traverse_directory**](docs/UsersApi.md#graph_user_traverse_directory) | **GET** /users/{user_id}/directories | List the Directories bound to a User *UsersApi* | [**graph_user_traverse_g_suite**](docs/UsersApi.md#graph_user_traverse_g_suite) | **GET** /users/{user_id}/gsuites | List the G Suite instances bound to a User @@ -378,88 +759,237 @@ Class | Method | HTTP request | Description *UsersApi* | [**graph_user_traverse_radius_server**](docs/UsersApi.md#graph_user_traverse_radius_server) | **GET** /users/{user_id}/radiusservers | List the RADIUS Servers bound to a User *UsersApi* | [**graph_user_traverse_system**](docs/UsersApi.md#graph_user_traverse_system) | **GET** /users/{user_id}/systems | List the Systems bound to a User *UsersApi* | [**graph_user_traverse_system_group**](docs/UsersApi.md#graph_user_traverse_system_group) | **GET** /users/{user_id}/systemgroups | List the System Groups bound to a User -*UsersApi* | [**users_send_emails**](docs/UsersApi.md#users_send_emails) | **POST** /users/{user_id}/emails | Send User Emails +*UsersApi* | [**push_endpoints_delete**](docs/UsersApi.md#push_endpoints_delete) | **DELETE** /users/{user_id}/pushendpoints/{push_endpoint_id} | Delete a Push Endpoint associated with a User +*UsersApi* | [**push_endpoints_get**](docs/UsersApi.md#push_endpoints_get) | **GET** /users/{user_id}/pushendpoints/{push_endpoint_id} | Get a push endpoint associated with a User +*UsersApi* | [**push_endpoints_list**](docs/UsersApi.md#push_endpoints_list) | **GET** /users/{user_id}/pushendpoints | List Push Endpoints associated with a User +*UsersApi* | [**push_endpoints_patch**](docs/UsersApi.md#push_endpoints_patch) | **PATCH** /users/{user_id}/pushendpoints/{push_endpoint_id} | Update a push endpoint associated with a User *WorkdayImportApi* | [**workdays_authorize**](docs/WorkdayImportApi.md#workdays_authorize) | **POST** /workdays/{workday_id}/auth | Authorize Workday *WorkdayImportApi* | [**workdays_deauthorize**](docs/WorkdayImportApi.md#workdays_deauthorize) | **DELETE** /workdays/{workday_id}/auth | Deauthorize Workday -*WorkdayImportApi* | [**workdays_delete**](docs/WorkdayImportApi.md#workdays_delete) | **DELETE** /workdays/{id} | Delete Workday *WorkdayImportApi* | [**workdays_get**](docs/WorkdayImportApi.md#workdays_get) | **GET** /workdays/{id} | Get Workday *WorkdayImportApi* | [**workdays_import**](docs/WorkdayImportApi.md#workdays_import) | **POST** /workdays/{workday_id}/import | Workday Import *WorkdayImportApi* | [**workdays_importresults**](docs/WorkdayImportApi.md#workdays_importresults) | **GET** /workdays/{id}/import/{job_id}/results | List Import Results *WorkdayImportApi* | [**workdays_list**](docs/WorkdayImportApi.md#workdays_list) | **GET** /workdays | List Workdays *WorkdayImportApi* | [**workdays_post**](docs/WorkdayImportApi.md#workdays_post) | **POST** /workdays | Create new Workday *WorkdayImportApi* | [**workdays_put**](docs/WorkdayImportApi.md#workdays_put) | **PUT** /workdays/{id} | Update Workday -*WorkdayImportApi* | [**workdays_settings**](docs/WorkdayImportApi.md#workdays_settings) | **GET** /workdays/settings | Get Workday Settings (incomplete) *WorkdayImportApi* | [**workdays_workers**](docs/WorkdayImportApi.md#workdays_workers) | **GET** /workdays/{workday_id}/workers | List Workday Workers -*DefaultApi* | [**jc_enrollment_profiles_delete**](docs/DefaultApi.md#jc_enrollment_profiles_delete) | **DELETE** /enrollmentprofiles/{enrollment_profile_id} | Delete Enrollment Profile -*DefaultApi* | [**jc_enrollment_profiles_get**](docs/DefaultApi.md#jc_enrollment_profiles_get) | **GET** /enrollmentprofiles/{enrollment_profile_id} | Get Enrollment Profile -*DefaultApi* | [**jc_enrollment_profiles_list**](docs/DefaultApi.md#jc_enrollment_profiles_list) | **GET** /enrollmentprofiles | List Enrollment Profiles -*DefaultApi* | [**jc_enrollment_profiles_post**](docs/DefaultApi.md#jc_enrollment_profiles_post) | **POST** /enrollmentprofiles | Create new Enrollment Profile -*DefaultApi* | [**jc_enrollment_profiles_put**](docs/DefaultApi.md#jc_enrollment_profiles_put) | **PUT** /enrollmentprofiles/{enrollment_profile_id} | Update Enrollment Profile *FdeApi* | [**systems_get_fde_key**](docs/FdeApi.md#systems_get_fde_key) | **GET** /systems/{system_id}/fdekey | Get System FDE Key - ## Documentation For Models + - [ADE](docs/ADE.md) + - [ADES](docs/ADES.md) - [ActiveDirectoryAgentGetOutput](docs/ActiveDirectoryAgentGetOutput.md) - [ActiveDirectoryAgentInput](docs/ActiveDirectoryAgentInput.md) - [ActiveDirectoryAgentListOutput](docs/ActiveDirectoryAgentListOutput.md) - [ActiveDirectoryInput](docs/ActiveDirectoryInput.md) + - [ActiveDirectoryOutput](docs/ActiveDirectoryOutput.md) + - [Address](docs/Address.md) - [Administrator](docs/Administrator.md) + - [AdministratorOrganizationLink](docs/AdministratorOrganizationLink.md) + - [AdministratorOrganizationLinkReq](docs/AdministratorOrganizationLinkReq.md) + - [AllOfAutotaskTicketingAlertConfigurationListRecordsItems](docs/AllOfAutotaskTicketingAlertConfigurationListRecordsItems.md) + - [AllOfConnectWiseTicketingAlertConfigurationListRecordsItems](docs/AllOfConnectWiseTicketingAlertConfigurationListRecordsItems.md) + - [AnyValue](docs/AnyValue.md) - [AppleMDM](docs/AppleMDM.md) + - [AppleMdmDevice](docs/AppleMdmDevice.md) + - [AppleMdmDeviceInfo](docs/AppleMdmDeviceInfo.md) + - [AppleMdmDeviceSecurityInfo](docs/AppleMdmDeviceSecurityInfo.md) - [AppleMdmPatchInput](docs/AppleMdmPatchInput.md) + - [AppleMdmPublicKeyCert](docs/AppleMdmPublicKeyCert.md) + - [AppleMdmSignedCsrPlist](docs/AppleMdmSignedCsrPlist.md) + - [ApplicationIdLogoBody](docs/ApplicationIdLogoBody.md) - [AuthInfo](docs/AuthInfo.md) - [AuthInput](docs/AuthInput.md) - [AuthInputObject](docs/AuthInputObject.md) - [AuthinputBasic](docs/AuthinputBasic.md) - [AuthinputOauth](docs/AuthinputOauth.md) - - [Body](docs/Body.md) - - [Body1](docs/Body1.md) - - [Body2](docs/Body2.md) - - [Body3](docs/Body3.md) + - [AuthnPolicy](docs/AuthnPolicy.md) + - [AuthnPolicyEffect](docs/AuthnPolicyEffect.md) + - [AuthnPolicyInput](docs/AuthnPolicyInput.md) + - [AuthnPolicyObligations](docs/AuthnPolicyObligations.md) + - [AuthnPolicyObligationsMfa](docs/AuthnPolicyObligationsMfa.md) + - [AuthnPolicyObligationsUserVerification](docs/AuthnPolicyObligationsUserVerification.md) + - [AuthnPolicyResourceTarget](docs/AuthnPolicyResourceTarget.md) + - [AuthnPolicyTargets](docs/AuthnPolicyTargets.md) + - [AuthnPolicyType](docs/AuthnPolicyType.md) + - [AuthnPolicyUserAttributeFilter](docs/AuthnPolicyUserAttributeFilter.md) + - [AuthnPolicyUserAttributeTarget](docs/AuthnPolicyUserAttributeTarget.md) + - [AuthnPolicyUserGroupTarget](docs/AuthnPolicyUserGroupTarget.md) + - [AuthnPolicyUserTarget](docs/AuthnPolicyUserTarget.md) + - [AutotaskCompany](docs/AutotaskCompany.md) + - [AutotaskCompanyResp](docs/AutotaskCompanyResp.md) + - [AutotaskCompanyTypeResp](docs/AutotaskCompanyTypeResp.md) + - [AutotaskContract](docs/AutotaskContract.md) + - [AutotaskContractField](docs/AutotaskContractField.md) + - [AutotaskContractFieldValues](docs/AutotaskContractFieldValues.md) + - [AutotaskIntegration](docs/AutotaskIntegration.md) + - [AutotaskIntegrationPatchReq](docs/AutotaskIntegrationPatchReq.md) + - [AutotaskIntegrationReq](docs/AutotaskIntegrationReq.md) + - [AutotaskMappingRequest](docs/AutotaskMappingRequest.md) + - [AutotaskMappingRequestCompany](docs/AutotaskMappingRequestCompany.md) + - [AutotaskMappingRequestContract](docs/AutotaskMappingRequestContract.md) + - [AutotaskMappingRequestData](docs/AutotaskMappingRequestData.md) + - [AutotaskMappingRequestOrganization](docs/AutotaskMappingRequestOrganization.md) + - [AutotaskMappingRequestService](docs/AutotaskMappingRequestService.md) + - [AutotaskMappingResponse](docs/AutotaskMappingResponse.md) + - [AutotaskMappingResponseCompany](docs/AutotaskMappingResponseCompany.md) + - [AutotaskMappingResponseContract](docs/AutotaskMappingResponseContract.md) + - [AutotaskMappingResponseOrganization](docs/AutotaskMappingResponseOrganization.md) + - [AutotaskMappingResponseService](docs/AutotaskMappingResponseService.md) + - [AutotaskService](docs/AutotaskService.md) + - [AutotaskSettings](docs/AutotaskSettings.md) + - [AutotaskSettingsPatchReq](docs/AutotaskSettingsPatchReq.md) + - [AutotaskTicketingAlertConfiguration](docs/AutotaskTicketingAlertConfiguration.md) + - [AutotaskTicketingAlertConfigurationList](docs/AutotaskTicketingAlertConfigurationList.md) + - [AutotaskTicketingAlertConfigurationOption](docs/AutotaskTicketingAlertConfigurationOption.md) + - [AutotaskTicketingAlertConfigurationOptionValues](docs/AutotaskTicketingAlertConfigurationOptionValues.md) + - [AutotaskTicketingAlertConfigurationOptions](docs/AutotaskTicketingAlertConfigurationOptions.md) + - [AutotaskTicketingAlertConfigurationPriority](docs/AutotaskTicketingAlertConfigurationPriority.md) + - [AutotaskTicketingAlertConfigurationRequest](docs/AutotaskTicketingAlertConfigurationRequest.md) + - [AutotaskTicketingAlertConfigurationResource](docs/AutotaskTicketingAlertConfigurationResource.md) + - [BillingIntegrationCompanyType](docs/BillingIntegrationCompanyType.md) + - [BulkScheduledStatechangeCreate](docs/BulkScheduledStatechangeCreate.md) - [BulkUserCreate](docs/BulkUserCreate.md) - [BulkUserUpdate](docs/BulkUserUpdate.md) + - [CommandResultList](docs/CommandResultList.md) + - [CommandResultListResults](docs/CommandResultListResults.md) + - [ConnectWiseMappingRequest](docs/ConnectWiseMappingRequest.md) + - [ConnectWiseMappingRequestCompany](docs/ConnectWiseMappingRequestCompany.md) + - [ConnectWiseMappingRequestData](docs/ConnectWiseMappingRequestData.md) + - [ConnectWiseMappingRequestOrganization](docs/ConnectWiseMappingRequestOrganization.md) + - [ConnectWiseMappingResponse](docs/ConnectWiseMappingResponse.md) + - [ConnectWiseMappingResponseAddition](docs/ConnectWiseMappingResponseAddition.md) + - [ConnectWiseSettings](docs/ConnectWiseSettings.md) + - [ConnectWiseSettingsPatchReq](docs/ConnectWiseSettingsPatchReq.md) + - [ConnectWiseTicketingAlertConfiguration](docs/ConnectWiseTicketingAlertConfiguration.md) + - [ConnectWiseTicketingAlertConfigurationList](docs/ConnectWiseTicketingAlertConfigurationList.md) + - [ConnectWiseTicketingAlertConfigurationOption](docs/ConnectWiseTicketingAlertConfigurationOption.md) + - [ConnectWiseTicketingAlertConfigurationOptions](docs/ConnectWiseTicketingAlertConfigurationOptions.md) + - [ConnectWiseTicketingAlertConfigurationRequest](docs/ConnectWiseTicketingAlertConfigurationRequest.md) + - [ConnectwiseAddition](docs/ConnectwiseAddition.md) + - [ConnectwiseAgreement](docs/ConnectwiseAgreement.md) + - [ConnectwiseCompany](docs/ConnectwiseCompany.md) + - [ConnectwiseCompanyResp](docs/ConnectwiseCompanyResp.md) + - [ConnectwiseCompanyTypeResp](docs/ConnectwiseCompanyTypeResp.md) + - [ConnectwiseIntegration](docs/ConnectwiseIntegration.md) + - [ConnectwiseIntegrationPatchReq](docs/ConnectwiseIntegrationPatchReq.md) + - [ConnectwiseIntegrationReq](docs/ConnectwiseIntegrationReq.md) + - [CustomEmail](docs/CustomEmail.md) + - [CustomEmailTemplate](docs/CustomEmailTemplate.md) + - [CustomEmailTemplateField](docs/CustomEmailTemplateField.md) + - [CustomEmailType](docs/CustomEmailType.md) + - [DEP](docs/DEP.md) + - [DEPSetupAssistantOption](docs/DEPSetupAssistantOption.md) + - [DEPWelcomeScreen](docs/DEPWelcomeScreen.md) + - [DeviceIdEraseBody](docs/DeviceIdEraseBody.md) + - [DeviceIdLockBody](docs/DeviceIdLockBody.md) + - [DeviceIdRestartBody](docs/DeviceIdRestartBody.md) - [Directory](docs/Directory.md) - [DuoAccount](docs/DuoAccount.md) - [DuoApplication](docs/DuoApplication.md) - [DuoApplicationReq](docs/DuoApplicationReq.md) - [DuoApplicationUpdateReq](docs/DuoApplicationUpdateReq.md) - - [DuoRegistrationApplication](docs/DuoRegistrationApplication.md) - - [DuoRegistrationApplicationReq](docs/DuoRegistrationApplicationReq.md) - - [Emailrequest](docs/Emailrequest.md) - - [EnrollmentProfile](docs/EnrollmentProfile.md) - [Error](docs/Error.md) - - [Errorresponse](docs/Errorresponse.md) + - [ErrorDetails](docs/ErrorDetails.md) + - [Feature](docs/Feature.md) + - [Filter](docs/Filter.md) + - [FilterQuery](docs/FilterQuery.md) - [GSuiteBuiltinTranslation](docs/GSuiteBuiltinTranslation.md) + - [GSuiteDirectionTranslation](docs/GSuiteDirectionTranslation.md) - [GSuiteTranslationRule](docs/GSuiteTranslationRule.md) - [GSuiteTranslationRuleRequest](docs/GSuiteTranslationRuleRequest.md) + - [GraphAttributeLdapGroups](docs/GraphAttributeLdapGroups.md) + - [GraphAttributePosixGroups](docs/GraphAttributePosixGroups.md) + - [GraphAttributePosixGroupsPosixGroups](docs/GraphAttributePosixGroupsPosixGroups.md) + - [GraphAttributeRadius](docs/GraphAttributeRadius.md) + - [GraphAttributeRadiusRadius](docs/GraphAttributeRadiusRadius.md) + - [GraphAttributeRadiusRadiusReply](docs/GraphAttributeRadiusRadiusReply.md) + - [GraphAttributeSambaEnabled](docs/GraphAttributeSambaEnabled.md) + - [GraphAttributeSudo](docs/GraphAttributeSudo.md) + - [GraphAttributeSudoSudo](docs/GraphAttributeSudoSudo.md) + - [GraphAttributes](docs/GraphAttributes.md) - [GraphConnection](docs/GraphConnection.md) - - [GraphManagementReq](docs/GraphManagementReq.md) - [GraphObject](docs/GraphObject.md) - [GraphObjectWithPaths](docs/GraphObjectWithPaths.md) + - [GraphOperation](docs/GraphOperation.md) + - [GraphOperationActiveDirectory](docs/GraphOperationActiveDirectory.md) + - [GraphOperationApplication](docs/GraphOperationApplication.md) + - [GraphOperationCommand](docs/GraphOperationCommand.md) + - [GraphOperationGSuite](docs/GraphOperationGSuite.md) + - [GraphOperationLdapServer](docs/GraphOperationLdapServer.md) + - [GraphOperationOffice365](docs/GraphOperationOffice365.md) + - [GraphOperationPolicy](docs/GraphOperationPolicy.md) + - [GraphOperationPolicyGroup](docs/GraphOperationPolicyGroup.md) + - [GraphOperationPolicyGroupMember](docs/GraphOperationPolicyGroupMember.md) + - [GraphOperationRadiusServer](docs/GraphOperationRadiusServer.md) + - [GraphOperationSoftwareApp](docs/GraphOperationSoftwareApp.md) + - [GraphOperationSystem](docs/GraphOperationSystem.md) + - [GraphOperationSystemGroup](docs/GraphOperationSystemGroup.md) + - [GraphOperationSystemGroupMember](docs/GraphOperationSystemGroupMember.md) + - [GraphOperationUser](docs/GraphOperationUser.md) + - [GraphOperationUserGroup](docs/GraphOperationUserGroup.md) + - [GraphOperationUserGroupMember](docs/GraphOperationUserGroupMember.md) - [GraphType](docs/GraphType.md) - [Group](docs/Group.md) + - [GroupAttributesUserGroup](docs/GroupAttributesUserGroup.md) + - [GroupIdSuggestionsBody](docs/GroupIdSuggestionsBody.md) - [GroupType](docs/GroupType.md) - [GsuiteOutput](docs/GsuiteOutput.md) - [GsuitePatchInput](docs/GsuitePatchInput.md) + - [IPList](docs/IPList.md) + - [IPListRequest](docs/IPListRequest.md) + - [ImportUser](docs/ImportUser.md) + - [ImportUserAddress](docs/ImportUserAddress.md) + - [ImportUserPhoneNumber](docs/ImportUserPhoneNumber.md) + - [ImportUsersResponse](docs/ImportUsersResponse.md) - [InlineResponse200](docs/InlineResponse200.md) - [InlineResponse2001](docs/InlineResponse2001.md) + - [InlineResponse20010](docs/InlineResponse20010.md) + - [InlineResponse20011](docs/InlineResponse20011.md) + - [InlineResponse20011Users](docs/InlineResponse20011Users.md) + - [InlineResponse20012](docs/InlineResponse20012.md) + - [InlineResponse20013](docs/InlineResponse20013.md) + - [InlineResponse2002](docs/InlineResponse2002.md) + - [InlineResponse2002Users](docs/InlineResponse2002Users.md) + - [InlineResponse2003](docs/InlineResponse2003.md) + - [InlineResponse2004](docs/InlineResponse2004.md) + - [InlineResponse2005](docs/InlineResponse2005.md) + - [InlineResponse2006](docs/InlineResponse2006.md) + - [InlineResponse2007](docs/InlineResponse2007.md) + - [InlineResponse2008](docs/InlineResponse2008.md) + - [InlineResponse2009](docs/InlineResponse2009.md) - [InlineResponse201](docs/InlineResponse201.md) - [InlineResponse400](docs/InlineResponse400.md) - - [JcEnrollmentProfile](docs/JcEnrollmentProfile.md) - - [JobDetails](docs/JobDetails.md) + - [Integration](docs/Integration.md) + - [IntegrationSyncError](docs/IntegrationSyncError.md) + - [IntegrationSyncErrorResp](docs/IntegrationSyncErrorResp.md) + - [IntegrationType](docs/IntegrationType.md) + - [IntegrationsResponse](docs/IntegrationsResponse.md) - [JobId](docs/JobId.md) - [JobWorkresult](docs/JobWorkresult.md) + - [LdapGroup](docs/LdapGroup.md) - [LdapServerAction](docs/LdapServerAction.md) - [LdapServerInput](docs/LdapServerInput.md) - - [Mfa](docs/Mfa.md) + - [LdapServerOutput](docs/LdapServerOutput.md) + - [LdapserversIdBody](docs/LdapserversIdBody.md) + - [MemberSuggestion](docs/MemberSuggestion.md) + - [MemberSuggestionsPostResult](docs/MemberSuggestionsPostResult.md) - [Mobileconfig](docs/Mobileconfig.md) - - [OauthCodeInput](docs/OauthCodeInput.md) + - [OSRestriction](docs/OSRestriction.md) + - [OSRestrictionAppleRestrictions](docs/OSRestrictionAppleRestrictions.md) - [Office365BuiltinTranslation](docs/Office365BuiltinTranslation.md) + - [Office365DirectionTranslation](docs/Office365DirectionTranslation.md) + - [Office365Output](docs/Office365Output.md) + - [Office365PatchInput](docs/Office365PatchInput.md) - [Office365TranslationRule](docs/Office365TranslationRule.md) - [Office365TranslationRuleRequest](docs/Office365TranslationRuleRequest.md) - - [OrgCryptoSettings](docs/OrgCryptoSettings.md) - - [OrgcryptosettingsSshKeys](docs/OrgcryptosettingsSshKeys.md) + - [Organization](docs/Organization.md) + - [OrganizationCase](docs/OrganizationCase.md) + - [OrganizationCasesResponse](docs/OrganizationCasesResponse.md) + - [PhoneNumber](docs/PhoneNumber.md) - [Policy](docs/Policy.md) + - [PolicyGroup](docs/PolicyGroup.md) + - [PolicyGroupData](docs/PolicyGroupData.md) - [PolicyRequest](docs/PolicyRequest.md) - [PolicyRequestTemplate](docs/PolicyRequestTemplate.md) - [PolicyResult](docs/PolicyResult.md) @@ -472,70 +1002,115 @@ Class | Method | HTTP request | Description - [PolicyWithDetails](docs/PolicyWithDetails.md) - [Provider](docs/Provider.md) - [ProviderAdminReq](docs/ProviderAdminReq.md) - - [ProviderContact](docs/ProviderContact.md) - - [SalesforceKnowledgeListOutput](docs/SalesforceKnowledgeListOutput.md) - - [SalesforceknowledgelistoutputInner](docs/SalesforceknowledgelistoutputInner.md) + - [ProviderInvoice](docs/ProviderInvoice.md) + - [ProviderInvoiceResponse](docs/ProviderInvoiceResponse.md) + - [PushEndpointResponse](docs/PushEndpointResponse.md) + - [PushEndpointResponseDevice](docs/PushEndpointResponseDevice.md) + - [PushendpointsPushEndpointIdBody](docs/PushendpointsPushEndpointIdBody.md) + - [PwmAllUsers](docs/PwmAllUsers.md) + - [PwmAllUsersGroups](docs/PwmAllUsersGroups.md) + - [PwmAllUsersResults](docs/PwmAllUsersResults.md) + - [PwmOverviewAppVersions](docs/PwmOverviewAppVersions.md) + - [PwmOverviewAppVersionsResults](docs/PwmOverviewAppVersionsResults.md) + - [PwmOverviewMain](docs/PwmOverviewMain.md) + - [PwmOverviewMainDevices](docs/PwmOverviewMainDevices.md) + - [Query](docs/Query.md) + - [QueuedCommandList](docs/QueuedCommandList.md) + - [QueuedCommandListResults](docs/QueuedCommandListResults.md) - [SambaDomainInput](docs/SambaDomainInput.md) - - [Sshkeylist](docs/Sshkeylist.md) - - [SystemGraphManagementReq](docs/SystemGraphManagementReq.md) - - [SystemGraphManagementReqAttributes](docs/SystemGraphManagementReqAttributes.md) - - [SystemGraphManagementReqAttributesSudo](docs/SystemGraphManagementReqAttributesSudo.md) + - [SambaDomainOutput](docs/SambaDomainOutput.md) + - [ScheduledUserstateResult](docs/ScheduledUserstateResult.md) + - [SetupAssistantOption](docs/SetupAssistantOption.md) + - [SharedFolderAccessLevels](docs/SharedFolderAccessLevels.md) + - [SharedFolderAccessLevelsResults](docs/SharedFolderAccessLevelsResults.md) + - [SharedFolderDetails](docs/SharedFolderDetails.md) + - [SharedFolderUsers](docs/SharedFolderUsers.md) + - [SharedFolderUsersResults](docs/SharedFolderUsersResults.md) + - [SharedFoldersList](docs/SharedFoldersList.md) + - [SharedFoldersListResults](docs/SharedFoldersListResults.md) + - [SoftwareApp](docs/SoftwareApp.md) + - [SoftwareAppAppleVpp](docs/SoftwareAppAppleVpp.md) + - [SoftwareAppReclaimLicenses](docs/SoftwareAppReclaimLicenses.md) + - [SoftwareAppSettings](docs/SoftwareAppSettings.md) + - [SoftwareAppStatus](docs/SoftwareAppStatus.md) + - [SoftwareAppWithStatus](docs/SoftwareAppWithStatus.md) + - [SoftwareAppsRetryInstallationRequest](docs/SoftwareAppsRetryInstallationRequest.md) + - [Subscription](docs/Subscription.md) + - [SuggestionCounts](docs/SuggestionCounts.md) - [SystemGroup](docs/SystemGroup.md) - [SystemGroupData](docs/SystemGroupData.md) - - [SystemGroupGraphManagementReq](docs/SystemGroupGraphManagementReq.md) - - [SystemGroupMembersReq](docs/SystemGroupMembersReq.md) + - [SystemInsightsAlf](docs/SystemInsightsAlf.md) + - [SystemInsightsAlfExceptions](docs/SystemInsightsAlfExceptions.md) + - [SystemInsightsAlfExplicitAuths](docs/SystemInsightsAlfExplicitAuths.md) + - [SystemInsightsAppcompatShims](docs/SystemInsightsAppcompatShims.md) - [SystemInsightsApps](docs/SystemInsightsApps.md) + - [SystemInsightsAuthorizedKeys](docs/SystemInsightsAuthorizedKeys.md) + - [SystemInsightsAzureInstanceMetadata](docs/SystemInsightsAzureInstanceMetadata.md) + - [SystemInsightsAzureInstanceTags](docs/SystemInsightsAzureInstanceTags.md) - [SystemInsightsBattery](docs/SystemInsightsBattery.md) - [SystemInsightsBitlockerInfo](docs/SystemInsightsBitlockerInfo.md) - [SystemInsightsBrowserPlugins](docs/SystemInsightsBrowserPlugins.md) + - [SystemInsightsCertificates](docs/SystemInsightsCertificates.md) + - [SystemInsightsChassisInfo](docs/SystemInsightsChassisInfo.md) - [SystemInsightsChromeExtensions](docs/SystemInsightsChromeExtensions.md) + - [SystemInsightsConnectivity](docs/SystemInsightsConnectivity.md) - [SystemInsightsCrashes](docs/SystemInsightsCrashes.md) + - [SystemInsightsCupsDestinations](docs/SystemInsightsCupsDestinations.md) - [SystemInsightsDiskEncryption](docs/SystemInsightsDiskEncryption.md) - [SystemInsightsDiskInfo](docs/SystemInsightsDiskInfo.md) + - [SystemInsightsDnsResolvers](docs/SystemInsightsDnsResolvers.md) - [SystemInsightsEtcHosts](docs/SystemInsightsEtcHosts.md) - [SystemInsightsFirefoxAddons](docs/SystemInsightsFirefoxAddons.md) - [SystemInsightsGroups](docs/SystemInsightsGroups.md) - [SystemInsightsIeExtensions](docs/SystemInsightsIeExtensions.md) - [SystemInsightsInterfaceAddresses](docs/SystemInsightsInterfaceAddresses.md) + - [SystemInsightsInterfaceDetails](docs/SystemInsightsInterfaceDetails.md) - [SystemInsightsKernelInfo](docs/SystemInsightsKernelInfo.md) - [SystemInsightsLaunchd](docs/SystemInsightsLaunchd.md) + - [SystemInsightsLinuxPackages](docs/SystemInsightsLinuxPackages.md) - [SystemInsightsLoggedInUsers](docs/SystemInsightsLoggedInUsers.md) - - [SystemInsightsLogicalDrvies](docs/SystemInsightsLogicalDrvies.md) + - [SystemInsightsLogicalDrives](docs/SystemInsightsLogicalDrives.md) + - [SystemInsightsManagedPolicies](docs/SystemInsightsManagedPolicies.md) - [SystemInsightsMounts](docs/SystemInsightsMounts.md) - [SystemInsightsOsVersion](docs/SystemInsightsOsVersion.md) - [SystemInsightsPatches](docs/SystemInsightsPatches.md) - [SystemInsightsPrograms](docs/SystemInsightsPrograms.md) + - [SystemInsightsPythonPackages](docs/SystemInsightsPythonPackages.md) - [SystemInsightsSafariExtensions](docs/SystemInsightsSafariExtensions.md) + - [SystemInsightsScheduledTasks](docs/SystemInsightsScheduledTasks.md) + - [SystemInsightsSecureboot](docs/SystemInsightsSecureboot.md) + - [SystemInsightsServices](docs/SystemInsightsServices.md) + - [SystemInsightsShadow](docs/SystemInsightsShadow.md) + - [SystemInsightsSharedFolders](docs/SystemInsightsSharedFolders.md) + - [SystemInsightsSharedResources](docs/SystemInsightsSharedResources.md) + - [SystemInsightsSharingPreferences](docs/SystemInsightsSharingPreferences.md) + - [SystemInsightsSipConfig](docs/SystemInsightsSipConfig.md) + - [SystemInsightsStartupItems](docs/SystemInsightsStartupItems.md) - [SystemInsightsSystemControls](docs/SystemInsightsSystemControls.md) - [SystemInsightsSystemInfo](docs/SystemInsightsSystemInfo.md) + - [SystemInsightsTpmInfo](docs/SystemInsightsTpmInfo.md) - [SystemInsightsUptime](docs/SystemInsightsUptime.md) - [SystemInsightsUsbDevices](docs/SystemInsightsUsbDevices.md) - [SystemInsightsUserGroups](docs/SystemInsightsUserGroups.md) + - [SystemInsightsUserSshKeys](docs/SystemInsightsUserSshKeys.md) + - [SystemInsightsUserassist](docs/SystemInsightsUserassist.md) - [SystemInsightsUsers](docs/SystemInsightsUsers.md) - - [SystemInsightsWindowsCrashes](docs/SystemInsightsWindowsCrashes.md) + - [SystemInsightsWifiNetworks](docs/SystemInsightsWifiNetworks.md) + - [SystemInsightsWifiStatus](docs/SystemInsightsWifiStatus.md) + - [SystemInsightsWindowsSecurityCenter](docs/SystemInsightsWindowsSecurityCenter.md) + - [SystemInsightsWindowsSecurityProducts](docs/SystemInsightsWindowsSecurityProducts.md) - [Systemfdekey](docs/Systemfdekey.md) - - [Systemuser](docs/Systemuser.md) - - [Systemuserputpost](docs/Systemuserputpost.md) - - [SystemuserputpostAddresses](docs/SystemuserputpostAddresses.md) - - [SystemuserputpostPhoneNumbers](docs/SystemuserputpostPhoneNumbers.md) - - [UserGraphManagementReq](docs/UserGraphManagementReq.md) + - [TicketingIntegrationAlert](docs/TicketingIntegrationAlert.md) + - [TicketingIntegrationAlertsResp](docs/TicketingIntegrationAlertsResp.md) + - [User](docs/User.md) - [UserGroup](docs/UserGroup.md) - - [UserGroupAttributes](docs/UserGroupAttributes.md) - - [UserGroupAttributesPosixGroups](docs/UserGroupAttributesPosixGroups.md) - - [UserGroupGraphManagementReq](docs/UserGroupGraphManagementReq.md) - - [UserGroupMembersReq](docs/UserGroupMembersReq.md) - [UserGroupPost](docs/UserGroupPost.md) - [UserGroupPut](docs/UserGroupPut.md) - [WorkdayFields](docs/WorkdayFields.md) - [WorkdayInput](docs/WorkdayInput.md) - [WorkdayOutput](docs/WorkdayOutput.md) - - [WorkdayRequest](docs/WorkdayRequest.md) - [WorkdayWorker](docs/WorkdayWorker.md) - [WorkdayoutputAuth](docs/WorkdayoutputAuth.md) - - [ActiveDirectoryOutput](docs/ActiveDirectoryOutput.md) - - [LdapServerOutput](docs/LdapServerOutput.md) - - [SambaDomainOutput](docs/SambaDomainOutput.md) - ## Documentation For Authorization @@ -549,5 +1124,4 @@ Class | Method | HTTP request | Description ## Author - - +support@jumpcloud.com diff --git a/jcapiv2/docs/ADE.md b/jcapiv2/docs/ADE.md new file mode 100644 index 0000000..2b2fec7 --- /dev/null +++ b/jcapiv2/docs/ADE.md @@ -0,0 +1,12 @@ +# ADE + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**default_device_group_object_ids** | **list[str]** | An array of ObjectIDs identifying the default device groups for this specific type (based on the OS family) of automated device enrollment. Currently, only a single DeviceGroupID is supported. | [optional] +**enable_zero_touch_enrollment** | **bool** | A toggle to determine if ADE registered devices should go through JumpCloud Zero Touch Enrollment. | [optional] +**setup_assistant_options** | [**list[DEPSetupAssistantOption]**](DEPSetupAssistantOption.md) | | [optional] +**welcome_screen** | [**DEPWelcomeScreen**](DEPWelcomeScreen.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ADES.md b/jcapiv2/docs/ADES.md new file mode 100644 index 0000000..40044f6 --- /dev/null +++ b/jcapiv2/docs/ADES.md @@ -0,0 +1,10 @@ +# ADES + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ios** | [**ADE**](ADE.md) | | [optional] +**macos** | [**ADE**](ADE.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ActiveDirectoryAgentGetOutput.md b/jcapiv2/docs/ActiveDirectoryAgentGetOutput.md index 37c87f4..4e27e20 100644 --- a/jcapiv2/docs/ActiveDirectoryAgentGetOutput.md +++ b/jcapiv2/docs/ActiveDirectoryAgentGetOutput.md @@ -4,8 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **connect_key** | **str** | The connect key to use when installing the Agent on a Domain Controller. | [optional] +**contact_at** | **str** | | [optional] +**hostname** | **str** | | [optional] **id** | **str** | ObjectID of this Active Directory Agent. | +**source_ip** | **str** | | [optional] +**state** | **str** | | [optional] +**version** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/ActiveDirectoryAgentInput.md b/jcapiv2/docs/ActiveDirectoryAgentInput.md index f6be8ab..109ad7c 100644 --- a/jcapiv2/docs/ActiveDirectoryAgentInput.md +++ b/jcapiv2/docs/ActiveDirectoryAgentInput.md @@ -6,4 +6,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/ActiveDirectoryAgentListOutput.md b/jcapiv2/docs/ActiveDirectoryAgentListOutput.md index f7fed9a..d0f1dd7 100644 --- a/jcapiv2/docs/ActiveDirectoryAgentListOutput.md +++ b/jcapiv2/docs/ActiveDirectoryAgentListOutput.md @@ -3,9 +3,12 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**contact_at** | **str** | | [optional] +**hostname** | **str** | | [optional] **id** | **str** | ObjectID of this Active Directory Agent. | [optional] +**source_ip** | **str** | | [optional] **state** | **str** | | [optional] +**version** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/ActiveDirectoryApi.md b/jcapiv2/docs/ActiveDirectoryApi.md index 9b616b5..3471358 100644 --- a/jcapiv2/docs/ActiveDirectoryApi.md +++ b/jcapiv2/docs/ActiveDirectoryApi.md @@ -14,14 +14,16 @@ Method | HTTP request | Description [**activedirectories_post**](ActiveDirectoryApi.md#activedirectories_post) | **POST** /activedirectories | Create a new Active Directory [**graph_active_directory_associations_list**](ActiveDirectoryApi.md#graph_active_directory_associations_list) | **GET** /activedirectories/{activedirectory_id}/associations | List the associations of an Active Directory instance [**graph_active_directory_associations_post**](ActiveDirectoryApi.md#graph_active_directory_associations_post) | **POST** /activedirectories/{activedirectory_id}/associations | Manage the associations of an Active Directory instance +[**graph_active_directory_traverse_user**](ActiveDirectoryApi.md#graph_active_directory_traverse_user) | **GET** /activedirectories/{activedirectory_id}/users | List the Users bound to an Active Directory instance [**graph_active_directory_traverse_user_group**](ActiveDirectoryApi.md#graph_active_directory_traverse_user_group) | **GET** /activedirectories/{activedirectory_id}/usergroups | List the User Groups bound to an Active Directory instance - # **activedirectories_agents_delete** -> activedirectories_agents_delete(activedirectory_id, agent_id, content_type, accept, x_org_id=x_org_id) +> activedirectories_agents_delete(activedirectory_id, agent_id, x_org_id=x_org_id) Delete Active Directory Agent +This endpoint deletes an Active Directory agent. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + ### Example ```python from __future__ import print_function @@ -30,17 +32,21 @@ import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + # create an instance of the API class -api_instance = jcapiv2.ActiveDirectoryApi() +api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) activedirectory_id = 'activedirectory_id_example' # str | agent_id = 'agent_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Delete Active Directory Agent - api_instance.activedirectories_agents_delete(activedirectory_id, agent_id, content_type, accept, x_org_id=x_org_id) + api_instance.activedirectories_agents_delete(activedirectory_id, agent_id, x_org_id=x_org_id) except ApiException as e: print("Exception when calling ActiveDirectoryApi->activedirectories_agents_delete: %s\n" % e) ``` @@ -51,9 +57,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **activedirectory_id** | **str**| | **agent_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -61,21 +65,21 @@ void (empty response body) ### Authorization -No authorization required +[x-api-key](../README.md#x-api-key) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **activedirectories_agents_get** -> ActiveDirectoryAgentListOutput activedirectories_agents_get(activedirectory_id, agent_id, content_type, accept, x_org_id=x_org_id) +> ActiveDirectoryAgentListOutput activedirectories_agents_get(activedirectory_id, agent_id, x_org_id=x_org_id) Get Active Directory Agent -This endpoint returns a specific active directory agent. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint returns an Active Directory agent. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -85,17 +89,21 @@ import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + # create an instance of the API class -api_instance = jcapiv2.ActiveDirectoryApi() +api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) activedirectory_id = 'activedirectory_id_example' # str | agent_id = 'agent_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Get Active Directory Agent - api_response = api_instance.activedirectories_agents_get(activedirectory_id, agent_id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.activedirectories_agents_get(activedirectory_id, agent_id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ActiveDirectoryApi->activedirectories_agents_get: %s\n" % e) @@ -107,9 +115,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **activedirectory_id** | **str**| | **agent_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -117,17 +123,17 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[x-api-key](../README.md#x-api-key) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **activedirectories_agents_list** -> list[ActiveDirectoryAgentListOutput] activedirectories_agents_list(activedirectory_id, content_type, accept, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +> list[ActiveDirectoryAgentListOutput] activedirectories_agents_list(activedirectory_id, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) List Active Directory Agents @@ -150,16 +156,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) activedirectory_id = 'activedirectory_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List Active Directory Agents - api_response = api_instance.activedirectories_agents_list(activedirectory_id, content_type, accept, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.activedirectories_agents_list(activedirectory_id, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ActiveDirectoryApi->activedirectories_agents_list: %s\n" % e) @@ -170,12 +174,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **activedirectory_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -187,13 +189,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **activedirectories_agents_post** -> ActiveDirectoryAgentGetOutput activedirectories_agents_post(activedirectory_id, content_type, accept, body=body, x_org_id=x_org_id) +> ActiveDirectoryAgentGetOutput activedirectories_agents_post(activedirectory_id, body=body, x_org_id=x_org_id) Create a new Active Directory Agent @@ -216,14 +218,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) activedirectory_id = 'activedirectory_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv2.ActiveDirectoryAgentInput() # ActiveDirectoryAgentInput | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Create a new Active Directory Agent - api_response = api_instance.activedirectories_agents_post(activedirectory_id, content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.activedirectories_agents_post(activedirectory_id, body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ActiveDirectoryApi->activedirectories_agents_post: %s\n" % e) @@ -234,10 +234,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **activedirectory_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**ActiveDirectoryAgentInput**](ActiveDirectoryAgentInput.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -255,11 +253,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **activedirectories_delete** -> activedirectories_delete(id, content_type, accept, x_org_id=x_org_id) +> ActiveDirectoryOutput activedirectories_delete(id, x_org_id=x_org_id) Delete an Active Directory -This endpoint allows you to delete an Active Directory Instance. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY' ``` +This endpoint allows you to delete an Active Directory Instance. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -278,13 +276,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | ObjectID of this Active Directory instance. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Delete an Active Directory - api_instance.activedirectories_delete(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.activedirectories_delete(id, x_org_id=x_org_id) + pprint(api_response) except ApiException as e: print("Exception when calling ActiveDirectoryApi->activedirectories_delete: %s\n" % e) ``` @@ -294,13 +291,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| ObjectID of this Active Directory instance. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -void (empty response body) +[**ActiveDirectoryOutput**](ActiveDirectoryOutput.md) ### Authorization @@ -308,13 +303,13 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **activedirectories_get** -> ActiveDirectoryOutput activedirectories_get(id, content_type, accept, x_org_id=x_org_id) +> ActiveDirectoryOutput activedirectories_get(id, x_org_id=x_org_id) Get an Active Directory @@ -337,13 +332,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | ObjectID of this Active Directory instance. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Get an Active Directory - api_response = api_instance.activedirectories_get(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.activedirectories_get(id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ActiveDirectoryApi->activedirectories_get: %s\n" % e) @@ -354,9 +347,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| ObjectID of this Active Directory instance. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -368,13 +359,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **activedirectories_list** -> list[ActiveDirectoryOutput] activedirectories_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +> list[ActiveDirectoryOutput] activedirectories_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) List Active Directories @@ -396,18 +387,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List Active Directories - api_response = api_instance.activedirectories_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.activedirectories_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ActiveDirectoryApi->activedirectories_list: %s\n" % e) @@ -417,14 +406,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -436,17 +423,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **activedirectories_post** -> ActiveDirectoryOutput activedirectories_post(content_type, accept, body=body, x_org_id=x_org_id) +> ActiveDirectoryOutput activedirectories_post(body=body, x_org_id=x_org_id) Create a new Active Directory -This endpoint allows you to create a new Active Directory. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/ \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"domain\": \"{DC=AD_domain_name;DC=com}\" } ' ``` +This endpoint allows you to create a new Active Directory. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/ \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"domain\": \"{DC=AD_domain_name;DC=com}\" }' ``` ### Example ```python @@ -464,14 +451,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv2.ActiveDirectoryInput() # ActiveDirectoryInput | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Create a new Active Directory - api_response = api_instance.activedirectories_post(content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.activedirectories_post(body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ActiveDirectoryApi->activedirectories_post: %s\n" % e) @@ -481,10 +466,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**ActiveDirectoryInput**](ActiveDirectoryInput.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -502,7 +485,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_active_directory_associations_list** -> list[GraphConnection] graph_active_directory_associations_list(activedirectory_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_active_directory_associations_list(activedirectory_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of an Active Directory instance @@ -525,16 +508,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) activedirectory_id = 'activedirectory_id_example' # str | -targets = ['targets_example'] # list[str] | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +targets = ['targets_example'] # list[str] | Targets which a \"active_directory\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of an Active Directory instance - api_response = api_instance.graph_active_directory_associations_list(activedirectory_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_active_directory_associations_list(activedirectory_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ActiveDirectoryApi->graph_active_directory_associations_list: %s\n" % e) @@ -545,12 +526,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **activedirectory_id** | **str**| | - **targets** | [**list[str]**](str.md)| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **targets** | [**list[str]**](str.md)| Targets which a \"active_directory\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -562,17 +541,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_active_directory_associations_post** -> graph_active_directory_associations_post(activedirectory_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_active_directory_associations_post(activedirectory_id, body=body, x_org_id=x_org_id) Manage the associations of an Active Directory instance -This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" } ' ``` +This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` ### Example ```python @@ -591,14 +570,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) activedirectory_id = 'activedirectory_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.GraphManagementReq() # GraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationActiveDirectory() # GraphOperationActiveDirectory | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of an Active Directory instance - api_instance.graph_active_directory_associations_post(activedirectory_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_active_directory_associations_post(activedirectory_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling ActiveDirectoryApi->graph_active_directory_associations_post: %s\n" % e) ``` @@ -608,10 +585,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **activedirectory_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationActiveDirectory**](GraphOperationActiveDirectory.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -624,12 +599,74 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_active_directory_traverse_user** +> list[GraphObjectWithPaths] graph_active_directory_traverse_user(activedirectory_id, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip) + +List the Users bound to an Active Directory instance + +This endpoint will return all Users bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) +activedirectory_id = 'activedirectory_id_example' # str | ObjectID of the Active Directory instance. +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) + +try: + # List the Users bound to an Active Directory instance + api_response = api_instance.graph_active_directory_traverse_user(activedirectory_id, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip) + pprint(api_response) +except ApiException as e: + print("Exception when calling ActiveDirectoryApi->graph_active_directory_traverse_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **activedirectory_id** | **str**| ObjectID of the Active Directory instance. | + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_active_directory_traverse_user_group** -> list[GraphObjectWithPaths] graph_active_directory_traverse_user_group(activedirectory_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_active_directory_traverse_user_group(activedirectory_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the User Groups bound to an Active Directory instance @@ -652,16 +689,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.ActiveDirectoryApi(jcapiv2.ApiClient(configuration)) activedirectory_id = 'activedirectory_id_example' # str | ObjectID of the Active Directory instance. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the User Groups bound to an Active Directory instance - api_response = api_instance.graph_active_directory_traverse_user_group(activedirectory_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_active_directory_traverse_user_group(activedirectory_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling ActiveDirectoryApi->graph_active_directory_traverse_user_group: %s\n" % e) @@ -672,12 +707,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **activedirectory_id** | **str**| ObjectID of the Active Directory instance. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -689,7 +722,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/ActiveDirectoryInput.md b/jcapiv2/docs/ActiveDirectoryInput.md index 055cc91..e574b93 100644 --- a/jcapiv2/docs/ActiveDirectoryInput.md +++ b/jcapiv2/docs/ActiveDirectoryInput.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/ActiveDirectoryOutput.md b/jcapiv2/docs/ActiveDirectoryOutput.md index b415b4b..f3b5dd1 100644 --- a/jcapiv2/docs/ActiveDirectoryOutput.md +++ b/jcapiv2/docs/ActiveDirectoryOutput.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **domain** | **str** | Domain name for this Active Directory instance. | [optional] -**id** | **str** | ObjectID of this Active Directory instance. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemuserputpostAddresses.md b/jcapiv2/docs/Address.md similarity index 93% rename from jcapiv2/docs/SystemuserputpostAddresses.md rename to jcapiv2/docs/Address.md index 1d6782f..8236192 100644 --- a/jcapiv2/docs/SystemuserputpostAddresses.md +++ b/jcapiv2/docs/Address.md @@ -1,10 +1,11 @@ -# SystemuserputpostAddresses +# Address ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **country** | **str** | | [optional] **extended_address** | **str** | | [optional] +**id** | **str** | | [optional] **locality** | **str** | | [optional] **po_box** | **str** | | [optional] **postal_code** | **str** | | [optional] @@ -14,4 +15,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/Administrator.md b/jcapiv2/docs/Administrator.md index 7895492..30e8099 100644 --- a/jcapiv2/docs/Administrator.md +++ b/jcapiv2/docs/Administrator.md @@ -8,8 +8,11 @@ Name | Type | Description | Notes **firstname** | **str** | | [optional] **id** | **str** | | [optional] **lastname** | **str** | | [optional] +**organization_access_total** | **float** | | [optional] **registered** | **bool** | | [optional] +**role** | **str** | | [optional] +**role_name** | **str** | | [optional] +**suspended** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/AdministratorOrganizationLink.md b/jcapiv2/docs/AdministratorOrganizationLink.md new file mode 100644 index 0000000..9d83c6f --- /dev/null +++ b/jcapiv2/docs/AdministratorOrganizationLink.md @@ -0,0 +1,10 @@ +# AdministratorOrganizationLink + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**administrator** | **str** | The identifier for an administrator | [optional] +**organization** | **str** | The identifier for an organization | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AdministratorOrganizationLinkReq.md b/jcapiv2/docs/AdministratorOrganizationLinkReq.md new file mode 100644 index 0000000..b46708c --- /dev/null +++ b/jcapiv2/docs/AdministratorOrganizationLinkReq.md @@ -0,0 +1,9 @@ +# AdministratorOrganizationLinkReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organization** | **str** | The identifier for an organization to link this administrator to. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AdministratorsApi.md b/jcapiv2/docs/AdministratorsApi.md new file mode 100644 index 0000000..65fb3b0 --- /dev/null +++ b/jcapiv2/docs/AdministratorsApi.md @@ -0,0 +1,238 @@ +# jcapiv2.AdministratorsApi + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**administrator_organizations_create_by_administrator**](AdministratorsApi.md#administrator_organizations_create_by_administrator) | **POST** /administrators/{id}/organizationlinks | Allow Adminstrator access to an Organization. +[**administrator_organizations_list_by_administrator**](AdministratorsApi.md#administrator_organizations_list_by_administrator) | **GET** /administrators/{id}/organizationlinks | List the association links between an Administrator and Organizations. +[**administrator_organizations_list_by_organization**](AdministratorsApi.md#administrator_organizations_list_by_organization) | **GET** /organizations/{id}/administratorlinks | List the association links between an Organization and Administrators. +[**administrator_organizations_remove_by_administrator**](AdministratorsApi.md#administrator_organizations_remove_by_administrator) | **DELETE** /administrators/{administrator_id}/organizationlinks/{id} | Remove association between an Administrator and an Organization. + +# **administrator_organizations_create_by_administrator** +> AdministratorOrganizationLink administrator_organizations_create_by_administrator(id, body=body) + +Allow Adminstrator access to an Organization. + +This endpoint allows you to grant Administrator access to an Organization. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AdministratorsApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | +body = jcapiv2.AdministratorOrganizationLinkReq() # AdministratorOrganizationLinkReq | (optional) + +try: + # Allow Adminstrator access to an Organization. + api_response = api_instance.administrator_organizations_create_by_administrator(id, body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling AdministratorsApi->administrator_organizations_create_by_administrator: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **body** | [**AdministratorOrganizationLinkReq**](AdministratorOrganizationLinkReq.md)| | [optional] + +### Return type + +[**AdministratorOrganizationLink**](AdministratorOrganizationLink.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **administrator_organizations_list_by_administrator** +> list[AdministratorOrganizationLink] administrator_organizations_list_by_administrator(id, limit=limit, skip=skip) + +List the association links between an Administrator and Organizations. + +This endpoint returns the association links between an Administrator and Organizations. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AdministratorsApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) + +try: + # List the association links between an Administrator and Organizations. + api_response = api_instance.administrator_organizations_list_by_administrator(id, limit=limit, skip=skip) + pprint(api_response) +except ApiException as e: + print("Exception when calling AdministratorsApi->administrator_organizations_list_by_administrator: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + +### Return type + +[**list[AdministratorOrganizationLink]**](AdministratorOrganizationLink.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **administrator_organizations_list_by_organization** +> list[AdministratorOrganizationLink] administrator_organizations_list_by_organization(id, limit=limit, skip=skip) + +List the association links between an Organization and Administrators. + +This endpoint returns the association links between an Organization and Administrators. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AdministratorsApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) + +try: + # List the association links between an Organization and Administrators. + api_response = api_instance.administrator_organizations_list_by_organization(id, limit=limit, skip=skip) + pprint(api_response) +except ApiException as e: + print("Exception when calling AdministratorsApi->administrator_organizations_list_by_organization: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + +### Return type + +[**list[AdministratorOrganizationLink]**](AdministratorOrganizationLink.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **administrator_organizations_remove_by_administrator** +> administrator_organizations_remove_by_administrator(administrator_id, id) + +Remove association between an Administrator and an Organization. + +This endpoint removes the association link between an Administrator and an Organization. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AdministratorsApi(jcapiv2.ApiClient(configuration)) +administrator_id = 'administrator_id_example' # str | +id = 'id_example' # str | + +try: + # Remove association between an Administrator and an Organization. + api_instance.administrator_organizations_remove_by_administrator(administrator_id, id) +except ApiException as e: + print("Exception when calling AdministratorsApi->administrator_organizations_remove_by_administrator: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **administrator_id** | **str**| | + **id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AllOfAutotaskTicketingAlertConfigurationListRecordsItems.md b/jcapiv2/docs/AllOfAutotaskTicketingAlertConfigurationListRecordsItems.md new file mode 100644 index 0000000..15c18bf --- /dev/null +++ b/jcapiv2/docs/AllOfAutotaskTicketingAlertConfigurationListRecordsItems.md @@ -0,0 +1,20 @@ +# AllOfAutotaskTicketingAlertConfigurationListRecordsItems + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **str** | | [optional] +**description** | **str** | | [optional] +**destination** | **str** | | [optional] +**display_name** | **str** | | [optional] +**due_days** | **int** | | [optional] +**id** | **int** | | [optional] +**priority** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | [optional] +**queue** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | [optional] +**resource** | [**AutotaskTicketingAlertConfigurationResource**](AutotaskTicketingAlertConfigurationResource.md) | | [optional] +**should_create_tickets** | **bool** | | [optional] +**source** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | [optional] +**status** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AllOfConnectWiseTicketingAlertConfigurationListRecordsItems.md b/jcapiv2/docs/AllOfConnectWiseTicketingAlertConfigurationListRecordsItems.md new file mode 100644 index 0000000..ff9cbe0 --- /dev/null +++ b/jcapiv2/docs/AllOfConnectWiseTicketingAlertConfigurationListRecordsItems.md @@ -0,0 +1,16 @@ +# AllOfConnectWiseTicketingAlertConfigurationListRecordsItems + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **str** | | [optional] +**description** | **str** | | [optional] +**display_name** | **str** | | [optional] +**due_days** | **int** | | [optional] +**id** | **int** | | [optional] +**priority** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | [optional] +**should_create_tickets** | **bool** | | +**source** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Usersystembinding.md b/jcapiv2/docs/AnyValue.md similarity index 92% rename from jcapiv1/docs/Usersystembinding.md rename to jcapiv2/docs/AnyValue.md index 31de0df..d724fe6 100644 --- a/jcapiv1/docs/Usersystembinding.md +++ b/jcapiv2/docs/AnyValue.md @@ -1,4 +1,4 @@ -# Usersystembinding +# AnyValue ## Properties Name | Type | Description | Notes @@ -6,4 +6,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/AppleMDM.md b/jcapiv2/docs/AppleMDM.md index d73eeda..8c98cce 100644 --- a/jcapiv2/docs/AppleMDM.md +++ b/jcapiv2/docs/AppleMDM.md @@ -3,10 +3,17 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**ades** | [**ADES**](ADES.md) | | [optional] +**allow_mobile_user_enrollment** | **bool** | A toggle to allow mobile device enrollment for an organization. | [optional] +**apns_cert_expiry** | **str** | The expiration date and time for the APNS Certificate. | [optional] **apns_push_topic** | **str** | The push topic assigned to this enrollment by Apple after uploading the Signed CSR plist. | [optional] +**default_ios_user_enrollment_device_group_id** | **str** | ObjectId uniquely identifying the MDM default iOS user enrollment device group. | [optional] +**default_system_group_id** | **str** | ObjectId uniquely identifying the MDM default System Group. | [optional] +**dep** | [**DEP**](DEP.md) | | [optional] +**dep_access_token_expiry** | **str** | The expiration date and time for the DEP Access Token. This aligns with the DEP Server Token State. | [optional] +**dep_server_token_state** | **str** | The state of the dep server token, presence and expiry. | [optional] **id** | **str** | ObjectId uniquely identifying an MDM Enrollment, | **name** | **str** | A friendly name to identify this enrollment. Not required to be unique. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/AppleMDMApi.md b/jcapiv2/docs/AppleMDMApi.md index f5609a4..cc95796 100644 --- a/jcapiv2/docs/AppleMDMApi.md +++ b/jcapiv2/docs/AppleMDMApi.md @@ -4,20 +4,429 @@ All URIs are relative to *https://console.jumpcloud.com/api/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**applemdms_delete**](AppleMDMApi.md#applemdms_delete) | **DELETE** /applemdms/{apple_mdm_id} | Delete an Apple MDM +[**applemdms_csrget**](AppleMDMApi.md#applemdms_csrget) | **GET** /applemdms/{apple_mdm_id}/csr | Get Apple MDM CSR Plist +[**applemdms_delete**](AppleMDMApi.md#applemdms_delete) | **DELETE** /applemdms/{id} | Delete an Apple MDM +[**applemdms_deletedevice**](AppleMDMApi.md#applemdms_deletedevice) | **DELETE** /applemdms/{apple_mdm_id}/devices/{device_id} | Remove an Apple MDM Device's Enrollment +[**applemdms_depkeyget**](AppleMDMApi.md#applemdms_depkeyget) | **GET** /applemdms/{apple_mdm_id}/depkey | Get Apple MDM DEP Public Key +[**applemdms_devices_clear_activation_lock**](AppleMDMApi.md#applemdms_devices_clear_activation_lock) | **POST** /applemdms/{apple_mdm_id}/devices/{device_id}/clearActivationLock | Clears the Activation Lock for a Device +[**applemdms_devices_refresh_activation_lock_information**](AppleMDMApi.md#applemdms_devices_refresh_activation_lock_information) | **POST** /applemdms/{apple_mdm_id}/devices/{device_id}/refreshActivationLockInformation | Refresh activation lock information for a device +[**applemdms_deviceserase**](AppleMDMApi.md#applemdms_deviceserase) | **POST** /applemdms/{apple_mdm_id}/devices/{device_id}/erase | Erase Device +[**applemdms_deviceslist**](AppleMDMApi.md#applemdms_deviceslist) | **GET** /applemdms/{apple_mdm_id}/devices | List AppleMDM Devices +[**applemdms_deviceslock**](AppleMDMApi.md#applemdms_deviceslock) | **POST** /applemdms/{apple_mdm_id}/devices/{device_id}/lock | Lock Device +[**applemdms_devicesrestart**](AppleMDMApi.md#applemdms_devicesrestart) | **POST** /applemdms/{apple_mdm_id}/devices/{device_id}/restart | Restart Device +[**applemdms_devicesshutdown**](AppleMDMApi.md#applemdms_devicesshutdown) | **POST** /applemdms/{apple_mdm_id}/devices/{device_id}/shutdown | Shut Down Device +[**applemdms_enrollmentprofilesget**](AppleMDMApi.md#applemdms_enrollmentprofilesget) | **GET** /applemdms/{apple_mdm_id}/enrollmentprofiles/{id} | Get an Apple MDM Enrollment Profile +[**applemdms_enrollmentprofileslist**](AppleMDMApi.md#applemdms_enrollmentprofileslist) | **GET** /applemdms/{apple_mdm_id}/enrollmentprofiles | List Apple MDM Enrollment Profiles +[**applemdms_getdevice**](AppleMDMApi.md#applemdms_getdevice) | **GET** /applemdms/{apple_mdm_id}/devices/{device_id} | Details of an AppleMDM Device [**applemdms_list**](AppleMDMApi.md#applemdms_list) | **GET** /applemdms | List Apple MDMs -[**applemdms_post**](AppleMDMApi.md#applemdms_post) | **POST** /applemdms | Create Apple MDM -[**applemdms_put**](AppleMDMApi.md#applemdms_put) | **PUT** /applemdms/{apple_mdm_id} | Update an Apple MDM -[**enrollmentprofiles_get**](AppleMDMApi.md#enrollmentprofiles_get) | **GET** /applemdms/{apple_mdm_id}/enrollmentprofiles/{enrollment_profile_id} | Get an Apple MDM Enrollment Profile -[**enrollmentprofiles_list**](AppleMDMApi.md#enrollmentprofiles_list) | **GET** /applemdms/{apple_mdm_id}/enrollmentprofiles | List Apple MDM Enrollment Profiles +[**applemdms_put**](AppleMDMApi.md#applemdms_put) | **PUT** /applemdms/{id} | Update an Apple MDM +[**applemdms_refreshdepdevices**](AppleMDMApi.md#applemdms_refreshdepdevices) | **POST** /applemdms/{apple_mdm_id}/refreshdepdevices | Refresh DEP Devices +# **applemdms_csrget** +> AppleMdmSignedCsrPlist applemdms_csrget(apple_mdm_id, x_org_id=x_org_id) + +Get Apple MDM CSR Plist + +Retrieves an Apple MDM signed CSR Plist for an organization. The user must supply the returned plist to Apple for signing, and then provide the certificate provided by Apple back into the PUT API. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/csr \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AppleMDMApi(jcapiv2.ApiClient(configuration)) +apple_mdm_id = 'apple_mdm_id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Get Apple MDM CSR Plist + api_response = api_instance.applemdms_csrget(apple_mdm_id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling AppleMDMApi->applemdms_csrget: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **apple_mdm_id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**AppleMdmSignedCsrPlist**](AppleMdmSignedCsrPlist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **applemdms_delete** -> AppleMDM applemdms_delete(apple_mdm_id, content_type, accept, x_org_id=x_org_id) +> AppleMDM applemdms_delete(id, x_org_id=x_org_id) + +Delete an Apple MDM + +Removes an Apple MDM configuration. Warning: This is a destructive operation and will remove your Apple Push Certificates. We will no longer be able to manage your devices and the only recovery option is to re-register all devices into MDM. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/applemdms/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AppleMDMApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Delete an Apple MDM + api_response = api_instance.applemdms_delete(id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling AppleMDMApi->applemdms_delete: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**AppleMDM**](AppleMDM.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **applemdms_deletedevice** +> AppleMdmDevice applemdms_deletedevice(apple_mdm_id, device_id, x_org_id=x_org_id) + +Remove an Apple MDM Device's Enrollment + +Remove a single Apple MDM device from MDM enrollment. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id} \\ -H 'accept: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AppleMDMApi(jcapiv2.ApiClient(configuration)) +apple_mdm_id = 'apple_mdm_id_example' # str | +device_id = 'device_id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Remove an Apple MDM Device's Enrollment + api_response = api_instance.applemdms_deletedevice(apple_mdm_id, device_id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling AppleMDMApi->applemdms_deletedevice: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **apple_mdm_id** | **str**| | + **device_id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**AppleMdmDevice**](AppleMdmDevice.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **applemdms_depkeyget** +> AppleMdmPublicKeyCert applemdms_depkeyget(apple_mdm_id, x_org_id=x_org_id) + +Get Apple MDM DEP Public Key + +Retrieves an Apple MDM DEP Public Key. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AppleMDMApi(jcapiv2.ApiClient(configuration)) +apple_mdm_id = 'apple_mdm_id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Get Apple MDM DEP Public Key + api_response = api_instance.applemdms_depkeyget(apple_mdm_id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling AppleMDMApi->applemdms_depkeyget: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **apple_mdm_id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**AppleMdmPublicKeyCert**](AppleMdmPublicKeyCert.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/x-pem-file + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **applemdms_devices_clear_activation_lock** +> applemdms_devices_clear_activation_lock(apple_mdm_id, device_id, x_org_id=x_org_id) + +Clears the Activation Lock for a Device + +Clears the activation lock on the specified device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/clearActivationLock \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AppleMDMApi(jcapiv2.ApiClient(configuration)) +apple_mdm_id = 'apple_mdm_id_example' # str | +device_id = 'device_id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Clears the Activation Lock for a Device + api_instance.applemdms_devices_clear_activation_lock(apple_mdm_id, device_id, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling AppleMDMApi->applemdms_devices_clear_activation_lock: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **apple_mdm_id** | **str**| | + **device_id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **applemdms_devices_refresh_activation_lock_information** +> applemdms_devices_refresh_activation_lock_information(apple_mdm_id, device_id, x_org_id=x_org_id) + +Refresh activation lock information for a device + +Refreshes the activation lock information for a device #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/refreshActivationLockInformation \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AppleMDMApi(jcapiv2.ApiClient(configuration)) +apple_mdm_id = 'apple_mdm_id_example' # str | +device_id = 'device_id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Refresh activation lock information for a device + api_instance.applemdms_devices_refresh_activation_lock_information(apple_mdm_id, device_id, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling AppleMDMApi->applemdms_devices_refresh_activation_lock_information: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **apple_mdm_id** | **str**| | + **device_id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **applemdms_deviceserase** +> applemdms_deviceserase(apple_mdm_id, device_id, body=body, x_org_id=x_org_id) + +Erase Device + +Erases a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/erase \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint -Delete an Apple MDM +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' -Removes an Apple MDM configuration. Warning: This is a destructive operation and will remove your Apple Push Certificates. We will no longer be able to manage your devices and the only recovery option is to re-register all devices into MDM. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/applemdms/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +# create an instance of the API class +api_instance = jcapiv2.AppleMDMApi(jcapiv2.ApiClient(configuration)) +apple_mdm_id = 'apple_mdm_id_example' # str | +device_id = 'device_id_example' # str | +body = jcapiv2.DeviceIdEraseBody() # DeviceIdEraseBody | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Erase Device + api_instance.applemdms_deviceserase(apple_mdm_id, device_id, body=body, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling AppleMDMApi->applemdms_deviceserase: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **apple_mdm_id** | **str**| | + **device_id** | **str**| | + **body** | [**DeviceIdEraseBody**](DeviceIdEraseBody.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **applemdms_deviceslist** +> list[AppleMdmDevice] applemdms_deviceslist(apple_mdm_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter, sort=sort, x_total_count=x_total_count) + +List AppleMDM Devices + +Lists all Apple MDM devices. The filter and sort queries will allow the following fields: `createdAt` `depRegistered` `enrolled` `id` `osVersion` `serialNumber` `udid` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices \\ -H 'accept: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` ### Example ```python @@ -36,16 +445,19 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.AppleMDMApi(jcapiv2.ApiClient(configuration)) apple_mdm_id = 'apple_mdm_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_total_count = 56 # int | (optional) try: - # Delete an Apple MDM - api_response = api_instance.applemdms_delete(apple_mdm_id, content_type, accept, x_org_id=x_org_id) + # List AppleMDM Devices + api_response = api_instance.applemdms_deviceslist(apple_mdm_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter, sort=sort, x_total_count=x_total_count) pprint(api_response) except ApiException as e: - print("Exception when calling AppleMDMApi->applemdms_delete: %s\n" % e) + print("Exception when calling AppleMDMApi->applemdms_deviceslist: %s\n" % e) ``` ### Parameters @@ -53,13 +465,16 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apple_mdm_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_total_count** | **int**| | [optional] ### Return type -[**AppleMDM**](AppleMDM.md) +[**list[AppleMdmDevice]**](AppleMdmDevice.md) ### Authorization @@ -67,17 +482,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **applemdms_list** -> list[AppleMDM] applemdms_list(content_type, accept, x_org_id=x_org_id) +# **applemdms_deviceslock** +> applemdms_deviceslock(apple_mdm_id, device_id, body=body, x_org_id=x_org_id) -List Apple MDMs +Lock Device -Get a list of all Apple MDM configurations. An empty topic indicates that a signed certificate from Apple has not been provided to the PUT endpoint yet. Note: currently only one MDM configuration per organization is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +Locks a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/lock \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` ### Example ```python @@ -95,29 +510,30 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.AppleMDMApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +apple_mdm_id = 'apple_mdm_id_example' # str | +device_id = 'device_id_example' # str | +body = jcapiv2.DeviceIdLockBody() # DeviceIdLockBody | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # List Apple MDMs - api_response = api_instance.applemdms_list(content_type, accept, x_org_id=x_org_id) - pprint(api_response) + # Lock Device + api_instance.applemdms_deviceslock(apple_mdm_id, device_id, body=body, x_org_id=x_org_id) except ApiException as e: - print("Exception when calling AppleMDMApi->applemdms_list: %s\n" % e) + print("Exception when calling AppleMDMApi->applemdms_deviceslock: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **apple_mdm_id** | **str**| | + **device_id** | **str**| | + **body** | [**DeviceIdLockBody**](DeviceIdLockBody.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -[**list[AppleMDM]**](AppleMDM.md) +void (empty response body) ### Authorization @@ -130,12 +546,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **applemdms_post** -> InlineResponse201 applemdms_post(content_type, accept, body=body, x_org_id=x_org_id) +# **applemdms_devicesrestart** +> applemdms_devicesrestart(apple_mdm_id, device_id, body=body, x_org_id=x_org_id) -Create Apple MDM +Restart Device -Creates an Apple MDM Enrollment for an organization. Only one enrollment per organization will be allowed. Note that this is the first step in completly setting up an MDM Enrollment. The user must supply the returned plist to Apple for signing, and then provide the certificate provided by Apple back into the PUT API. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/organizations/{Organization_ID}/mdm \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` +Restarts a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/restart \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"kextPaths\": [\"Path1\", \"Path2\"]}' ``` ### Example ```python @@ -153,31 +569,30 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.AppleMDMApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.Body() # Body | (optional) -x_org_id = '' # str | (optional) (default to ) +apple_mdm_id = 'apple_mdm_id_example' # str | +device_id = 'device_id_example' # str | +body = jcapiv2.DeviceIdRestartBody() # DeviceIdRestartBody | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # Create Apple MDM - api_response = api_instance.applemdms_post(content_type, accept, body=body, x_org_id=x_org_id) - pprint(api_response) + # Restart Device + api_instance.applemdms_devicesrestart(apple_mdm_id, device_id, body=body, x_org_id=x_org_id) except ApiException as e: - print("Exception when calling AppleMDMApi->applemdms_post: %s\n" % e) + print("Exception when calling AppleMDMApi->applemdms_devicesrestart: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**Body**](Body.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **apple_mdm_id** | **str**| | + **device_id** | **str**| | + **body** | [**DeviceIdRestartBody**](DeviceIdRestartBody.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -[**InlineResponse201**](InlineResponse201.md) +void (empty response body) ### Authorization @@ -190,12 +605,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **applemdms_put** -> AppleMDM applemdms_put(apple_mdm_id, content_type, accept, body=body, x_org_id=x_org_id) +# **applemdms_devicesshutdown** +> applemdms_devicesshutdown(apple_mdm_id, device_id, x_org_id=x_org_id) -Update an Apple MDM +Shut Down Device -Updates an Apple MDM configuration. This endpoint is used to supply JumpCloud with a signed certificate from Apple in order to finalize the setup and allow JumpCloud to manage your devices. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/applemdms/{ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"MDM name\", \"appleSignedCert\": \"{CERTIFICATE}\" }' ``` +Shuts down a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/shutdown \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` ### Example ```python @@ -214,17 +629,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.AppleMDMApi(jcapiv2.ApiClient(configuration)) apple_mdm_id = 'apple_mdm_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.AppleMdmPatchInput() # AppleMdmPatchInput | (optional) -x_org_id = '' # str | (optional) (default to ) +device_id = 'device_id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # Update an Apple MDM - api_response = api_instance.applemdms_put(apple_mdm_id, content_type, accept, body=body, x_org_id=x_org_id) - pprint(api_response) + # Shut Down Device + api_instance.applemdms_devicesshutdown(apple_mdm_id, device_id, x_org_id=x_org_id) except ApiException as e: - print("Exception when calling AppleMDMApi->applemdms_put: %s\n" % e) + print("Exception when calling AppleMDMApi->applemdms_devicesshutdown: %s\n" % e) ``` ### Parameters @@ -232,14 +644,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apple_mdm_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**AppleMdmPatchInput**](AppleMdmPatchInput.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **device_id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -[**AppleMDM**](AppleMDM.md) +void (empty response body) ### Authorization @@ -247,17 +657,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **enrollmentprofiles_get** -> Mobileconfig enrollmentprofiles_get(apple_mdm_id, enrollment_profile_id, content_type, accept, x_org_id=x_org_id) +# **applemdms_enrollmentprofilesget** +> Mobileconfig applemdms_enrollmentprofilesget(apple_mdm_id, id, x_org_id=x_org_id) Get an Apple MDM Enrollment Profile -Get an enrollment profile Currently only requesting the mobileconfig is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles/{ENROLLMENT_PROFILE_ID} \\ -H 'accept: application/x-apple-aspen-config' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +Get an enrollment profile Currently only requesting the mobileconfig is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles/{ID} \\ -H 'accept: application/x-apple-aspen-config' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -276,17 +686,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.AppleMDMApi(jcapiv2.ApiClient(configuration)) apple_mdm_id = 'apple_mdm_id_example' # str | -enrollment_profile_id = 'enrollment_profile_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +id = 'id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Get an Apple MDM Enrollment Profile - api_response = api_instance.enrollmentprofiles_get(apple_mdm_id, enrollment_profile_id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.applemdms_enrollmentprofilesget(apple_mdm_id, id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: - print("Exception when calling AppleMDMApi->enrollmentprofiles_get: %s\n" % e) + print("Exception when calling AppleMDMApi->applemdms_enrollmentprofilesget: %s\n" % e) ``` ### Parameters @@ -294,10 +702,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apple_mdm_id** | **str**| | - **enrollment_profile_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -309,17 +715,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/x-apple-aspen-config [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **enrollmentprofiles_list** -> list[AppleMDM] enrollmentprofiles_list(apple_mdm_id, content_type, accept, x_org_id=x_org_id) +# **applemdms_enrollmentprofileslist** +> list[AppleMDM] applemdms_enrollmentprofileslist(apple_mdm_id, x_org_id=x_org_id) List Apple MDM Enrollment Profiles -Get a list of enrollment profiles for an apple mdm. Note: currently only one enrollment profile is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +Get a list of enrollment profiles for an apple mdm. Note: currently only one enrollment profile is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -338,16 +744,71 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.AppleMDMApi(jcapiv2.ApiClient(configuration)) apple_mdm_id = 'apple_mdm_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List Apple MDM Enrollment Profiles - api_response = api_instance.enrollmentprofiles_list(apple_mdm_id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.applemdms_enrollmentprofileslist(apple_mdm_id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling AppleMDMApi->applemdms_enrollmentprofileslist: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **apple_mdm_id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**list[AppleMDM]**](AppleMDM.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **applemdms_getdevice** +> AppleMdmDevice applemdms_getdevice(apple_mdm_id, device_id, x_org_id=x_org_id) + +Details of an AppleMDM Device + +Gets a single Apple MDM device. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id} \\ -H 'accept: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AppleMDMApi(jcapiv2.ApiClient(configuration)) +apple_mdm_id = 'apple_mdm_id_example' # str | +device_id = 'device_id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Details of an AppleMDM Device + api_response = api_instance.applemdms_getdevice(apple_mdm_id, device_id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: - print("Exception when calling AppleMDMApi->enrollmentprofiles_list: %s\n" % e) + print("Exception when calling AppleMDMApi->applemdms_getdevice: %s\n" % e) ``` ### Parameters @@ -355,9 +816,62 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **apple_mdm_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **device_id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**AppleMdmDevice**](AppleMdmDevice.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **applemdms_list** +> list[AppleMDM] applemdms_list(x_org_id=x_org_id) + +List Apple MDMs + +Get a list of all Apple MDM configurations. An empty topic indicates that a signed certificate from Apple has not been provided to the PUT endpoint yet. Note: currently only one MDM configuration per organization is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AppleMDMApi(jcapiv2.ApiClient(configuration)) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List Apple MDMs + api_response = api_instance.applemdms_list(x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling AppleMDMApi->applemdms_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -367,6 +881,64 @@ Name | Type | Description | Notes [x-api-key](../README.md#x-api-key) +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **applemdms_put** +> AppleMDM applemdms_put(id, body=body, x_org_id=x_org_id) + +Update an Apple MDM + +Updates an Apple MDM configuration. This endpoint is used to supply JumpCloud with a signed certificate from Apple in order to finalize the setup and allow JumpCloud to manage your devices. It may also be used to update the DEP Settings. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/applemdms/{ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"MDM name\", \"appleSignedCert\": \"{CERTIFICATE}\", \"encryptedDepServerToken\": \"{SERVER_TOKEN}\", \"dep\": { \"welcomeScreen\": { \"title\": \"Welcome\", \"paragraph\": \"In just a few steps, you will be working securely from your Mac.\", \"button\": \"continue\", }, }, }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AppleMDMApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | +body = jcapiv2.AppleMdmPatchInput() # AppleMdmPatchInput | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Update an Apple MDM + api_response = api_instance.applemdms_put(id, body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling AppleMDMApi->applemdms_put: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **body** | [**AppleMdmPatchInput**](AppleMdmPatchInput.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**AppleMDM**](AppleMDM.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + ### HTTP request headers - **Content-Type**: application/json @@ -374,3 +946,58 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **applemdms_refreshdepdevices** +> applemdms_refreshdepdevices(apple_mdm_id, x_org_id=x_org_id) + +Refresh DEP Devices + +Refreshes the list of devices that a JumpCloud admin has added to their virtual MDM in Apple Business Manager - ABM so that they can be DEP enrolled with JumpCloud. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/refreshdepdevices \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AppleMDMApi(jcapiv2.ApiClient(configuration)) +apple_mdm_id = 'apple_mdm_id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Refresh DEP Devices + api_instance.applemdms_refreshdepdevices(apple_mdm_id, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling AppleMDMApi->applemdms_refreshdepdevices: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **apple_mdm_id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AppleMdmDevice.md b/jcapiv2/docs/AppleMdmDevice.md new file mode 100644 index 0000000..c019f31 --- /dev/null +++ b/jcapiv2/docs/AppleMdmDevice.md @@ -0,0 +1,18 @@ +# AppleMdmDevice + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **str** | | [optional] +**dep_registered** | **bool** | | [optional] +**device_information** | [**AppleMdmDeviceInfo**](AppleMdmDeviceInfo.md) | | [optional] +**enrolled** | **bool** | | [optional] +**has_activation_lock_bypass_codes** | **bool** | | [optional] +**id** | **str** | | [optional] +**os_version** | **str** | | [optional] +**security_info** | [**AppleMdmDeviceSecurityInfo**](AppleMdmDeviceSecurityInfo.md) | | [optional] +**serial_number** | **str** | | [optional] +**udid** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AppleMdmDeviceInfo.md b/jcapiv2/docs/AppleMdmDeviceInfo.md new file mode 100644 index 0000000..8860948 --- /dev/null +++ b/jcapiv2/docs/AppleMdmDeviceInfo.md @@ -0,0 +1,22 @@ +# AppleMdmDeviceInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**activation_lock_allowed_while_supervised** | **bool** | | [optional] +**available_device_capacity** | **float** | | [optional] +**device_capacity** | **float** | | [optional] +**device_name** | **str** | | [optional] +**iccid** | **str** | | [optional] +**imei** | **str** | | [optional] +**is_activation_lock_enabled** | **bool** | | [optional] +**is_supervised** | **bool** | | [optional] +**model_name** | **str** | | [optional] +**second_iccid** | **str** | | [optional] +**second_imei** | **str** | | [optional] +**second_subscriber_carrier_network** | **str** | | [optional] +**subscriber_carrier_network** | **str** | | [optional] +**wifi_mac** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AppleMdmDeviceSecurityInfo.md b/jcapiv2/docs/AppleMdmDeviceSecurityInfo.md new file mode 100644 index 0000000..7407da2 --- /dev/null +++ b/jcapiv2/docs/AppleMdmDeviceSecurityInfo.md @@ -0,0 +1,13 @@ +# AppleMdmDeviceSecurityInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enrolled_via_dep** | **bool** | | [optional] +**is_activation_lock_manageable** | **bool** | | [optional] +**is_user_enrollment** | **bool** | | [optional] +**passcode_present** | **bool** | | [optional] +**user_approved_enrollment** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AppleMdmPatchInput.md b/jcapiv2/docs/AppleMdmPatchInput.md index ecb42ca..08ea67e 100644 --- a/jcapiv2/docs/AppleMdmPatchInput.md +++ b/jcapiv2/docs/AppleMdmPatchInput.md @@ -3,9 +3,14 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**ades** | [**ADES**](ADES.md) | | [optional] +**allow_mobile_user_enrollment** | **bool** | A toggle to allow mobile device enrollment for an organization. | [optional] **apple_signed_cert** | **str** | A signed certificate obtained from Apple after providing Apple with the plist file provided on POST. | [optional] +**default_ios_user_enrollment_device_group_id** | **str** | ObjectId uniquely identifying the MDM default iOS user enrollment device group. | [optional] +**default_system_group_id** | **str** | ObjectId uniquely identifying the MDM default System Group. | [optional] +**dep** | [**DEP**](DEP.md) | | [optional] +**encrypted_dep_server_token** | **str** | The S/MIME encoded DEP Server Token returned by Apple Business Manager when creating an MDM instance. | [optional] **name** | **str** | A new name for the Apple MDM configuration. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/OauthCodeInput.md b/jcapiv2/docs/AppleMdmPublicKeyCert.md similarity index 83% rename from jcapiv2/docs/OauthCodeInput.md rename to jcapiv2/docs/AppleMdmPublicKeyCert.md index 3066882..0460f43 100644 --- a/jcapiv2/docs/OauthCodeInput.md +++ b/jcapiv2/docs/AppleMdmPublicKeyCert.md @@ -1,10 +1,8 @@ -# OauthCodeInput +# AppleMdmPublicKeyCert ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/AppleMdmSignedCsrPlist.md b/jcapiv2/docs/AppleMdmSignedCsrPlist.md new file mode 100644 index 0000000..ecc696a --- /dev/null +++ b/jcapiv2/docs/AppleMdmSignedCsrPlist.md @@ -0,0 +1,8 @@ +# AppleMdmSignedCsrPlist + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ApplicationIdLogoBody.md b/jcapiv2/docs/ApplicationIdLogoBody.md new file mode 100644 index 0000000..c01f8ce --- /dev/null +++ b/jcapiv2/docs/ApplicationIdLogoBody.md @@ -0,0 +1,9 @@ +# ApplicationIdLogoBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**image** | **str** | The file to upload. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ApplicationsApi.md b/jcapiv2/docs/ApplicationsApi.md index dc880f4..7546e20 100644 --- a/jcapiv2/docs/ApplicationsApi.md +++ b/jcapiv2/docs/ApplicationsApi.md @@ -4,14 +4,184 @@ All URIs are relative to *https://console.jumpcloud.com/api/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**applications_delete_logo**](ApplicationsApi.md#applications_delete_logo) | **DELETE** /applications/{application_id}/logo | Delete application image +[**applications_get**](ApplicationsApi.md#applications_get) | **GET** /applications/{application_id} | Get an Application +[**applications_post_logo**](ApplicationsApi.md#applications_post_logo) | **POST** /applications/{application_id}/logo | [**graph_application_associations_list**](ApplicationsApi.md#graph_application_associations_list) | **GET** /applications/{application_id}/associations | List the associations of an Application [**graph_application_associations_post**](ApplicationsApi.md#graph_application_associations_post) | **POST** /applications/{application_id}/associations | Manage the associations of an Application [**graph_application_traverse_user**](ApplicationsApi.md#graph_application_traverse_user) | **GET** /applications/{application_id}/users | List the Users bound to an Application [**graph_application_traverse_user_group**](ApplicationsApi.md#graph_application_traverse_user_group) | **GET** /applications/{application_id}/usergroups | List the User Groups bound to an Application +[**import_users**](ApplicationsApi.md#import_users) | **GET** /applications/{application_id}/import/users | Get a list of users to import from an Application IdM service provider +# **applications_delete_logo** +> applications_delete_logo(application_id, x_org_id=x_org_id) + +Delete application image + +Deletes the specified image from an application + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ApplicationsApi(jcapiv2.ApiClient(configuration)) +application_id = 'application_id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Delete application image + api_instance.applications_delete_logo(application_id, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling ApplicationsApi->applications_delete_logo: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **application_id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **applications_get** +> object applications_get(application_id, x_org_id=x_org_id) + +Get an Application + +The endpoint retrieves an Application. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ApplicationsApi(jcapiv2.ApiClient(configuration)) +application_id = 'application_id_example' # str | ObjectID of the Application. +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Get an Application + api_response = api_instance.applications_get(application_id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ApplicationsApi->applications_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **application_id** | **str**| ObjectID of the Application. | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +**object** + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **applications_post_logo** +> applications_post_logo(application_id, image=image, x_org_id=x_org_id) + + + +This endpoint sets the logo for an application. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/logo \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ApplicationsApi(jcapiv2.ApiClient(configuration)) +application_id = 'application_id_example' # str | +image = 'image_example' # str | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + api_instance.applications_post_logo(application_id, image=image, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling ApplicationsApi->applications_post_logo: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **application_id** | **str**| | + **image** | **str**| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_application_associations_list** -> list[GraphConnection] graph_application_associations_list(application_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_application_associations_list(application_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of an Application @@ -34,16 +204,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.ApplicationsApi(jcapiv2.ApiClient(configuration)) application_id = 'application_id_example' # str | ObjectID of the Application. -targets = ['targets_example'] # list[str] | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +targets = ['targets_example'] # list[str] | Targets which a \"application\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of an Application - api_response = api_instance.graph_application_associations_list(application_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_application_associations_list(application_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling ApplicationsApi->graph_application_associations_list: %s\n" % e) @@ -54,12 +222,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **application_id** | **str**| ObjectID of the Application. | - **targets** | [**list[str]**](str.md)| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **targets** | [**list[str]**](str.md)| Targets which a \"application\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -71,17 +237,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_application_associations_post** -> graph_application_associations_post(application_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_application_associations_post(application_id, body=body, x_org_id=x_org_id) Manage the associations of an Application -This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` +This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` ### Example ```python @@ -100,14 +266,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.ApplicationsApi(jcapiv2.ApiClient(configuration)) application_id = 'application_id_example' # str | ObjectID of the Application. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.GraphManagementReq() # GraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationApplication() # GraphOperationApplication | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of an Application - api_instance.graph_application_associations_post(application_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_application_associations_post(application_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling ApplicationsApi->graph_application_associations_post: %s\n" % e) ``` @@ -117,10 +281,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **application_id** | **str**| ObjectID of the Application. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationApplication**](GraphOperationApplication.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -133,12 +295,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_application_traverse_user** -> list[GraphObjectWithPaths] graph_application_traverse_user(application_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_application_traverse_user(application_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Users bound to an Application @@ -161,16 +323,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.ApplicationsApi(jcapiv2.ApiClient(configuration)) application_id = 'application_id_example' # str | ObjectID of the Application. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Users bound to an Application - api_response = api_instance.graph_application_traverse_user(application_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_application_traverse_user(application_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling ApplicationsApi->graph_application_traverse_user: %s\n" % e) @@ -181,12 +341,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **application_id** | **str**| ObjectID of the Application. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -198,13 +356,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_application_traverse_user_group** -> list[GraphObjectWithPaths] graph_application_traverse_user_group(application_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_application_traverse_user_group(application_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the User Groups bound to an Application @@ -227,16 +385,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.ApplicationsApi(jcapiv2.ApiClient(configuration)) application_id = 'application_id_example' # str | ObjectID of the Application. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the User Groups bound to an Application - api_response = api_instance.graph_application_traverse_user_group(application_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_application_traverse_user_group(application_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling ApplicationsApi->graph_application_traverse_user_group: %s\n" % e) @@ -247,12 +403,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **application_id** | **str**| ObjectID of the Application. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -264,7 +418,75 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **import_users** +> ImportUsersResponse import_users(application_id, filter=filter, query=query, sort=sort, sort_order=sort_order, x_org_id=x_org_id, limit=limit, skip=skip) + +Get a list of users to import from an Application IdM service provider + +Get a list of users to import from an Application IdM service provider. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ApplicationsApi(jcapiv2.ApiClient(configuration)) +application_id = 'application_id_example' # str | ObjectID of the Application. +filter = 'filter_example' # str | Filter users by a search term (optional) +query = 'query_example' # str | URL query to merge with the service provider request (optional) +sort = 'sort_example' # str | Sort users by supported fields (optional) +sort_order = 'asc' # str | (optional) (default to asc) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) + +try: + # Get a list of users to import from an Application IdM service provider + api_response = api_instance.import_users(application_id, filter=filter, query=query, sort=sort, sort_order=sort_order, x_org_id=x_org_id, limit=limit, skip=skip) + pprint(api_response) +except ApiException as e: + print("Exception when calling ApplicationsApi->import_users: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **application_id** | **str**| ObjectID of the Application. | + **filter** | **str**| Filter users by a search term | [optional] + **query** | **str**| URL query to merge with the service provider request | [optional] + **sort** | **str**| Sort users by supported fields | [optional] + **sort_order** | **str**| | [optional] [default to asc] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + +### Return type + +[**ImportUsersResponse**](ImportUsersResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/AuthInfo.md b/jcapiv2/docs/AuthInfo.md index 4ad18cd..383d650 100644 --- a/jcapiv2/docs/AuthInfo.md +++ b/jcapiv2/docs/AuthInfo.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/AuthInput.md b/jcapiv2/docs/AuthInput.md index 2565a1b..9ff75b8 100644 --- a/jcapiv2/docs/AuthInput.md +++ b/jcapiv2/docs/AuthInput.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/AuthInputObject.md b/jcapiv2/docs/AuthInputObject.md index c90da71..cc28fd2 100644 --- a/jcapiv2/docs/AuthInputObject.md +++ b/jcapiv2/docs/AuthInputObject.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/AuthenticationPoliciesApi.md b/jcapiv2/docs/AuthenticationPoliciesApi.md new file mode 100644 index 0000000..7936b87 --- /dev/null +++ b/jcapiv2/docs/AuthenticationPoliciesApi.md @@ -0,0 +1,302 @@ +# jcapiv2.AuthenticationPoliciesApi + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**authnpolicies_delete**](AuthenticationPoliciesApi.md#authnpolicies_delete) | **DELETE** /authn/policies/{id} | Delete Authentication Policy +[**authnpolicies_get**](AuthenticationPoliciesApi.md#authnpolicies_get) | **GET** /authn/policies/{id} | Get an authentication policy +[**authnpolicies_list**](AuthenticationPoliciesApi.md#authnpolicies_list) | **GET** /authn/policies | List Authentication Policies +[**authnpolicies_patch**](AuthenticationPoliciesApi.md#authnpolicies_patch) | **PATCH** /authn/policies/{id} | Patch Authentication Policy +[**authnpolicies_post**](AuthenticationPoliciesApi.md#authnpolicies_post) | **POST** /authn/policies | Create an Authentication Policy + +# **authnpolicies_delete** +> AuthnPolicy authnpolicies_delete(id, x_org_id=x_org_id) + +Delete Authentication Policy + +Delete the specified authentication policy. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/authn/policies/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AuthenticationPoliciesApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | Unique identifier of the authentication policy +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Delete Authentication Policy + api_response = api_instance.authnpolicies_delete(id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling AuthenticationPoliciesApi->authnpolicies_delete: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Unique identifier of the authentication policy | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**AuthnPolicy**](AuthnPolicy.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **authnpolicies_get** +> AuthnPolicy authnpolicies_get(id, x_org_id=x_org_id) + +Get an authentication policy + +Return a specific authentication policy. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/authn/policies/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AuthenticationPoliciesApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | Unique identifier of the authentication policy +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Get an authentication policy + api_response = api_instance.authnpolicies_get(id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling AuthenticationPoliciesApi->authnpolicies_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Unique identifier of the authentication policy | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**AuthnPolicy**](AuthnPolicy.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **authnpolicies_list** +> list[AuthnPolicy] authnpolicies_list(x_org_id=x_org_id, x_total_count=x_total_count, limit=limit, skip=skip, filter=filter, sort=sort) + +List Authentication Policies + +Get a list of all authentication policies. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/authn/policies \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AuthenticationPoliciesApi(jcapiv2.ApiClient(configuration)) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +x_total_count = 56 # int | (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) + +try: + # List Authentication Policies + api_response = api_instance.authnpolicies_list(x_org_id=x_org_id, x_total_count=x_total_count, limit=limit, skip=skip, filter=filter, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling AuthenticationPoliciesApi->authnpolicies_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **x_total_count** | **int**| | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + +### Return type + +[**list[AuthnPolicy]**](AuthnPolicy.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **authnpolicies_patch** +> AuthnPolicy authnpolicies_patch(id, body=body, x_org_id=x_org_id) + +Patch Authentication Policy + +Patch the specified authentication policy. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/authn/policies/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"disabled\": false }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AuthenticationPoliciesApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | Unique identifier of the authentication policy +body = jcapiv2.AuthnPolicyInput() # AuthnPolicyInput | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Patch Authentication Policy + api_response = api_instance.authnpolicies_patch(id, body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling AuthenticationPoliciesApi->authnpolicies_patch: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Unique identifier of the authentication policy | + **body** | [**AuthnPolicyInput**](AuthnPolicyInput.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**AuthnPolicy**](AuthnPolicy.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **authnpolicies_post** +> AuthnPolicy authnpolicies_post(body=body, x_org_id=x_org_id) + +Create an Authentication Policy + +Create an authentication policy. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/authn/policies \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Sample Policy\", \"disabled\": false, \"effect\": { \"action\": \"allow\" }, \"targets\": { \"users\": { \"inclusions\": [\"ALL\"] }, \"userGroups\": { \"exclusions\": [{USER_GROUP_ID}] }, \"resources\": [ {\"type\": \"user_portal\" } ] }, \"conditions\":{ \"ipAddressIn\": [{IP_LIST_ID}] } }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.AuthenticationPoliciesApi(jcapiv2.ApiClient(configuration)) +body = jcapiv2.AuthnPolicyInput() # AuthnPolicyInput | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Create an Authentication Policy + api_response = api_instance.authnpolicies_post(body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling AuthenticationPoliciesApi->authnpolicies_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**AuthnPolicyInput**](AuthnPolicyInput.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**AuthnPolicy**](AuthnPolicy.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthinputBasic.md b/jcapiv2/docs/AuthinputBasic.md index 47d8a65..8656214 100644 --- a/jcapiv2/docs/AuthinputBasic.md +++ b/jcapiv2/docs/AuthinputBasic.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/AuthinputOauth.md b/jcapiv2/docs/AuthinputOauth.md index 0f9f000..a3055bf 100644 --- a/jcapiv2/docs/AuthinputOauth.md +++ b/jcapiv2/docs/AuthinputOauth.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/AuthnPolicy.md b/jcapiv2/docs/AuthnPolicy.md new file mode 100644 index 0000000..7bd3c71 --- /dev/null +++ b/jcapiv2/docs/AuthnPolicy.md @@ -0,0 +1,16 @@ +# AuthnPolicy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | **object** | | [optional] +**description** | **str** | | [optional] +**disabled** | **bool** | | [optional] +**effect** | [**AuthnPolicyEffect**](AuthnPolicyEffect.md) | | [optional] +**id** | **str** | | [optional] +**name** | **str** | | [optional] +**targets** | [**AuthnPolicyTargets**](AuthnPolicyTargets.md) | | [optional] +**type** | [**AuthnPolicyType**](AuthnPolicyType.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyEffect.md b/jcapiv2/docs/AuthnPolicyEffect.md new file mode 100644 index 0000000..d4a8578 --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyEffect.md @@ -0,0 +1,10 @@ +# AuthnPolicyEffect + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **str** | | +**obligations** | [**AuthnPolicyObligations**](AuthnPolicyObligations.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyInput.md b/jcapiv2/docs/AuthnPolicyInput.md new file mode 100644 index 0000000..50043c6 --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyInput.md @@ -0,0 +1,15 @@ +# AuthnPolicyInput + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**conditions** | **object** | | [optional] +**description** | **str** | | [optional] +**disabled** | **bool** | | [optional] +**effect** | [**AuthnPolicyEffect**](AuthnPolicyEffect.md) | | [optional] +**name** | **str** | | [optional] +**targets** | [**AuthnPolicyTargets**](AuthnPolicyTargets.md) | | [optional] +**type** | [**AuthnPolicyType**](AuthnPolicyType.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/DuoRegistrationApplication.md b/jcapiv2/docs/AuthnPolicyObligations.md similarity index 58% rename from jcapiv2/docs/DuoRegistrationApplication.md rename to jcapiv2/docs/AuthnPolicyObligations.md index e05672d..dde5149 100644 --- a/jcapiv2/docs/DuoRegistrationApplication.md +++ b/jcapiv2/docs/AuthnPolicyObligations.md @@ -1,12 +1,10 @@ -# DuoRegistrationApplication +# AuthnPolicyObligations ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**api_host** | **str** | Duo Application host name. | -**integration_key** | **str** | Duo Application integration key. | -**secret_key** | **str** | Duo Application secret key. | +**mfa** | [**AuthnPolicyObligationsMfa**](AuthnPolicyObligationsMfa.md) | | [optional] +**user_verification** | [**AuthnPolicyObligationsUserVerification**](AuthnPolicyObligationsUserVerification.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/AuthnPolicyObligationsMfa.md b/jcapiv2/docs/AuthnPolicyObligationsMfa.md new file mode 100644 index 0000000..aa8ce9c --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyObligationsMfa.md @@ -0,0 +1,9 @@ +# AuthnPolicyObligationsMfa + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**required** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Body.md b/jcapiv2/docs/AuthnPolicyObligationsUserVerification.md similarity index 76% rename from jcapiv2/docs/Body.md rename to jcapiv2/docs/AuthnPolicyObligationsUserVerification.md index 74f915c..974c79a 100644 --- a/jcapiv2/docs/Body.md +++ b/jcapiv2/docs/AuthnPolicyObligationsUserVerification.md @@ -1,10 +1,9 @@ -# Body +# AuthnPolicyObligationsUserVerification ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **str** | The name used to identify this AppleMDM. | [optional] +**requirement** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/AuthnPolicyResourceTarget.md b/jcapiv2/docs/AuthnPolicyResourceTarget.md new file mode 100644 index 0000000..71e786f --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyResourceTarget.md @@ -0,0 +1,10 @@ +# AuthnPolicyResourceTarget + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Object ID of the resource target. If undefined, then all resources of the given type are targeted. | [optional] +**type** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyTargets.md b/jcapiv2/docs/AuthnPolicyTargets.md new file mode 100644 index 0000000..97232dd --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyTargets.md @@ -0,0 +1,12 @@ +# AuthnPolicyTargets + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resources** | [**list[AuthnPolicyResourceTarget]**](AuthnPolicyResourceTarget.md) | | [optional] +**user_attributes** | [**AuthnPolicyUserAttributeTarget**](AuthnPolicyUserAttributeTarget.md) | | [optional] +**user_groups** | [**AuthnPolicyUserGroupTarget**](AuthnPolicyUserGroupTarget.md) | | [optional] +**users** | [**AuthnPolicyUserTarget**](AuthnPolicyUserTarget.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Systemuserbinding.md b/jcapiv2/docs/AuthnPolicyType.md similarity index 92% rename from jcapiv1/docs/Systemuserbinding.md rename to jcapiv2/docs/AuthnPolicyType.md index 5f56054..578ef3b 100644 --- a/jcapiv1/docs/Systemuserbinding.md +++ b/jcapiv2/docs/AuthnPolicyType.md @@ -1,4 +1,4 @@ -# Systemuserbinding +# AuthnPolicyType ## Properties Name | Type | Description | Notes @@ -6,4 +6,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/AuthnPolicyUserAttributeFilter.md b/jcapiv2/docs/AuthnPolicyUserAttributeFilter.md new file mode 100644 index 0000000..188bec3 --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyUserAttributeFilter.md @@ -0,0 +1,11 @@ +# AuthnPolicyUserAttributeFilter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field** | **str** | The only field that is currently supported is ldap_binding_user | [optional] +**operator** | **str** | | [optional] +**value** | [**AnyValue**](AnyValue.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyUserAttributeTarget.md b/jcapiv2/docs/AuthnPolicyUserAttributeTarget.md new file mode 100644 index 0000000..2fa8051 --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyUserAttributeTarget.md @@ -0,0 +1,10 @@ +# AuthnPolicyUserAttributeTarget + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**exclusions** | [**list[AuthnPolicyUserAttributeFilter]**](AuthnPolicyUserAttributeFilter.md) | | [optional] +**inclusions** | [**list[AuthnPolicyUserAttributeFilter]**](AuthnPolicyUserAttributeFilter.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyUserGroupTarget.md b/jcapiv2/docs/AuthnPolicyUserGroupTarget.md new file mode 100644 index 0000000..3b860b4 --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyUserGroupTarget.md @@ -0,0 +1,10 @@ +# AuthnPolicyUserGroupTarget + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**exclusions** | **list[str]** | | [optional] +**inclusions** | **list[str]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyUserTarget.md b/jcapiv2/docs/AuthnPolicyUserTarget.md new file mode 100644 index 0000000..58db6f2 --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyUserTarget.md @@ -0,0 +1,9 @@ +# AuthnPolicyUserTarget + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inclusions** | **list[str]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskCompany.md b/jcapiv2/docs/AutotaskCompany.md new file mode 100644 index 0000000..95bc70a --- /dev/null +++ b/jcapiv2/docs/AutotaskCompany.md @@ -0,0 +1,10 @@ +# AutotaskCompany + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The autotask company identifier. | +**name** | **str** | The autotask company name. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskCompanyResp.md b/jcapiv2/docs/AutotaskCompanyResp.md new file mode 100644 index 0000000..fbf759d --- /dev/null +++ b/jcapiv2/docs/AutotaskCompanyResp.md @@ -0,0 +1,10 @@ +# AutotaskCompanyResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**records** | [**list[AutotaskCompany]**](AutotaskCompany.md) | | +**total_count** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskCompanyTypeResp.md b/jcapiv2/docs/AutotaskCompanyTypeResp.md new file mode 100644 index 0000000..4f07422 --- /dev/null +++ b/jcapiv2/docs/AutotaskCompanyTypeResp.md @@ -0,0 +1,10 @@ +# AutotaskCompanyTypeResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**records** | [**list[BillingIntegrationCompanyType]**](BillingIntegrationCompanyType.md) | | +**total_count** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskContract.md b/jcapiv2/docs/AutotaskContract.md new file mode 100644 index 0000000..a842de2 --- /dev/null +++ b/jcapiv2/docs/AutotaskContract.md @@ -0,0 +1,11 @@ +# AutotaskContract + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**company_id** | **str** | The Autotask company identifier linked to contract. | +**id** | **str** | The contract identifier. | +**name** | **str** | The contract name. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskContractField.md b/jcapiv2/docs/AutotaskContractField.md new file mode 100644 index 0000000..b56b92f --- /dev/null +++ b/jcapiv2/docs/AutotaskContractField.md @@ -0,0 +1,10 @@ +# AutotaskContractField + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The contract field name. | +**values** | [**list[AutotaskContractFieldValues]**](AutotaskContractFieldValues.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Body1.md b/jcapiv2/docs/AutotaskContractFieldValues.md similarity index 72% rename from jcapiv1/docs/Body1.md rename to jcapiv2/docs/AutotaskContractFieldValues.md index c3c2460..4d2eb07 100644 --- a/jcapiv1/docs/Body1.md +++ b/jcapiv2/docs/AutotaskContractFieldValues.md @@ -1,11 +1,10 @@ -# Body1 +# AutotaskContractFieldValues ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**exclusion** | **bool** | | [optional] -**exclusion_until** | **datetime** | | [optional] +**label** | **str** | | [optional] +**value** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/AutotaskIntegration.md b/jcapiv2/docs/AutotaskIntegration.md new file mode 100644 index 0000000..d6df9db --- /dev/null +++ b/jcapiv2/docs/AutotaskIntegration.md @@ -0,0 +1,11 @@ +# AutotaskIntegration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The identifier for this Autotask integration. | +**is_msp_auth_configured** | **bool** | Has the msp-api been configured with auth data yet | [optional] +**username** | **str** | The username for connecting to Autotask. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskIntegrationPatchReq.md b/jcapiv2/docs/AutotaskIntegrationPatchReq.md new file mode 100644 index 0000000..c1430be --- /dev/null +++ b/jcapiv2/docs/AutotaskIntegrationPatchReq.md @@ -0,0 +1,10 @@ +# AutotaskIntegrationPatchReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**secret** | **str** | The secret for connecting to Autotask. | [optional] +**username** | **str** | The username for connecting to Autotask. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskIntegrationReq.md b/jcapiv2/docs/AutotaskIntegrationReq.md new file mode 100644 index 0000000..7459632 --- /dev/null +++ b/jcapiv2/docs/AutotaskIntegrationReq.md @@ -0,0 +1,10 @@ +# AutotaskIntegrationReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**secret** | **str** | The secret for connecting to Autotask. | +**username** | **str** | The username for connecting to Autotask. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingRequest.md b/jcapiv2/docs/AutotaskMappingRequest.md new file mode 100644 index 0000000..4c1d60d --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingRequest.md @@ -0,0 +1,9 @@ +# AutotaskMappingRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**list[AutotaskMappingRequestData]**](AutotaskMappingRequestData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingRequestCompany.md b/jcapiv2/docs/AutotaskMappingRequestCompany.md new file mode 100644 index 0000000..6aef314 --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingRequestCompany.md @@ -0,0 +1,10 @@ +# AutotaskMappingRequestCompany + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**name** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingRequestContract.md b/jcapiv2/docs/AutotaskMappingRequestContract.md new file mode 100644 index 0000000..7d261a8 --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingRequestContract.md @@ -0,0 +1,8 @@ +# AutotaskMappingRequestContract + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingRequestData.md b/jcapiv2/docs/AutotaskMappingRequestData.md new file mode 100644 index 0000000..b4cb91e --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingRequestData.md @@ -0,0 +1,13 @@ +# AutotaskMappingRequestData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**company** | [**AutotaskMappingRequestCompany**](AutotaskMappingRequestCompany.md) | | +**contract** | [**AutotaskMappingRequestContract**](AutotaskMappingRequestContract.md) | | +**delete** | **bool** | | [optional] +**organization** | [**AutotaskMappingRequestOrganization**](AutotaskMappingRequestOrganization.md) | | +**service** | [**AutotaskMappingRequestService**](AutotaskMappingRequestService.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingRequestOrganization.md b/jcapiv2/docs/AutotaskMappingRequestOrganization.md new file mode 100644 index 0000000..5a44672 --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingRequestOrganization.md @@ -0,0 +1,10 @@ +# AutotaskMappingRequestOrganization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**name** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingRequestService.md b/jcapiv2/docs/AutotaskMappingRequestService.md new file mode 100644 index 0000000..40b3974 --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingRequestService.md @@ -0,0 +1,8 @@ +# AutotaskMappingRequestService + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingResponse.md b/jcapiv2/docs/AutotaskMappingResponse.md new file mode 100644 index 0000000..53e10ea --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingResponse.md @@ -0,0 +1,14 @@ +# AutotaskMappingResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**company** | [**AutotaskMappingResponseCompany**](AutotaskMappingResponseCompany.md) | | [optional] +**contract** | [**AutotaskMappingResponseContract**](AutotaskMappingResponseContract.md) | | [optional] +**last_sync_date_time** | **str** | | [optional] +**last_sync_status** | **str** | | [optional] +**organization** | [**AutotaskMappingResponseOrganization**](AutotaskMappingResponseOrganization.md) | | [optional] +**service** | [**AutotaskMappingResponseService**](AutotaskMappingResponseService.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/EnrollmentProfile.md b/jcapiv2/docs/AutotaskMappingResponseCompany.md similarity index 81% rename from jcapiv2/docs/EnrollmentProfile.md rename to jcapiv2/docs/AutotaskMappingResponseCompany.md index ecf6377..9a4c85c 100644 --- a/jcapiv2/docs/EnrollmentProfile.md +++ b/jcapiv2/docs/AutotaskMappingResponseCompany.md @@ -1,11 +1,10 @@ -# EnrollmentProfile +# AutotaskMappingResponseCompany ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**apple_mdm_id** | **str** | | [optional] **id** | **str** | | [optional] +**name** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/AutotaskMappingResponseContract.md b/jcapiv2/docs/AutotaskMappingResponseContract.md new file mode 100644 index 0000000..ceea7c8 --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingResponseContract.md @@ -0,0 +1,10 @@ +# AutotaskMappingResponseContract + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingResponseOrganization.md b/jcapiv2/docs/AutotaskMappingResponseOrganization.md new file mode 100644 index 0000000..ceedf47 --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingResponseOrganization.md @@ -0,0 +1,10 @@ +# AutotaskMappingResponseOrganization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingResponseService.md b/jcapiv2/docs/AutotaskMappingResponseService.md new file mode 100644 index 0000000..feeb687 --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingResponseService.md @@ -0,0 +1,11 @@ +# AutotaskMappingResponseService + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**name** | **str** | | [optional] +**non_billable_users** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskService.md b/jcapiv2/docs/AutotaskService.md new file mode 100644 index 0000000..0640463 --- /dev/null +++ b/jcapiv2/docs/AutotaskService.md @@ -0,0 +1,11 @@ +# AutotaskService + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract_id** | **str** | The autotask contract identifier linked to this contract service. | +**id** | **str** | The contract service identifier. | +**name** | **str** | The autotask service name linked to this contract service. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskSettings.md b/jcapiv2/docs/AutotaskSettings.md new file mode 100644 index 0000000..dea1060 --- /dev/null +++ b/jcapiv2/docs/AutotaskSettings.md @@ -0,0 +1,10 @@ +# AutotaskSettings + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**automatic_ticketing** | **bool** | Determine whether Autotask uses automatic ticketing | [optional] +**company_type_ids** | **list[int]** | The array of Autotask companyType IDs applicable to the Provider. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskSettingsPatchReq.md b/jcapiv2/docs/AutotaskSettingsPatchReq.md new file mode 100644 index 0000000..ae4f232 --- /dev/null +++ b/jcapiv2/docs/AutotaskSettingsPatchReq.md @@ -0,0 +1,10 @@ +# AutotaskSettingsPatchReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**automatic_ticketing** | **bool** | Determine whether Autotask uses automatic ticketing | [optional] +**company_type_ids** | **list[int]** | The array of Autotask companyType IDs applicable to the Provider. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskTicketingAlertConfiguration.md b/jcapiv2/docs/AutotaskTicketingAlertConfiguration.md new file mode 100644 index 0000000..9c110aa --- /dev/null +++ b/jcapiv2/docs/AutotaskTicketingAlertConfiguration.md @@ -0,0 +1,20 @@ +# AutotaskTicketingAlertConfiguration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **str** | | [optional] +**description** | **str** | | [optional] +**destination** | **str** | | [optional] +**display_name** | **str** | | [optional] +**due_days** | **int** | | [optional] +**id** | **int** | | [optional] +**priority** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | [optional] +**queue** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | [optional] +**resource** | [**AutotaskTicketingAlertConfigurationResource**](AutotaskTicketingAlertConfigurationResource.md) | | [optional] +**should_create_tickets** | **bool** | | [optional] +**source** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | [optional] +**status** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskTicketingAlertConfigurationList.md b/jcapiv2/docs/AutotaskTicketingAlertConfigurationList.md new file mode 100644 index 0000000..63862f8 --- /dev/null +++ b/jcapiv2/docs/AutotaskTicketingAlertConfigurationList.md @@ -0,0 +1,9 @@ +# AutotaskTicketingAlertConfigurationList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**records** | **list[AllOfAutotaskTicketingAlertConfigurationListRecordsItems]** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskTicketingAlertConfigurationOption.md b/jcapiv2/docs/AutotaskTicketingAlertConfigurationOption.md new file mode 100644 index 0000000..c65ad40 --- /dev/null +++ b/jcapiv2/docs/AutotaskTicketingAlertConfigurationOption.md @@ -0,0 +1,10 @@ +# AutotaskTicketingAlertConfigurationOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**values** | [**list[AutotaskTicketingAlertConfigurationOptionValues]**](AutotaskTicketingAlertConfigurationOptionValues.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskTicketingAlertConfigurationOptionValues.md b/jcapiv2/docs/AutotaskTicketingAlertConfigurationOptionValues.md new file mode 100644 index 0000000..a5ab0bc --- /dev/null +++ b/jcapiv2/docs/AutotaskTicketingAlertConfigurationOptionValues.md @@ -0,0 +1,10 @@ +# AutotaskTicketingAlertConfigurationOptionValues + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | **str** | | [optional] +**value** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskTicketingAlertConfigurationOptions.md b/jcapiv2/docs/AutotaskTicketingAlertConfigurationOptions.md new file mode 100644 index 0000000..aa3502f --- /dev/null +++ b/jcapiv2/docs/AutotaskTicketingAlertConfigurationOptions.md @@ -0,0 +1,10 @@ +# AutotaskTicketingAlertConfigurationOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**options** | [**list[AutotaskTicketingAlertConfigurationOption]**](AutotaskTicketingAlertConfigurationOption.md) | | [optional] +**resources** | [**list[AutotaskTicketingAlertConfigurationResource]**](AutotaskTicketingAlertConfigurationResource.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/UserGroupAttributesPosixGroups.md b/jcapiv2/docs/AutotaskTicketingAlertConfigurationPriority.md similarity index 88% rename from jcapiv2/docs/UserGroupAttributesPosixGroups.md rename to jcapiv2/docs/AutotaskTicketingAlertConfigurationPriority.md index d10db72..96a123c 100644 --- a/jcapiv2/docs/UserGroupAttributesPosixGroups.md +++ b/jcapiv2/docs/AutotaskTicketingAlertConfigurationPriority.md @@ -1,4 +1,4 @@ -# UserGroupAttributesPosixGroups +# AutotaskTicketingAlertConfigurationPriority ## Properties Name | Type | Description | Notes @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/AutotaskTicketingAlertConfigurationRequest.md b/jcapiv2/docs/AutotaskTicketingAlertConfigurationRequest.md new file mode 100644 index 0000000..0b2747b --- /dev/null +++ b/jcapiv2/docs/AutotaskTicketingAlertConfigurationRequest.md @@ -0,0 +1,16 @@ +# AutotaskTicketingAlertConfigurationRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**destination** | **str** | | +**due_days** | **int** | | +**priority** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | +**queue** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | [optional] +**resource** | [**AutotaskTicketingAlertConfigurationResource**](AutotaskTicketingAlertConfigurationResource.md) | | [optional] +**should_create_tickets** | **bool** | | +**source** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | [optional] +**status** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskTicketingAlertConfigurationResource.md b/jcapiv2/docs/AutotaskTicketingAlertConfigurationResource.md new file mode 100644 index 0000000..9cabba0 --- /dev/null +++ b/jcapiv2/docs/AutotaskTicketingAlertConfigurationResource.md @@ -0,0 +1,11 @@ +# AutotaskTicketingAlertConfigurationResource + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] +**role** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/BillingIntegrationCompanyType.md b/jcapiv2/docs/BillingIntegrationCompanyType.md new file mode 100644 index 0000000..dced4e5 --- /dev/null +++ b/jcapiv2/docs/BillingIntegrationCompanyType.md @@ -0,0 +1,10 @@ +# BillingIntegrationCompanyType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **float** | The company type identifier. | +**name** | **str** | The company type name. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/BulkJobRequestsApi.md b/jcapiv2/docs/BulkJobRequestsApi.md index c4136f9..c3c740b 100644 --- a/jcapiv2/docs/BulkJobRequestsApi.md +++ b/jcapiv2/docs/BulkJobRequestsApi.md @@ -4,19 +4,20 @@ All URIs are relative to *https://console.jumpcloud.com/api/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**bulk_user_states_create**](BulkJobRequestsApi.md#bulk_user_states_create) | **POST** /bulk/userstates | Create Scheduled Userstate Job +[**bulk_user_states_delete**](BulkJobRequestsApi.md#bulk_user_states_delete) | **DELETE** /bulk/userstates/{id} | Delete Scheduled Userstate Job +[**bulk_user_states_get_next_scheduled**](BulkJobRequestsApi.md#bulk_user_states_get_next_scheduled) | **GET** /bulk/userstates/eventlist/next | Gets the next scheduled state change for each user in a list of system users +[**bulk_user_states_list**](BulkJobRequestsApi.md#bulk_user_states_list) | **GET** /bulk/userstates | List Scheduled Userstate Change Jobs [**bulk_users_create**](BulkJobRequestsApi.md#bulk_users_create) | **POST** /bulk/users | Bulk Users Create [**bulk_users_create_results**](BulkJobRequestsApi.md#bulk_users_create_results) | **GET** /bulk/users/{job_id}/results | List Bulk Users Results [**bulk_users_update**](BulkJobRequestsApi.md#bulk_users_update) | **PATCH** /bulk/users | Bulk Users Update -[**jobs_get**](BulkJobRequestsApi.md#jobs_get) | **GET** /jobs/{id} | Get Job (incomplete) -[**jobs_results**](BulkJobRequestsApi.md#jobs_results) | **GET** /jobs/{id}/results | List Job Results +# **bulk_user_states_create** +> list[ScheduledUserstateResult] bulk_user_states_create(body=body, x_org_id=x_org_id) -# **bulk_users_create** -> JobId bulk_users_create(content_type, accept, body=body, x_org_id=x_org_id) - -Bulk Users Create +Create Scheduled Userstate Job -The endpoint allows you to create a bulk job to asynchronously create users. See [Create a System User](https://docs.jumpcloud.com/1.0/systemusers/create-a-system-user) for full list of attributes. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"email\":\"{email}\", \"firstname\":\"{firstname}\", \"lastname\":\"{firstname}\", \"username\":\"{username}\", \"attributes\":[ {\"name\":\"EmployeeID\",\"value\":\"0000\"}, {\"name\":\"Custom\",\"value\":\"attribute\"} ] } ] ``` +This endpoint allows you to create scheduled statechange jobs. #### Sample Request ``` curl -X POST \"https://console.jumpcloud.com/api/v2/bulk/userstates\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -d '{ \"user_ids\": [\"{User_ID_1}\", \"{User_ID_2}\", \"{User_ID_3}\"], \"state\": \"SUSPENDED\", \"start_date\": \"2000-01-01T00:00:00.000Z\" }' ``` ### Example ```python @@ -34,31 +35,27 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.BulkJobRequestsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = [jcapiv2.BulkUserCreate()] # list[BulkUserCreate] | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.BulkScheduledStatechangeCreate() # BulkScheduledStatechangeCreate | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # Bulk Users Create - api_response = api_instance.bulk_users_create(content_type, accept, body=body, x_org_id=x_org_id) + # Create Scheduled Userstate Job + api_response = api_instance.bulk_user_states_create(body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: - print("Exception when calling BulkJobRequestsApi->bulk_users_create: %s\n" % e) + print("Exception when calling BulkJobRequestsApi->bulk_user_states_create: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**list[BulkUserCreate]**](BulkUserCreate.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**BulkScheduledStatechangeCreate**](BulkScheduledStatechangeCreate.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -[**JobId**](JobId.md) +[**list[ScheduledUserstateResult]**](ScheduledUserstateResult.md) ### Authorization @@ -71,12 +68,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **bulk_users_create_results** -> list[JobWorkresult] bulk_users_create_results(job_id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +# **bulk_user_states_delete** +> bulk_user_states_delete(id, x_org_id=x_org_id) -List Bulk Users Results +Delete Scheduled Userstate Job -This endpoint will return the results of particular user import or update job request. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/bulk/users/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint deletes a scheduled statechange job. #### Sample Request ``` curl -X DELETE \"https://console.jumpcloud.com/api/v2/bulk/userstates/{ScheduledJob_ID}\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' ``` ### Example ```python @@ -94,35 +91,84 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.BulkJobRequestsApi(jcapiv2.ApiClient(configuration)) -job_id = 'job_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +id = 'id_example' # str | Unique identifier of the scheduled statechange job. +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Delete Scheduled Userstate Job + api_instance.bulk_user_states_delete(id, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling BulkJobRequestsApi->bulk_user_states_delete: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Unique identifier of the scheduled statechange job. | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **bulk_user_states_get_next_scheduled** +> InlineResponse200 bulk_user_states_get_next_scheduled(users, limit=limit, skip=skip) + +Gets the next scheduled state change for each user in a list of system users + +This endpoint is used to lookup the next upcoming scheduled state change for each user in the given list. The users parameter is limited to 100 items per request. #### Sample Request ``` curl -X GET \"https://console.jumpcloud.com/api/v2/bulk/userstates/eventlist/next?users={UserID1},{UserID2},{UserID3}\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.BulkJobRequestsApi(jcapiv2.ApiClient(configuration)) +users = ['users_example'] # list[str] | A list of system user IDs limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) try: - # List Bulk Users Results - api_response = api_instance.bulk_users_create_results(job_id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + # Gets the next scheduled state change for each user in a list of system users + api_response = api_instance.bulk_user_states_get_next_scheduled(users, limit=limit, skip=skip) pprint(api_response) except ApiException as e: - print("Exception when calling BulkJobRequestsApi->bulk_users_create_results: %s\n" % e) + print("Exception when calling BulkJobRequestsApi->bulk_user_states_get_next_scheduled: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **job_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **users** | [**list[str]**](str.md)| A list of system user IDs | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] ### Return type -[**list[JobWorkresult]**](JobWorkresult.md) +[**InlineResponse200**](InlineResponse200.md) ### Authorization @@ -130,17 +176,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **bulk_users_update** -> JobId bulk_users_update(content_type, accept, body=body, x_org_id=x_org_id) +# **bulk_user_states_list** +> list[ScheduledUserstateResult] bulk_user_states_list(limit=limit, filter=filter, skip=skip, x_org_id=x_org_id, userid=userid) -Bulk Users Update +List Scheduled Userstate Change Jobs -The endpoint allows you to create a bulk job to asynchronously update users. See [Update a System User](https://docs.jumpcloud.com/1.0/systemusers/update-a-system-user) for full list of attributes. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"department\":\"{UPDATED_DEPARTMENT}\", \"attributes\":[ {\"name\":\"Custom\",\"value\":\"{ATTRIBUTE_VALUE}\"} ] }, { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"costCenter\":\"{UPDATED_COST_CENTER}\", \"phoneNumbers\":[ {\"type\":\"home\",\"number\":\"{HOME_PHONE_NUMBER}\"}, {\"type\":\"work\",\"number\":\"{WORK_PHONE_NUMBER}\"} ] } ] ``` +The endpoint allows you to list scheduled statechange jobs. #### Sample Request ``` curl -X GET \"https://console.jumpcloud.com/api/v2/bulk/userstates\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' ``` ### Example ```python @@ -158,31 +204,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.BulkJobRequestsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = [jcapiv2.BulkUserUpdate()] # list[BulkUserUpdate] | (optional) -x_org_id = '' # str | (optional) (default to ) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +userid = 'userid_example' # str | The systemuser id to filter by. (optional) try: - # Bulk Users Update - api_response = api_instance.bulk_users_update(content_type, accept, body=body, x_org_id=x_org_id) + # List Scheduled Userstate Change Jobs + api_response = api_instance.bulk_user_states_list(limit=limit, filter=filter, skip=skip, x_org_id=x_org_id, userid=userid) pprint(api_response) except ApiException as e: - print("Exception when calling BulkJobRequestsApi->bulk_users_update: %s\n" % e) + print("Exception when calling BulkJobRequestsApi->bulk_user_states_list: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**list[BulkUserUpdate]**](BulkUserUpdate.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **userid** | **str**| The systemuser id to filter by. | [optional] ### Return type -[**JobId**](JobId.md) +[**list[ScheduledUserstateResult]**](ScheduledUserstateResult.md) ### Authorization @@ -190,17 +238,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **jobs_get** -> JobDetails jobs_get(id, content_type, accept, x_org_id=x_org_id) +# **bulk_users_create** +> JobId bulk_users_create(body=body, x_org_id=x_org_id, creation_source=creation_source) -Get Job (incomplete) +Bulk Users Create -**This endpoint is not complete and should remain hidden as it's not functional yet.** +The endpoint allows you to create a bulk job to asynchronously create users. See [Create a System User](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_post) for the full list of attributes. #### Default User State The `state` of each user in the request can be explicitly passed in or omitted. If `state` is omitted, then the user will get created using the value returned from the [Get an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organizations_get) endpoint. The default user state for bulk created users depends on the `creation-source` header. For `creation-source:jumpcloud:bulk` the default state is stored in `settings.newSystemUserStateDefaults.csvImport`. For other `creation-source` header values, the default state is stored in `settings.newSystemUserStateDefaults.applicationImport` These default state values can be changed in the admin portal settings or by using the [Update an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organization_put) endpoint. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"email\":\"{email}\", \"firstname\":\"{firstname}\", \"lastname\":\"{firstname}\", \"username\":\"{username}\", \"attributes\":[ { \"name\":\"EmployeeID\", \"value\":\"0000\" }, { \"name\":\"Custom\", \"value\":\"attribute\" } ] } ]' ``` ### Example ```python @@ -218,31 +266,29 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.BulkJobRequestsApi(jcapiv2.ApiClient(configuration)) -id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +body = [jcapiv2.BulkUserCreate()] # list[BulkUserCreate] | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +creation_source = 'jumpcloud:bulk' # str | Defines the creation-source header for gapps, o365 and workdays requests. If the header isn't sent, the default value is `jumpcloud:bulk`, if you send the header with a malformed value you receive a 400 error. (optional) (default to jumpcloud:bulk) try: - # Get Job (incomplete) - api_response = api_instance.jobs_get(id, content_type, accept, x_org_id=x_org_id) + # Bulk Users Create + api_response = api_instance.bulk_users_create(body=body, x_org_id=x_org_id, creation_source=creation_source) pprint(api_response) except ApiException as e: - print("Exception when calling BulkJobRequestsApi->jobs_get: %s\n" % e) + print("Exception when calling BulkJobRequestsApi->bulk_users_create: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**list[BulkUserCreate]**](BulkUserCreate.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **creation_source** | **str**| Defines the creation-source header for gapps, o365 and workdays requests. If the header isn't sent, the default value is `jumpcloud:bulk`, if you send the header with a malformed value you receive a 400 error. | [optional] [default to jumpcloud:bulk] ### Return type -[**JobDetails**](JobDetails.md) +[**JobId**](JobId.md) ### Authorization @@ -255,12 +301,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **jobs_results** -> list[JobWorkresult] jobs_results(id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +# **bulk_users_create_results** +> list[JobWorkresult] bulk_users_create_results(job_id, limit=limit, skip=skip, x_org_id=x_org_id) -List Job Results +List Bulk Users Results -This endpoint will return the results of particular import job request. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/jobs/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint will return the results of particular user import or update job request. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/bulk/users/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -278,31 +324,27 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.BulkJobRequestsApi(jcapiv2.ApiClient(configuration)) -id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +job_id = 'job_id_example' # str | limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # List Job Results - api_response = api_instance.jobs_results(id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + # List Bulk Users Results + api_response = api_instance.bulk_users_create_results(job_id, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: - print("Exception when calling BulkJobRequestsApi->jobs_results: %s\n" % e) + print("Exception when calling BulkJobRequestsApi->bulk_users_create_results: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **job_id** | **str**| | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -312,6 +354,62 @@ Name | Type | Description | Notes [x-api-key](../README.md#x-api-key) +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **bulk_users_update** +> JobId bulk_users_update(body=body, x_org_id=x_org_id) + +Bulk Users Update + +The endpoint allows you to create a bulk job to asynchronously update users. See [Update a System User](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_put) for full list of attributes. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"department\":\"{UPDATED_DEPARTMENT}\", \"attributes\":[ {\"name\":\"Custom\",\"value\":\"{ATTRIBUTE_VALUE}\"} ] }, { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"costCenter\":\"{UPDATED_COST_CENTER}\", \"phoneNumbers\":[ {\"type\":\"home\",\"number\":\"{HOME_PHONE_NUMBER}\"}, {\"type\":\"work\",\"number\":\"{WORK_PHONE_NUMBER}\"} ] } ] ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.BulkJobRequestsApi(jcapiv2.ApiClient(configuration)) +body = [jcapiv2.BulkUserUpdate()] # list[BulkUserUpdate] | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Bulk Users Update + api_response = api_instance.bulk_users_update(body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling BulkJobRequestsApi->bulk_users_update: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**list[BulkUserUpdate]**](BulkUserUpdate.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**JobId**](JobId.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + ### HTTP request headers - **Content-Type**: application/json diff --git a/jcapiv2/docs/BulkScheduledStatechangeCreate.md b/jcapiv2/docs/BulkScheduledStatechangeCreate.md new file mode 100644 index 0000000..06acec7 --- /dev/null +++ b/jcapiv2/docs/BulkScheduledStatechangeCreate.md @@ -0,0 +1,13 @@ +# BulkScheduledStatechangeCreate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**activation_email_override** | **str** | Send the activation or welcome email to the specified email address upon activation. Can only be used with a single user_id and scheduled activation. This field will be ignored if `send_activation_emails` is explicitly set to false. | [optional] +**send_activation_emails** | **bool** | Set to true to send activation or welcome email(s) to each user_id upon activation. Set to false to suppress emails. Can only be used with scheduled activation(s). | [optional] +**start_date** | **datetime** | Date and time that scheduled action should occur | +**state** | **str** | The state to move the user(s) to | +**user_ids** | **list[str]** | Array of system user ids to schedule for a state change | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/BulkUserCreate.md b/jcapiv2/docs/BulkUserCreate.md index 9f84e71..0464d27 100644 --- a/jcapiv2/docs/BulkUserCreate.md +++ b/jcapiv2/docs/BulkUserCreate.md @@ -11,4 +11,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/BulkUserUpdate.md b/jcapiv2/docs/BulkUserUpdate.md index 800462f..d82ecaa 100644 --- a/jcapiv2/docs/BulkUserUpdate.md +++ b/jcapiv2/docs/BulkUserUpdate.md @@ -12,4 +12,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/CommandResultList.md b/jcapiv2/docs/CommandResultList.md new file mode 100644 index 0000000..9a9da45 --- /dev/null +++ b/jcapiv2/docs/CommandResultList.md @@ -0,0 +1,10 @@ +# CommandResultList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**list[CommandResultListResults]**](CommandResultListResults.md) | | [optional] +**total_count** | **int** | The total number of command results | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/CommandResultListResults.md b/jcapiv2/docs/CommandResultListResults.md new file mode 100644 index 0000000..6df370b --- /dev/null +++ b/jcapiv2/docs/CommandResultListResults.md @@ -0,0 +1,13 @@ +# CommandResultListResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**command** | **str** | The ID of the command, from savedAgentCommands. | [optional] +**completed_count** | **int** | The number of devices that we do have results from. | [optional] +**id** | **str** | The workflowInstanceId. | [optional] +**pending_count** | **int** | The number of devices that we haven't received results from. | [optional] +**system** | **str** | The ID of the device the command is bound to. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/CommandResultsApi.md b/jcapiv2/docs/CommandResultsApi.md new file mode 100644 index 0000000..45648a2 --- /dev/null +++ b/jcapiv2/docs/CommandResultsApi.md @@ -0,0 +1,68 @@ +# jcapiv2.CommandResultsApi + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**commands_list_results_by_workflow**](CommandResultsApi.md#commands_list_results_by_workflow) | **GET** /commandresult/workflows | List all Command Results by Workflow + +# **commands_list_results_by_workflow** +> CommandResultList commands_list_results_by_workflow(x_org_id=x_org_id, limit=limit, filter=filter, skip=skip) + +List all Command Results by Workflow + +This endpoint returns all command results, grouped by workflowInstanceId. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commandresult/workflows \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key:{API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.CommandResultsApi(jcapiv2.ApiClient(configuration)) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) + +try: + # List all Command Results by Workflow + api_response = api_instance.commands_list_results_by_workflow(x_org_id=x_org_id, limit=limit, filter=filter, skip=skip) + pprint(api_response) +except ApiException as e: + print("Exception when calling CommandResultsApi->commands_list_results_by_workflow: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + +### Return type + +[**CommandResultList**](CommandResultList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/CommandsApi.md b/jcapiv2/docs/CommandsApi.md index d4cb654..f1b1c9a 100644 --- a/jcapiv2/docs/CommandsApi.md +++ b/jcapiv2/docs/CommandsApi.md @@ -4,14 +4,130 @@ All URIs are relative to *https://console.jumpcloud.com/api/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**commands_cancel_queued_commands_by_workflow_instance_id**](CommandsApi.md#commands_cancel_queued_commands_by_workflow_instance_id) | **DELETE** /commandqueue/{workflow_instance_id} | Cancel all queued commands for an organization by workflow instance Id +[**commands_get_queued_commands_by_workflow**](CommandsApi.md#commands_get_queued_commands_by_workflow) | **GET** /queuedcommand/workflows | Fetch the queued Commands for an Organization [**graph_command_associations_list**](CommandsApi.md#graph_command_associations_list) | **GET** /commands/{command_id}/associations | List the associations of a Command [**graph_command_associations_post**](CommandsApi.md#graph_command_associations_post) | **POST** /commands/{command_id}/associations | Manage the associations of a Command [**graph_command_traverse_system**](CommandsApi.md#graph_command_traverse_system) | **GET** /commands/{command_id}/systems | List the Systems bound to a Command [**graph_command_traverse_system_group**](CommandsApi.md#graph_command_traverse_system_group) | **GET** /commands/{command_id}/systemgroups | List the System Groups bound to a Command +# **commands_cancel_queued_commands_by_workflow_instance_id** +> commands_cancel_queued_commands_by_workflow_instance_id(workflow_instance_id, x_org_id=x_org_id) + +Cancel all queued commands for an organization by workflow instance Id + +This endpoint allows all queued commands for one workflow instance to be canceled. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/commandqueue/{workflow_instance_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.CommandsApi(jcapiv2.ApiClient(configuration)) +workflow_instance_id = 'workflow_instance_id_example' # str | Workflow instance Id of the queued commands to cancel. +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Cancel all queued commands for an organization by workflow instance Id + api_instance.commands_cancel_queued_commands_by_workflow_instance_id(workflow_instance_id, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling CommandsApi->commands_cancel_queued_commands_by_workflow_instance_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **workflow_instance_id** | **str**| Workflow instance Id of the queued commands to cancel. | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **commands_get_queued_commands_by_workflow** +> QueuedCommandList commands_get_queued_commands_by_workflow(x_org_id=x_org_id, limit=limit, filter=filter, skip=skip) + +Fetch the queued Commands for an Organization + +This endpoint will return all queued Commands for an Organization. Each element will contain the workflow ID, the command name, the launch type (e.g. manual, triggered, or scheduled), the target OS, the number of assigned devices, and the number of pending devices that have not yet ran the command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/queuedcommand/workflows \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.CommandsApi(jcapiv2.ApiClient(configuration)) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) + +try: + # Fetch the queued Commands for an Organization + api_response = api_instance.commands_get_queued_commands_by_workflow(x_org_id=x_org_id, limit=limit, filter=filter, skip=skip) + pprint(api_response) +except ApiException as e: + print("Exception when calling CommandsApi->commands_get_queued_commands_by_workflow: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + +### Return type + +[**QueuedCommandList**](QueuedCommandList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_command_associations_list** -> list[GraphConnection] graph_command_associations_list(command_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_command_associations_list(command_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of a Command @@ -34,16 +150,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.CommandsApi(jcapiv2.ApiClient(configuration)) command_id = 'command_id_example' # str | ObjectID of the Command. -targets = ['targets_example'] # list[str] | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +targets = ['targets_example'] # list[str] | Targets which a \"command\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of a Command - api_response = api_instance.graph_command_associations_list(command_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_command_associations_list(command_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling CommandsApi->graph_command_associations_list: %s\n" % e) @@ -54,12 +168,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **command_id** | **str**| ObjectID of the Command. | - **targets** | [**list[str]**](str.md)| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **targets** | [**list[str]**](str.md)| Targets which a \"command\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -71,17 +183,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_command_associations_post** -> graph_command_associations_post(command_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_command_associations_post(command_id, body=body, x_org_id=x_org_id) Manage the associations of a Command -This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` +This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` ### Example ```python @@ -100,14 +212,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.CommandsApi(jcapiv2.ApiClient(configuration)) command_id = 'command_id_example' # str | ObjectID of the Command. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.GraphManagementReq() # GraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationCommand() # GraphOperationCommand | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of a Command - api_instance.graph_command_associations_post(command_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_command_associations_post(command_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling CommandsApi->graph_command_associations_post: %s\n" % e) ``` @@ -117,10 +227,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **command_id** | **str**| ObjectID of the Command. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationCommand**](GraphOperationCommand.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -133,12 +241,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_command_traverse_system** -> list[GraphObjectWithPaths] graph_command_traverse_system(command_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_command_traverse_system(command_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Systems bound to a Command @@ -161,16 +269,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.CommandsApi(jcapiv2.ApiClient(configuration)) command_id = 'command_id_example' # str | ObjectID of the Command. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Systems bound to a Command - api_response = api_instance.graph_command_traverse_system(command_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_command_traverse_system(command_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling CommandsApi->graph_command_traverse_system: %s\n" % e) @@ -181,12 +287,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **command_id** | **str**| ObjectID of the Command. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -198,13 +302,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_command_traverse_system_group** -> list[GraphObjectWithPaths] graph_command_traverse_system_group(command_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_command_traverse_system_group(command_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the System Groups bound to a Command @@ -227,16 +331,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.CommandsApi(jcapiv2.ApiClient(configuration)) command_id = 'command_id_example' # str | ObjectID of the Command. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the System Groups bound to a Command - api_response = api_instance.graph_command_traverse_system_group(command_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_command_traverse_system_group(command_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling CommandsApi->graph_command_traverse_system_group: %s\n" % e) @@ -247,12 +349,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **command_id** | **str**| ObjectID of the Command. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -264,7 +364,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/ConnectWiseMappingRequest.md b/jcapiv2/docs/ConnectWiseMappingRequest.md new file mode 100644 index 0000000..7a4e132 --- /dev/null +++ b/jcapiv2/docs/ConnectWiseMappingRequest.md @@ -0,0 +1,9 @@ +# ConnectWiseMappingRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**list[ConnectWiseMappingRequestData]**](ConnectWiseMappingRequestData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseMappingRequestCompany.md b/jcapiv2/docs/ConnectWiseMappingRequestCompany.md new file mode 100644 index 0000000..fa9859f --- /dev/null +++ b/jcapiv2/docs/ConnectWiseMappingRequestCompany.md @@ -0,0 +1,10 @@ +# ConnectWiseMappingRequestCompany + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**name** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseMappingRequestData.md b/jcapiv2/docs/ConnectWiseMappingRequestData.md new file mode 100644 index 0000000..4969215 --- /dev/null +++ b/jcapiv2/docs/ConnectWiseMappingRequestData.md @@ -0,0 +1,13 @@ +# ConnectWiseMappingRequestData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**addition** | **object** | | +**agreement** | **object** | | +**company** | [**ConnectWiseMappingRequestCompany**](ConnectWiseMappingRequestCompany.md) | | +**delete** | **bool** | | [optional] +**organization** | [**ConnectWiseMappingRequestOrganization**](ConnectWiseMappingRequestOrganization.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseMappingRequestOrganization.md b/jcapiv2/docs/ConnectWiseMappingRequestOrganization.md new file mode 100644 index 0000000..bd745cd --- /dev/null +++ b/jcapiv2/docs/ConnectWiseMappingRequestOrganization.md @@ -0,0 +1,10 @@ +# ConnectWiseMappingRequestOrganization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**name** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseMappingResponse.md b/jcapiv2/docs/ConnectWiseMappingResponse.md new file mode 100644 index 0000000..c0d92c2 --- /dev/null +++ b/jcapiv2/docs/ConnectWiseMappingResponse.md @@ -0,0 +1,14 @@ +# ConnectWiseMappingResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**addition** | [**ConnectWiseMappingResponseAddition**](ConnectWiseMappingResponseAddition.md) | | [optional] +**agreement** | [**ConnectWiseMappingResponseAddition**](ConnectWiseMappingResponseAddition.md) | | [optional] +**company** | [**ConnectWiseMappingResponseAddition**](ConnectWiseMappingResponseAddition.md) | | [optional] +**last_sync_date_time** | **str** | | [optional] +**last_sync_status** | **str** | | [optional] +**organization** | [**ConnectWiseMappingResponseAddition**](ConnectWiseMappingResponseAddition.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseMappingResponseAddition.md b/jcapiv2/docs/ConnectWiseMappingResponseAddition.md new file mode 100644 index 0000000..7984529 --- /dev/null +++ b/jcapiv2/docs/ConnectWiseMappingResponseAddition.md @@ -0,0 +1,10 @@ +# ConnectWiseMappingResponseAddition + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseSettings.md b/jcapiv2/docs/ConnectWiseSettings.md new file mode 100644 index 0000000..0a01134 --- /dev/null +++ b/jcapiv2/docs/ConnectWiseSettings.md @@ -0,0 +1,10 @@ +# ConnectWiseSettings + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**automatic_ticketing** | **bool** | Determine whether ConnectWise uses automatic ticketing | [optional] +**company_type_ids** | **list[int]** | The array of ConnectWise companyType IDs applicable to the Provider. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseSettingsPatchReq.md b/jcapiv2/docs/ConnectWiseSettingsPatchReq.md new file mode 100644 index 0000000..faccf1c --- /dev/null +++ b/jcapiv2/docs/ConnectWiseSettingsPatchReq.md @@ -0,0 +1,10 @@ +# ConnectWiseSettingsPatchReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**automatic_ticketing** | **bool** | Determine whether ConnectWise uses automatic ticketing | [optional] +**company_type_ids** | **list[int]** | The array of ConnectWise companyType IDs applicable to the Provider. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseTicketingAlertConfiguration.md b/jcapiv2/docs/ConnectWiseTicketingAlertConfiguration.md new file mode 100644 index 0000000..c0be3f3 --- /dev/null +++ b/jcapiv2/docs/ConnectWiseTicketingAlertConfiguration.md @@ -0,0 +1,16 @@ +# ConnectWiseTicketingAlertConfiguration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **str** | | [optional] +**description** | **str** | | [optional] +**display_name** | **str** | | [optional] +**due_days** | **int** | | [optional] +**id** | **int** | | [optional] +**priority** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | [optional] +**should_create_tickets** | **bool** | | +**source** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationList.md b/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationList.md new file mode 100644 index 0000000..2258805 --- /dev/null +++ b/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationList.md @@ -0,0 +1,9 @@ +# ConnectWiseTicketingAlertConfigurationList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**records** | **list[AllOfConnectWiseTicketingAlertConfigurationListRecordsItems]** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationOption.md b/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationOption.md new file mode 100644 index 0000000..80f755d --- /dev/null +++ b/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationOption.md @@ -0,0 +1,10 @@ +# ConnectWiseTicketingAlertConfigurationOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**values** | [**list[AutotaskTicketingAlertConfigurationOptionValues]**](AutotaskTicketingAlertConfigurationOptionValues.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationOptions.md b/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationOptions.md new file mode 100644 index 0000000..2a59c8a --- /dev/null +++ b/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationOptions.md @@ -0,0 +1,9 @@ +# ConnectWiseTicketingAlertConfigurationOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**records** | [**list[ConnectWiseTicketingAlertConfigurationOption]**](ConnectWiseTicketingAlertConfigurationOption.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationRequest.md b/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationRequest.md new file mode 100644 index 0000000..3c199c5 --- /dev/null +++ b/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationRequest.md @@ -0,0 +1,12 @@ +# ConnectWiseTicketingAlertConfigurationRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**due_days** | **int** | | [optional] +**priority** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | [optional] +**should_create_tickets** | **bool** | | +**source** | [**AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfigurationPriority.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectwiseAddition.md b/jcapiv2/docs/ConnectwiseAddition.md new file mode 100644 index 0000000..7b2629c --- /dev/null +++ b/jcapiv2/docs/ConnectwiseAddition.md @@ -0,0 +1,10 @@ +# ConnectwiseAddition + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The addition identifier. | +**name** | **str** | The addition name. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Systemuserbindingsput.md b/jcapiv2/docs/ConnectwiseAgreement.md similarity index 57% rename from jcapiv1/docs/Systemuserbindingsput.md rename to jcapiv2/docs/ConnectwiseAgreement.md index 6b63449..8856a7c 100644 --- a/jcapiv1/docs/Systemuserbindingsput.md +++ b/jcapiv2/docs/ConnectwiseAgreement.md @@ -1,11 +1,11 @@ -# Systemuserbindingsput +# ConnectwiseAgreement ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**add** | **list[str]** | The list of systemuser ids to be added to this system. | -**remove** | **list[str]** | The list of systemuser ids to be removed from this system. | +**company_id** | **str** | The ConnectWise company identifier linked to agreement. | +**id** | **str** | The agreement identifier. | +**name** | **str** | The agreement name. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/ConnectwiseCompany.md b/jcapiv2/docs/ConnectwiseCompany.md new file mode 100644 index 0000000..736203b --- /dev/null +++ b/jcapiv2/docs/ConnectwiseCompany.md @@ -0,0 +1,10 @@ +# ConnectwiseCompany + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The company identifier. | +**name** | **str** | The company name. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectwiseCompanyResp.md b/jcapiv2/docs/ConnectwiseCompanyResp.md new file mode 100644 index 0000000..7074e34 --- /dev/null +++ b/jcapiv2/docs/ConnectwiseCompanyResp.md @@ -0,0 +1,10 @@ +# ConnectwiseCompanyResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**records** | [**list[ConnectwiseCompany]**](ConnectwiseCompany.md) | | +**total_count** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectwiseCompanyTypeResp.md b/jcapiv2/docs/ConnectwiseCompanyTypeResp.md new file mode 100644 index 0000000..c062af1 --- /dev/null +++ b/jcapiv2/docs/ConnectwiseCompanyTypeResp.md @@ -0,0 +1,10 @@ +# ConnectwiseCompanyTypeResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**records** | [**list[BillingIntegrationCompanyType]**](BillingIntegrationCompanyType.md) | | +**total_count** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectwiseIntegration.md b/jcapiv2/docs/ConnectwiseIntegration.md new file mode 100644 index 0000000..d37d512 --- /dev/null +++ b/jcapiv2/docs/ConnectwiseIntegration.md @@ -0,0 +1,12 @@ +# ConnectwiseIntegration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**company_id** | **str** | The ConnectWise company identifier. | +**id** | **str** | The identifier for this ConnectWise integration. | +**is_msp_auth_configured** | **bool** | Has the msp-api been configured with auth data yet | [optional] +**url** | **str** | The base url for connecting to ConnectWise. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectwiseIntegrationPatchReq.md b/jcapiv2/docs/ConnectwiseIntegrationPatchReq.md new file mode 100644 index 0000000..3b9091b --- /dev/null +++ b/jcapiv2/docs/ConnectwiseIntegrationPatchReq.md @@ -0,0 +1,12 @@ +# ConnectwiseIntegrationPatchReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**company_id** | **str** | The ConnectWise company identifier. | [optional] +**private_key** | **str** | The ConnectWise private key for authentication | [optional] +**public_key** | **str** | The ConnectWise public key for authentication. | [optional] +**url** | **str** | The base url for connecting to ConnectWise. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectwiseIntegrationReq.md b/jcapiv2/docs/ConnectwiseIntegrationReq.md new file mode 100644 index 0000000..559cc8d --- /dev/null +++ b/jcapiv2/docs/ConnectwiseIntegrationReq.md @@ -0,0 +1,12 @@ +# ConnectwiseIntegrationReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**company_id** | **str** | The ConnectWise company identifier. | +**private_key** | **str** | The ConnectWise private key for authentication | +**public_key** | **str** | The ConnectWise public key for authentication. | +**url** | **str** | The base url for connecting to ConnectWise. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/CustomEmail.md b/jcapiv2/docs/CustomEmail.md new file mode 100644 index 0000000..7f4ff57 --- /dev/null +++ b/jcapiv2/docs/CustomEmail.md @@ -0,0 +1,16 @@ +# CustomEmail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | **str** | | [optional] +**button** | **str** | | [optional] +**header** | **str** | | [optional] +**id** | **str** | | [optional] +**next_step_contact_info** | **str** | | [optional] +**subject** | **str** | | +**title** | **str** | | [optional] +**type** | [**CustomEmailType**](CustomEmailType.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/CustomEmailTemplate.md b/jcapiv2/docs/CustomEmailTemplate.md new file mode 100644 index 0000000..8227abe --- /dev/null +++ b/jcapiv2/docs/CustomEmailTemplate.md @@ -0,0 +1,12 @@ +# CustomEmailTemplate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**display_name** | **str** | | [optional] +**fields** | [**list[CustomEmailTemplateField]**](CustomEmailTemplateField.md) | | [optional] +**type** | [**CustomEmailType**](CustomEmailType.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/CustomEmailTemplateField.md b/jcapiv2/docs/CustomEmailTemplateField.md new file mode 100644 index 0000000..48a8289 --- /dev/null +++ b/jcapiv2/docs/CustomEmailTemplateField.md @@ -0,0 +1,12 @@ +# CustomEmailTemplateField + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**default_value** | **str** | | [optional] +**display_name** | **str** | | [optional] +**field** | **str** | | [optional] +**multiline** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/CustomEmailType.md b/jcapiv2/docs/CustomEmailType.md new file mode 100644 index 0000000..7f1b06a --- /dev/null +++ b/jcapiv2/docs/CustomEmailType.md @@ -0,0 +1,8 @@ +# CustomEmailType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/CustomEmailsApi.md b/jcapiv2/docs/CustomEmailsApi.md new file mode 100644 index 0000000..4120645 --- /dev/null +++ b/jcapiv2/docs/CustomEmailsApi.md @@ -0,0 +1,287 @@ +# jcapiv2.CustomEmailsApi + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**custom_emails_create**](CustomEmailsApi.md#custom_emails_create) | **POST** /customemails | Create custom email configuration +[**custom_emails_destroy**](CustomEmailsApi.md#custom_emails_destroy) | **DELETE** /customemails/{custom_email_type} | Delete custom email configuration +[**custom_emails_get_templates**](CustomEmailsApi.md#custom_emails_get_templates) | **GET** /customemail/templates | List custom email templates +[**custom_emails_read**](CustomEmailsApi.md#custom_emails_read) | **GET** /customemails/{custom_email_type} | Get custom email configuration +[**custom_emails_update**](CustomEmailsApi.md#custom_emails_update) | **PUT** /customemails/{custom_email_type} | Update custom email configuration + +# **custom_emails_create** +> CustomEmail custom_emails_create(body=body, x_org_id=x_org_id) + +Create custom email configuration + +Create the custom email configuration for the specified custom email type + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.CustomEmailsApi(jcapiv2.ApiClient(configuration)) +body = jcapiv2.CustomEmail() # CustomEmail | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Create custom email configuration + api_response = api_instance.custom_emails_create(body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling CustomEmailsApi->custom_emails_create: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**CustomEmail**](CustomEmail.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**CustomEmail**](CustomEmail.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **custom_emails_destroy** +> custom_emails_destroy(custom_email_type, x_org_id=x_org_id) + +Delete custom email configuration + +Delete the custom email configuration for the specified custom email type + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.CustomEmailsApi(jcapiv2.ApiClient(configuration)) +custom_email_type = 'custom_email_type_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Delete custom email configuration + api_instance.custom_emails_destroy(custom_email_type, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling CustomEmailsApi->custom_emails_destroy: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **custom_email_type** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **custom_emails_get_templates** +> list[CustomEmailTemplate] custom_emails_get_templates() + +List custom email templates + +Get the list of custom email templates + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.CustomEmailsApi(jcapiv2.ApiClient(configuration)) + +try: + # List custom email templates + api_response = api_instance.custom_emails_get_templates() + pprint(api_response) +except ApiException as e: + print("Exception when calling CustomEmailsApi->custom_emails_get_templates: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[CustomEmailTemplate]**](CustomEmailTemplate.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **custom_emails_read** +> CustomEmail custom_emails_read(custom_email_type, x_org_id=x_org_id) + +Get custom email configuration + +Get the custom email configuration for the specified custom email type + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.CustomEmailsApi(jcapiv2.ApiClient(configuration)) +custom_email_type = 'custom_email_type_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Get custom email configuration + api_response = api_instance.custom_emails_read(custom_email_type, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling CustomEmailsApi->custom_emails_read: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **custom_email_type** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**CustomEmail**](CustomEmail.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **custom_emails_update** +> CustomEmail custom_emails_update(custom_email_type, body=body, x_org_id=x_org_id) + +Update custom email configuration + +Update the custom email configuration for the specified custom email type + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.CustomEmailsApi(jcapiv2.ApiClient(configuration)) +custom_email_type = 'custom_email_type_example' # str | +body = jcapiv2.CustomEmail() # CustomEmail | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Update custom email configuration + api_response = api_instance.custom_emails_update(custom_email_type, body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling CustomEmailsApi->custom_emails_update: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **custom_email_type** | **str**| | + **body** | [**CustomEmail**](CustomEmail.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**CustomEmail**](CustomEmail.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/DEP.md b/jcapiv2/docs/DEP.md new file mode 100644 index 0000000..47901db --- /dev/null +++ b/jcapiv2/docs/DEP.md @@ -0,0 +1,11 @@ +# DEP + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enable_zero_touch_enrollment** | **bool** | A toggle to determine if DEP registered devices should go through JumpCloud Zero Touch Enrollment. | [optional] +**setup_assistant_options** | [**list[DEPSetupAssistantOption]**](DEPSetupAssistantOption.md) | | [optional] +**welcome_screen** | [**DEPWelcomeScreen**](DEPWelcomeScreen.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/DEPSetupAssistantOption.md b/jcapiv2/docs/DEPSetupAssistantOption.md new file mode 100644 index 0000000..bb84887 --- /dev/null +++ b/jcapiv2/docs/DEPSetupAssistantOption.md @@ -0,0 +1,9 @@ +# DEPSetupAssistantOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**option** | [**SetupAssistantOption**](SetupAssistantOption.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/DEPWelcomeScreen.md b/jcapiv2/docs/DEPWelcomeScreen.md new file mode 100644 index 0000000..92ee39b --- /dev/null +++ b/jcapiv2/docs/DEPWelcomeScreen.md @@ -0,0 +1,11 @@ +# DEPWelcomeScreen + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**button** | **str** | Text to display on the button on the DEP Welcome Screen. | [optional] +**paragraph** | **str** | A message to display on the DEP Welcome Screen. | [optional] +**title** | **str** | The title to display on the DEP Welcome Screen. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/DefaultApi.md b/jcapiv2/docs/DefaultApi.md deleted file mode 100644 index f5b62df..0000000 --- a/jcapiv2/docs/DefaultApi.md +++ /dev/null @@ -1,279 +0,0 @@ -# jcapiv2.DefaultApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**jc_enrollment_profiles_delete**](DefaultApi.md#jc_enrollment_profiles_delete) | **DELETE** /enrollmentprofiles/{enrollment_profile_id} | Delete Enrollment Profile -[**jc_enrollment_profiles_get**](DefaultApi.md#jc_enrollment_profiles_get) | **GET** /enrollmentprofiles/{enrollment_profile_id} | Get Enrollment Profile -[**jc_enrollment_profiles_list**](DefaultApi.md#jc_enrollment_profiles_list) | **GET** /enrollmentprofiles | List Enrollment Profiles -[**jc_enrollment_profiles_post**](DefaultApi.md#jc_enrollment_profiles_post) | **POST** /enrollmentprofiles | Create new Enrollment Profile -[**jc_enrollment_profiles_put**](DefaultApi.md#jc_enrollment_profiles_put) | **PUT** /enrollmentprofiles/{enrollment_profile_id} | Update Enrollment Profile - - -# **jc_enrollment_profiles_delete** -> JcEnrollmentProfile jc_enrollment_profiles_delete(enrollment_profile_id) - -Delete Enrollment Profile - -### Example -```python -from __future__ import print_function -import time -import jcapiv2 -from jcapiv2.rest import ApiException -from pprint import pprint - -# Configure API key authorization: x-api-key -configuration = jcapiv2.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - -# create an instance of the API class -api_instance = jcapiv2.DefaultApi(jcapiv2.ApiClient(configuration)) -enrollment_profile_id = 'enrollment_profile_id_example' # str | - -try: - # Delete Enrollment Profile - api_response = api_instance.jc_enrollment_profiles_delete(enrollment_profile_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling DefaultApi->jc_enrollment_profiles_delete: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enrollment_profile_id** | **str**| | - -### Return type - -[**JcEnrollmentProfile**](JcEnrollmentProfile.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jc_enrollment_profiles_get** -> ERRORUNKNOWN jc_enrollment_profiles_get(enrollment_profile_id, body=body) - -Get Enrollment Profile - -### Example -```python -from __future__ import print_function -import time -import jcapiv2 -from jcapiv2.rest import ApiException -from pprint import pprint - -# Configure API key authorization: x-api-key -configuration = jcapiv2.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - -# create an instance of the API class -api_instance = jcapiv2.DefaultApi(jcapiv2.ApiClient(configuration)) -enrollment_profile_id = 'enrollment_profile_id_example' # str | -body = jcapiv2.JcEnrollmentProfile() # JcEnrollmentProfile | (optional) - -try: - # Get Enrollment Profile - api_response = api_instance.jc_enrollment_profiles_get(enrollment_profile_id, body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling DefaultApi->jc_enrollment_profiles_get: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enrollment_profile_id** | **str**| | - **body** | [**JcEnrollmentProfile**](JcEnrollmentProfile.md)| | [optional] - -### Return type - -[**ERRORUNKNOWN**](ERRORUNKNOWN.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jc_enrollment_profiles_list** -> list[JcEnrollmentProfile] jc_enrollment_profiles_list(limit=limit, skip=skip) - -List Enrollment Profiles - -### Example -```python -from __future__ import print_function -import time -import jcapiv2 -from jcapiv2.rest import ApiException -from pprint import pprint - -# Configure API key authorization: x-api-key -configuration = jcapiv2.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - -# create an instance of the API class -api_instance = jcapiv2.DefaultApi(jcapiv2.ApiClient(configuration)) -limit = 10 # int | (optional) (default to 10) -skip = 0 # int | The offset into the records to return. (optional) (default to 0) - -try: - # List Enrollment Profiles - api_response = api_instance.jc_enrollment_profiles_list(limit=limit, skip=skip) - pprint(api_response) -except ApiException as e: - print("Exception when calling DefaultApi->jc_enrollment_profiles_list: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **limit** | **int**| | [optional] [default to 10] - **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - -### Return type - -[**list[JcEnrollmentProfile]**](JcEnrollmentProfile.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jc_enrollment_profiles_post** -> JcEnrollmentProfile jc_enrollment_profiles_post(body=body) - -Create new Enrollment Profile - -### Example -```python -from __future__ import print_function -import time -import jcapiv2 -from jcapiv2.rest import ApiException -from pprint import pprint - -# Configure API key authorization: x-api-key -configuration = jcapiv2.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - -# create an instance of the API class -api_instance = jcapiv2.DefaultApi(jcapiv2.ApiClient(configuration)) -body = jcapiv2.Body1() # Body1 | (optional) - -try: - # Create new Enrollment Profile - api_response = api_instance.jc_enrollment_profiles_post(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling DefaultApi->jc_enrollment_profiles_post: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Body1**](Body1.md)| | [optional] - -### Return type - -[**JcEnrollmentProfile**](JcEnrollmentProfile.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **jc_enrollment_profiles_put** -> JcEnrollmentProfile jc_enrollment_profiles_put(enrollment_profile_id, body=body) - -Update Enrollment Profile - -### Example -```python -from __future__ import print_function -import time -import jcapiv2 -from jcapiv2.rest import ApiException -from pprint import pprint - -# Configure API key authorization: x-api-key -configuration = jcapiv2.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - -# create an instance of the API class -api_instance = jcapiv2.DefaultApi(jcapiv2.ApiClient(configuration)) -enrollment_profile_id = 'enrollment_profile_id_example' # str | -body = jcapiv2.Body2() # Body2 | (optional) - -try: - # Update Enrollment Profile - api_response = api_instance.jc_enrollment_profiles_put(enrollment_profile_id, body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling DefaultApi->jc_enrollment_profiles_put: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enrollment_profile_id** | **str**| | - **body** | [**Body2**](Body2.md)| | [optional] - -### Return type - -[**JcEnrollmentProfile**](JcEnrollmentProfile.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/DeviceIdEraseBody.md b/jcapiv2/docs/DeviceIdEraseBody.md new file mode 100644 index 0000000..b994e43 --- /dev/null +++ b/jcapiv2/docs/DeviceIdEraseBody.md @@ -0,0 +1,9 @@ +# DeviceIdEraseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pin** | **str** | 6-digit PIN, required for MacOS, to erase the device | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/DeviceIdLockBody.md b/jcapiv2/docs/DeviceIdLockBody.md new file mode 100644 index 0000000..994acd9 --- /dev/null +++ b/jcapiv2/docs/DeviceIdLockBody.md @@ -0,0 +1,9 @@ +# DeviceIdLockBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pin** | **str** | 6-digit PIN, required for MacOS, to lock the device | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/DeviceIdRestartBody.md b/jcapiv2/docs/DeviceIdRestartBody.md new file mode 100644 index 0000000..ab3a4f5 --- /dev/null +++ b/jcapiv2/docs/DeviceIdRestartBody.md @@ -0,0 +1,9 @@ +# DeviceIdRestartBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kext_paths** | **list[str]** | The string to pass when doing a restart and performing a RebuildKernelCache. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/DirectoriesApi.md b/jcapiv2/docs/DirectoriesApi.md index 4d1aff7..fa03af5 100644 --- a/jcapiv2/docs/DirectoriesApi.md +++ b/jcapiv2/docs/DirectoriesApi.md @@ -6,9 +6,8 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**directories_list**](DirectoriesApi.md#directories_list) | **GET** /directories | List All Directories - # **directories_list** -> list[Directory] directories_list(content_type, accept, fields=fields, limit=limit, sort=sort, skip=skip, x_org_id=x_org_id) +> list[Directory] directories_list(fields=fields, limit=limit, sort=sort, skip=skip, x_org_id=x_org_id) List All Directories @@ -30,17 +29,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.DirectoriesApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List All Directories - api_response = api_instance.directories_list(content_type, accept, fields=fields, limit=limit, sort=sort, skip=skip, x_org_id=x_org_id) + api_response = api_instance.directories_list(fields=fields, limit=limit, sort=sort, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling DirectoriesApi->directories_list: %s\n" % e) @@ -50,13 +47,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -68,7 +63,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/Directory.md b/jcapiv2/docs/Directory.md index 4c128e1..5710733 100644 --- a/jcapiv2/docs/Directory.md +++ b/jcapiv2/docs/Directory.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | The ObjectID of the directory. | **name** | **str** | The name of the directory. | +**o_auth_status** | **object** | the expiry and error status of the bearer token | [optional] **type** | **str** | The type of directory. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/DuoAccount.md b/jcapiv2/docs/DuoAccount.md index 83c9b6c..f62be8c 100644 --- a/jcapiv2/docs/DuoAccount.md +++ b/jcapiv2/docs/DuoAccount.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/DuoApi.md b/jcapiv2/docs/DuoApi.md index 874ee41..a22e117 100644 --- a/jcapiv2/docs/DuoApi.md +++ b/jcapiv2/docs/DuoApi.md @@ -6,7 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**duo_account_delete**](DuoApi.md#duo_account_delete) | **DELETE** /duo/accounts/{id} | Delete a Duo Account [**duo_account_get**](DuoApi.md#duo_account_get) | **GET** /duo/accounts/{id} | Get a Duo Acount -[**duo_account_list**](DuoApi.md#duo_account_list) | **GET** /duo/accounts | List Duo Acounts +[**duo_account_list**](DuoApi.md#duo_account_list) | **GET** /duo/accounts | List Duo Accounts [**duo_account_post**](DuoApi.md#duo_account_post) | **POST** /duo/accounts | Create Duo Account [**duo_application_delete**](DuoApi.md#duo_application_delete) | **DELETE** /duo/accounts/{account_id}/applications/{application_id} | Delete a Duo Application [**duo_application_get**](DuoApi.md#duo_application_get) | **GET** /duo/accounts/{account_id}/applications/{application_id} | Get a Duo application @@ -14,9 +14,8 @@ Method | HTTP request | Description [**duo_application_post**](DuoApi.md#duo_application_post) | **POST** /duo/accounts/{account_id}/applications | Create Duo Application [**duo_application_update**](DuoApi.md#duo_application_update) | **PUT** /duo/accounts/{account_id}/applications/{application_id} | Update Duo Application - # **duo_account_delete** -> DuoAccount duo_account_delete(id, content_type, accept, x_org_id=x_org_id) +> DuoAccount duo_account_delete(id, x_org_id=x_org_id) Delete a Duo Account @@ -39,13 +38,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.DuoApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | ObjectID of the Duo Account -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Delete a Duo Account - api_response = api_instance.duo_account_delete(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.duo_account_delete(id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling DuoApi->duo_account_delete: %s\n" % e) @@ -56,9 +53,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| ObjectID of the Duo Account | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -70,13 +65,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **duo_account_get** -> DuoAccount duo_account_get(id, content_type, accept, x_org_id=x_org_id) +> DuoAccount duo_account_get(id, x_org_id=x_org_id) Get a Duo Acount @@ -99,13 +94,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.DuoApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | ObjectID of the Duo Account -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Get a Duo Acount - api_response = api_instance.duo_account_get(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.duo_account_get(id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling DuoApi->duo_account_get: %s\n" % e) @@ -116,9 +109,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| ObjectID of the Duo Account | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -130,15 +121,15 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **duo_account_list** -> list[DuoAccount] duo_account_list(content_type, accept, x_org_id=x_org_id) +> list[DuoAccount] duo_account_list(x_org_id=x_org_id) -List Duo Acounts +List Duo Accounts This endpoint returns all the Duo accounts for your organization. Note: There can currently only be one Duo account for your organization. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` @@ -158,13 +149,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.DuoApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # List Duo Acounts - api_response = api_instance.duo_account_list(content_type, accept, x_org_id=x_org_id) + # List Duo Accounts + api_response = api_instance.duo_account_list(x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling DuoApi->duo_account_list: %s\n" % e) @@ -174,9 +163,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -188,13 +175,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **duo_account_post** -> DuoAccount duo_account_post(content_type, accept, x_org_id=x_org_id) +> DuoAccount duo_account_post(x_org_id=x_org_id) Create Duo Account @@ -216,13 +203,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.DuoApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Create Duo Account - api_response = api_instance.duo_account_post(content_type, accept, x_org_id=x_org_id) + api_response = api_instance.duo_account_post(x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling DuoApi->duo_account_post: %s\n" % e) @@ -232,9 +217,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -246,13 +229,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **duo_application_delete** -> DuoApplication duo_application_delete(account_id, application_id, content_type, accept, x_org_id=x_org_id) +> DuoApplication duo_application_delete(account_id, application_id, x_org_id=x_org_id) Delete a Duo Application @@ -276,13 +259,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' api_instance = jcapiv2.DuoApi(jcapiv2.ApiClient(configuration)) account_id = 'account_id_example' # str | application_id = 'application_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Delete a Duo Application - api_response = api_instance.duo_application_delete(account_id, application_id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.duo_application_delete(account_id, application_id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling DuoApi->duo_application_delete: %s\n" % e) @@ -294,9 +275,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **account_id** | **str**| | **application_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -308,13 +287,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **duo_application_get** -> DuoApplication duo_application_get(account_id, application_id, content_type, accept, x_org_id=x_org_id) +> DuoApplication duo_application_get(account_id, application_id, x_org_id=x_org_id) Get a Duo application @@ -338,13 +317,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' api_instance = jcapiv2.DuoApi(jcapiv2.ApiClient(configuration)) account_id = 'account_id_example' # str | application_id = 'application_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Get a Duo application - api_response = api_instance.duo_application_get(account_id, application_id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.duo_application_get(account_id, application_id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling DuoApi->duo_application_get: %s\n" % e) @@ -356,9 +333,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **account_id** | **str**| | **application_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -370,13 +345,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **duo_application_list** -> list[DuoApplication] duo_application_list(account_id, content_type, accept, x_org_id=x_org_id) +> list[DuoApplication] duo_application_list(account_id, x_org_id=x_org_id) List Duo Applications @@ -399,13 +374,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.DuoApi(jcapiv2.ApiClient(configuration)) account_id = 'account_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List Duo Applications - api_response = api_instance.duo_application_list(account_id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.duo_application_list(account_id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling DuoApi->duo_application_list: %s\n" % e) @@ -416,9 +389,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **account_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -430,13 +401,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **duo_application_post** -> DuoApplication duo_application_post(account_id, content_type, accept, body=body, x_org_id=x_org_id) +> DuoApplication duo_application_post(account_id, body=body, x_org_id=x_org_id) Create Duo Application @@ -459,14 +430,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.DuoApi(jcapiv2.ApiClient(configuration)) account_id = 'account_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv2.DuoApplicationReq() # DuoApplicationReq | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Create Duo Application - api_response = api_instance.duo_application_post(account_id, content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.duo_application_post(account_id, body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling DuoApi->duo_application_post: %s\n" % e) @@ -477,10 +446,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **account_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**DuoApplicationReq**](DuoApplicationReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -498,7 +465,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **duo_application_update** -> DuoApplication duo_application_update(account_id, application_id, content_type, accept, body=body, x_org_id=x_org_id) +> DuoApplication duo_application_update(account_id, application_id, body=body, x_org_id=x_org_id) Update Duo Application @@ -522,14 +489,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' api_instance = jcapiv2.DuoApi(jcapiv2.ApiClient(configuration)) account_id = 'account_id_example' # str | application_id = 'application_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv2.DuoApplicationUpdateReq() # DuoApplicationUpdateReq | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Update Duo Application - api_response = api_instance.duo_application_update(account_id, application_id, content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.duo_application_update(account_id, application_id, body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling DuoApi->duo_application_update: %s\n" % e) @@ -541,10 +506,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **account_id** | **str**| | **application_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**DuoApplicationUpdateReq**](DuoApplicationUpdateReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type diff --git a/jcapiv2/docs/DuoApplication.md b/jcapiv2/docs/DuoApplication.md index b159450..3d3ef0c 100644 --- a/jcapiv2/docs/DuoApplication.md +++ b/jcapiv2/docs/DuoApplication.md @@ -10,4 +10,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/DuoApplicationReq.md b/jcapiv2/docs/DuoApplicationReq.md index 32f1732..0e1cfc1 100644 --- a/jcapiv2/docs/DuoApplicationReq.md +++ b/jcapiv2/docs/DuoApplicationReq.md @@ -10,4 +10,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/DuoApplicationUpdateReq.md b/jcapiv2/docs/DuoApplicationUpdateReq.md index 2e7e669..57ab8ca 100644 --- a/jcapiv2/docs/DuoApplicationUpdateReq.md +++ b/jcapiv2/docs/DuoApplicationUpdateReq.md @@ -3,11 +3,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**api_host** | **str** | | [optional] -**integration_key** | **str** | | [optional] -**name** | **str** | | [optional] +**api_host** | **str** | | +**integration_key** | **str** | | +**name** | **str** | | **secret_key** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/DuoRegistrationApplicationReq.md b/jcapiv2/docs/DuoRegistrationApplicationReq.md deleted file mode 100644 index 7c10df0..0000000 --- a/jcapiv2/docs/DuoRegistrationApplicationReq.md +++ /dev/null @@ -1,10 +0,0 @@ -# DuoRegistrationApplicationReq - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**registration_application** | [**DuoRegistrationApplication**](DuoRegistrationApplication.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv2/docs/Error.md b/jcapiv2/docs/Error.md index 9c3ebce..3570117 100644 --- a/jcapiv2/docs/Error.md +++ b/jcapiv2/docs/Error.md @@ -3,10 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **int** | | [optional] -**fields** | **str** | | [optional] -**message** | **str** | | [optional] +**code** | **int** | HTTP status code | [optional] +**message** | **str** | Error message | [optional] +**status** | **str** | HTTP status description | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/ErrorDetails.md b/jcapiv2/docs/ErrorDetails.md new file mode 100644 index 0000000..566f269 --- /dev/null +++ b/jcapiv2/docs/ErrorDetails.md @@ -0,0 +1,9 @@ +# ErrorDetails + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**details** | **list[object]** | Describes a list of objects with more detailed information of the given error. Each detail schema is according to one of the messages defined in Google's API: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Errorresponse.md b/jcapiv2/docs/Errorresponse.md deleted file mode 100644 index cac8ad6..0000000 --- a/jcapiv2/docs/Errorresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# Errorresponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**message** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv2/docs/FdeApi.md b/jcapiv2/docs/FdeApi.md index 89d625d..56f472a 100644 --- a/jcapiv2/docs/FdeApi.md +++ b/jcapiv2/docs/FdeApi.md @@ -6,7 +6,6 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**systems_get_fde_key**](FdeApi.md#systems_get_fde_key) | **GET** /systems/{system_id}/fdekey | Get System FDE Key - # **systems_get_fde_key** > Systemfdekey systems_get_fde_key(system_id, x_org_id=x_org_id) @@ -31,7 +30,7 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.FdeApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Get System FDE Key @@ -46,7 +45,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| | - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -58,7 +57,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/Feature.md b/jcapiv2/docs/Feature.md new file mode 100644 index 0000000..a8134aa --- /dev/null +++ b/jcapiv2/docs/Feature.md @@ -0,0 +1,9 @@ +# Feature + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The unique identifier for this feature. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Filter.md b/jcapiv2/docs/Filter.md new file mode 100644 index 0000000..2f1f446 --- /dev/null +++ b/jcapiv2/docs/Filter.md @@ -0,0 +1,11 @@ +# Filter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field** | **str** | Name of field in filter target object. | +**operator** | **str** | Filter comparison operator. | +**value** | **str** | Filter comparison value. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/FilterQuery.md b/jcapiv2/docs/FilterQuery.md new file mode 100644 index 0000000..33331b6 --- /dev/null +++ b/jcapiv2/docs/FilterQuery.md @@ -0,0 +1,9 @@ +# FilterQuery + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filters** | [**list[Filter]**](Filter.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GSuiteApi.md b/jcapiv2/docs/GSuiteApi.md index 28cbca7..fd06164 100644 --- a/jcapiv2/docs/GSuiteApi.md +++ b/jcapiv2/docs/GSuiteApi.md @@ -9,15 +9,16 @@ Method | HTTP request | Description [**graph_g_suite_traverse_user**](GSuiteApi.md#graph_g_suite_traverse_user) | **GET** /gsuites/{gsuite_id}/users | List the Users bound to a G Suite instance [**graph_g_suite_traverse_user_group**](GSuiteApi.md#graph_g_suite_traverse_user_group) | **GET** /gsuites/{gsuite_id}/usergroups | List the User Groups bound to a G Suite instance [**gsuites_get**](GSuiteApi.md#gsuites_get) | **GET** /gsuites/{id} | Get G Suite +[**gsuites_list_import_jumpcloud_users**](GSuiteApi.md#gsuites_list_import_jumpcloud_users) | **GET** /gsuites/{gsuite_id}/import/jumpcloudusers | Get a list of users in Jumpcloud format to import from a Google Workspace account. +[**gsuites_list_import_users**](GSuiteApi.md#gsuites_list_import_users) | **GET** /gsuites/{gsuite_id}/import/users | Get a list of users to import from a G Suite instance [**gsuites_patch**](GSuiteApi.md#gsuites_patch) | **PATCH** /gsuites/{id} | Update existing G Suite [**translation_rules_g_suite_delete**](GSuiteApi.md#translation_rules_g_suite_delete) | **DELETE** /gsuites/{gsuite_id}/translationrules/{id} | Deletes a G Suite translation rule [**translation_rules_g_suite_get**](GSuiteApi.md#translation_rules_g_suite_get) | **GET** /gsuites/{gsuite_id}/translationrules/{id} | Gets a specific G Suite translation rule [**translation_rules_g_suite_list**](GSuiteApi.md#translation_rules_g_suite_list) | **GET** /gsuites/{gsuite_id}/translationrules | List all the G Suite Translation Rules [**translation_rules_g_suite_post**](GSuiteApi.md#translation_rules_g_suite_post) | **POST** /gsuites/{gsuite_id}/translationrules | Create a new G Suite Translation Rule - # **graph_g_suite_associations_list** -> list[GraphConnection] graph_g_suite_associations_list(gsuite_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_g_suite_associations_list(gsuite_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of a G Suite instance @@ -40,16 +41,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GSuiteApi(jcapiv2.ApiClient(configuration)) gsuite_id = 'gsuite_id_example' # str | ObjectID of the G Suite instance. -targets = ['targets_example'] # list[str] | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +targets = ['targets_example'] # list[str] | Targets which a \"g_suite\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of a G Suite instance - api_response = api_instance.graph_g_suite_associations_list(gsuite_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_g_suite_associations_list(gsuite_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling GSuiteApi->graph_g_suite_associations_list: %s\n" % e) @@ -60,12 +59,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **gsuite_id** | **str**| ObjectID of the G Suite instance. | - **targets** | [**list[str]**](str.md)| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **targets** | [**list[str]**](str.md)| Targets which a \"g_suite\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -77,7 +74,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -87,7 +84,7 @@ Name | Type | Description | Notes Manage the associations of a G Suite instance -This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` +This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` ### Example ```python @@ -106,8 +103,8 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GSuiteApi(jcapiv2.ApiClient(configuration)) gsuite_id = 'gsuite_id_example' # str | ObjectID of the G Suite instance. -body = jcapiv2.GraphManagementReq() # GraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationGSuite() # GraphOperationGSuite | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of a G Suite instance @@ -121,8 +118,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **gsuite_id** | **str**| ObjectID of the G Suite instance. | - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationGSuite**](GraphOperationGSuite.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -135,12 +132,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_g_suite_traverse_user** -> list[GraphObjectWithPaths] graph_g_suite_traverse_user(gsuite_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_g_suite_traverse_user(gsuite_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Users bound to a G Suite instance @@ -163,16 +160,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GSuiteApi(jcapiv2.ApiClient(configuration)) gsuite_id = 'gsuite_id_example' # str | ObjectID of the G Suite instance. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Users bound to a G Suite instance - api_response = api_instance.graph_g_suite_traverse_user(gsuite_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_g_suite_traverse_user(gsuite_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GSuiteApi->graph_g_suite_traverse_user: %s\n" % e) @@ -183,12 +178,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **gsuite_id** | **str**| ObjectID of the G Suite instance. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -200,13 +193,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_g_suite_traverse_user_group** -> list[GraphObjectWithPaths] graph_g_suite_traverse_user_group(gsuite_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_g_suite_traverse_user_group(gsuite_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the User Groups bound to a G Suite instance @@ -229,16 +222,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GSuiteApi(jcapiv2.ApiClient(configuration)) gsuite_id = 'gsuite_id_example' # str | ObjectID of the G Suite instance. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the User Groups bound to a G Suite instance - api_response = api_instance.graph_g_suite_traverse_user_group(gsuite_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_g_suite_traverse_user_group(gsuite_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GSuiteApi->graph_g_suite_traverse_user_group: %s\n" % e) @@ -249,12 +240,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **gsuite_id** | **str**| ObjectID of the G Suite instance. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -266,13 +255,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **gsuites_get** -> GsuiteOutput gsuites_get(id, content_type, accept, x_org_id=x_org_id) +> GsuiteOutput gsuites_get(id, x_org_id=x_org_id) Get G Suite @@ -286,16 +275,20 @@ import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + # create an instance of the API class -api_instance = jcapiv2.GSuiteApi() +api_instance = jcapiv2.GSuiteApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | Unique identifier of the GSuite. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Get G Suite - api_response = api_instance.gsuites_get(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.gsuites_get(id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling GSuiteApi->gsuites_get: %s\n" % e) @@ -306,9 +299,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| Unique identifier of the GSuite. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -316,21 +307,151 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[x-api-key](../README.md#x-api-key) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **gsuites_list_import_jumpcloud_users** +> InlineResponse2001 gsuites_list_import_jumpcloud_users(gsuite_id, max_results=max_results, order_by=order_by, page_token=page_token, query=query, sort_order=sort_order) + +Get a list of users in Jumpcloud format to import from a Google Workspace account. + +Lists available G Suite users for import, translated to the Jumpcloud user schema. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.GSuiteApi(jcapiv2.ApiClient(configuration)) +gsuite_id = 'gsuite_id_example' # str | +max_results = 56 # int | Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. (optional) +order_by = 'order_by_example' # str | Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. (optional) +page_token = 'page_token_example' # str | Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. (optional) +query = 'query_example' # str | Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. (optional) +sort_order = 'sort_order_example' # str | Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. (optional) + +try: + # Get a list of users in Jumpcloud format to import from a Google Workspace account. + api_response = api_instance.gsuites_list_import_jumpcloud_users(gsuite_id, max_results=max_results, order_by=order_by, page_token=page_token, query=query, sort_order=sort_order) + pprint(api_response) +except ApiException as e: + print("Exception when calling GSuiteApi->gsuites_list_import_jumpcloud_users: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **gsuite_id** | **str**| | + **max_results** | **int**| Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | [optional] + **order_by** | **str**| Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | [optional] + **page_token** | **str**| Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | [optional] + **query** | **str**| Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. | [optional] + **sort_order** | **str**| Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | [optional] + +### Return type + +[**InlineResponse2001**](InlineResponse2001.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **gsuites_list_import_users** +> InlineResponse2002 gsuites_list_import_users(gsuite_id, limit=limit, max_results=max_results, order_by=order_by, page_token=page_token, query=query, sort_order=sort_order) + +Get a list of users to import from a G Suite instance + +Lists G Suite users available for import. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.GSuiteApi(jcapiv2.ApiClient(configuration)) +gsuite_id = 'gsuite_id_example' # str | +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +max_results = 56 # int | Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. (optional) +order_by = 'order_by_example' # str | Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. (optional) +page_token = 'page_token_example' # str | Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. (optional) +query = 'query_example' # str | Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. (optional) +sort_order = 'sort_order_example' # str | Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. (optional) + +try: + # Get a list of users to import from a G Suite instance + api_response = api_instance.gsuites_list_import_users(gsuite_id, limit=limit, max_results=max_results, order_by=order_by, page_token=page_token, query=query, sort_order=sort_order) + pprint(api_response) +except ApiException as e: + print("Exception when calling GSuiteApi->gsuites_list_import_users: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **gsuite_id** | **str**| | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **max_results** | **int**| Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | [optional] + **order_by** | **str**| Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | [optional] + **page_token** | **str**| Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | [optional] + **query** | **str**| Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. | [optional] + **sort_order** | **str**| Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | [optional] + +### Return type + +[**InlineResponse2002**](InlineResponse2002.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **gsuites_patch** -> GsuiteOutput gsuites_patch(id, content_type, accept, body=body, x_org_id=x_org_id) +> GsuiteOutput gsuites_patch(id, body=body, x_org_id=x_org_id) Update existing G Suite -This endpoint allows updating some attributes of a G Suite. ##### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"remove\", \"userPasswordExpirationAction\": \"disable\" }' ``` +This endpoint allows updating some attributes of a G Suite. ##### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"suspend\", \"userPasswordExpirationAction\": \"maintain\" }' ``` ### Example ```python @@ -343,14 +464,12 @@ from pprint import pprint # create an instance of the API class api_instance = jcapiv2.GSuiteApi() id = 'id_example' # str | Unique identifier of the GSuite. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv2.GsuitePatchInput() # GsuitePatchInput | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Update existing G Suite - api_response = api_instance.gsuites_patch(id, content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.gsuites_patch(id, body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling GSuiteApi->gsuites_patch: %s\n" % e) @@ -361,10 +480,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| Unique identifier of the GSuite. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**GsuitePatchInput**](GsuitePatchInput.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -382,7 +499,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **translation_rules_g_suite_delete** -> translation_rules_g_suite_delete(gsuite_id, id, content_type, accept) +> translation_rules_g_suite_delete(gsuite_id, id) Deletes a G Suite translation rule @@ -406,12 +523,10 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' api_instance = jcapiv2.GSuiteApi(jcapiv2.ApiClient(configuration)) gsuite_id = 'gsuite_id_example' # str | id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) try: # Deletes a G Suite translation rule - api_instance.translation_rules_g_suite_delete(gsuite_id, id, content_type, accept) + api_instance.translation_rules_g_suite_delete(gsuite_id, id) except ApiException as e: print("Exception when calling GSuiteApi->translation_rules_g_suite_delete: %s\n" % e) ``` @@ -422,8 +537,6 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **gsuite_id** | **str**| | **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] ### Return type @@ -435,13 +548,13 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **translation_rules_g_suite_get** -> GSuiteTranslationRule translation_rules_g_suite_get(gsuite_id, id, content_type, accept) +> GSuiteTranslationRule translation_rules_g_suite_get(gsuite_id, id) Gets a specific G Suite translation rule @@ -465,12 +578,10 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' api_instance = jcapiv2.GSuiteApi(jcapiv2.ApiClient(configuration)) gsuite_id = 'gsuite_id_example' # str | id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) try: # Gets a specific G Suite translation rule - api_response = api_instance.translation_rules_g_suite_get(gsuite_id, id, content_type, accept) + api_response = api_instance.translation_rules_g_suite_get(gsuite_id, id) pprint(api_response) except ApiException as e: print("Exception when calling GSuiteApi->translation_rules_g_suite_get: %s\n" % e) @@ -482,8 +593,6 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **gsuite_id** | **str**| | **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] ### Return type @@ -495,13 +604,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **translation_rules_g_suite_list** -> list[GSuiteTranslationRule] translation_rules_g_suite_list(gsuite_id, content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) +> list[GSuiteTranslationRule] translation_rules_g_suite_list(gsuite_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) List all the G Suite Translation Rules @@ -524,17 +633,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GSuiteApi(jcapiv2.ApiClient(configuration)) gsuite_id = 'gsuite_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) try: # List all the G Suite Translation Rules - api_response = api_instance.translation_rules_g_suite_list(gsuite_id, content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + api_response = api_instance.translation_rules_g_suite_list(gsuite_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) pprint(api_response) except ApiException as e: print("Exception when calling GSuiteApi->translation_rules_g_suite_list: %s\n" % e) @@ -545,13 +652,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **gsuite_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] ### Return type @@ -563,17 +668,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **translation_rules_g_suite_post** -> GSuiteTranslationRule translation_rules_g_suite_post(gsuite_id, content_type, accept, body=body) +> GSuiteTranslationRule translation_rules_g_suite_post(gsuite_id, body=body) Create a new G Suite Translation Rule -This endpoint allows you to create a translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` +This endpoint allows you to create a translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` ### Example ```python @@ -592,13 +697,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GSuiteApi(jcapiv2.ApiClient(configuration)) gsuite_id = 'gsuite_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv2.GSuiteTranslationRuleRequest() # GSuiteTranslationRuleRequest | (optional) try: # Create a new G Suite Translation Rule - api_response = api_instance.translation_rules_g_suite_post(gsuite_id, content_type, accept, body=body) + api_response = api_instance.translation_rules_g_suite_post(gsuite_id, body=body) pprint(api_response) except ApiException as e: print("Exception when calling GSuiteApi->translation_rules_g_suite_post: %s\n" % e) @@ -609,8 +712,6 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **gsuite_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**GSuiteTranslationRuleRequest**](GSuiteTranslationRuleRequest.md)| | [optional] ### Return type diff --git a/jcapiv2/docs/GSuiteBuiltinTranslation.md b/jcapiv2/docs/GSuiteBuiltinTranslation.md index 86dc314..210529c 100644 --- a/jcapiv2/docs/GSuiteBuiltinTranslation.md +++ b/jcapiv2/docs/GSuiteBuiltinTranslation.md @@ -6,4 +6,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/GSuiteDirectionTranslation.md b/jcapiv2/docs/GSuiteDirectionTranslation.md new file mode 100644 index 0000000..c5201f1 --- /dev/null +++ b/jcapiv2/docs/GSuiteDirectionTranslation.md @@ -0,0 +1,8 @@ +# GSuiteDirectionTranslation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GSuiteImportApi.md b/jcapiv2/docs/GSuiteImportApi.md new file mode 100644 index 0000000..35324f4 --- /dev/null +++ b/jcapiv2/docs/GSuiteImportApi.md @@ -0,0 +1,139 @@ +# jcapiv2.GSuiteImportApi + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**gsuites_list_import_jumpcloud_users**](GSuiteImportApi.md#gsuites_list_import_jumpcloud_users) | **GET** /gsuites/{gsuite_id}/import/jumpcloudusers | Get a list of users in Jumpcloud format to import from a Google Workspace account. +[**gsuites_list_import_users**](GSuiteImportApi.md#gsuites_list_import_users) | **GET** /gsuites/{gsuite_id}/import/users | Get a list of users to import from a G Suite instance + +# **gsuites_list_import_jumpcloud_users** +> InlineResponse2001 gsuites_list_import_jumpcloud_users(gsuite_id, max_results=max_results, order_by=order_by, page_token=page_token, query=query, sort_order=sort_order) + +Get a list of users in Jumpcloud format to import from a Google Workspace account. + +Lists available G Suite users for import, translated to the Jumpcloud user schema. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.GSuiteImportApi(jcapiv2.ApiClient(configuration)) +gsuite_id = 'gsuite_id_example' # str | +max_results = 56 # int | Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. (optional) +order_by = 'order_by_example' # str | Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. (optional) +page_token = 'page_token_example' # str | Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. (optional) +query = 'query_example' # str | Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. (optional) +sort_order = 'sort_order_example' # str | Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. (optional) + +try: + # Get a list of users in Jumpcloud format to import from a Google Workspace account. + api_response = api_instance.gsuites_list_import_jumpcloud_users(gsuite_id, max_results=max_results, order_by=order_by, page_token=page_token, query=query, sort_order=sort_order) + pprint(api_response) +except ApiException as e: + print("Exception when calling GSuiteImportApi->gsuites_list_import_jumpcloud_users: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **gsuite_id** | **str**| | + **max_results** | **int**| Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | [optional] + **order_by** | **str**| Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | [optional] + **page_token** | **str**| Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | [optional] + **query** | **str**| Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. | [optional] + **sort_order** | **str**| Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | [optional] + +### Return type + +[**InlineResponse2001**](InlineResponse2001.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **gsuites_list_import_users** +> InlineResponse2002 gsuites_list_import_users(gsuite_id, limit=limit, max_results=max_results, order_by=order_by, page_token=page_token, query=query, sort_order=sort_order) + +Get a list of users to import from a G Suite instance + +Lists G Suite users available for import. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.GSuiteImportApi(jcapiv2.ApiClient(configuration)) +gsuite_id = 'gsuite_id_example' # str | +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +max_results = 56 # int | Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. (optional) +order_by = 'order_by_example' # str | Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. (optional) +page_token = 'page_token_example' # str | Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. (optional) +query = 'query_example' # str | Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. (optional) +sort_order = 'sort_order_example' # str | Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. (optional) + +try: + # Get a list of users to import from a G Suite instance + api_response = api_instance.gsuites_list_import_users(gsuite_id, limit=limit, max_results=max_results, order_by=order_by, page_token=page_token, query=query, sort_order=sort_order) + pprint(api_response) +except ApiException as e: + print("Exception when calling GSuiteImportApi->gsuites_list_import_users: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **gsuite_id** | **str**| | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **max_results** | **int**| Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | [optional] + **order_by** | **str**| Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | [optional] + **page_token** | **str**| Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | [optional] + **query** | **str**| Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. | [optional] + **sort_order** | **str**| Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | [optional] + +### Return type + +[**InlineResponse2002**](InlineResponse2002.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GSuiteTranslationRule.md b/jcapiv2/docs/GSuiteTranslationRule.md index ff7389d..2c9acbf 100644 --- a/jcapiv2/docs/GSuiteTranslationRule.md +++ b/jcapiv2/docs/GSuiteTranslationRule.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **built_in** | [**GSuiteBuiltinTranslation**](GSuiteBuiltinTranslation.md) | | [optional] +**direction** | [**GSuiteDirectionTranslation**](GSuiteDirectionTranslation.md) | | [optional] **id** | **str** | ObjectId uniquely identifying a Translation Rule. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/GSuiteTranslationRuleRequest.md b/jcapiv2/docs/GSuiteTranslationRuleRequest.md index 88fe1ab..2e308d7 100644 --- a/jcapiv2/docs/GSuiteTranslationRuleRequest.md +++ b/jcapiv2/docs/GSuiteTranslationRuleRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **built_in** | [**GSuiteBuiltinTranslation**](GSuiteBuiltinTranslation.md) | | [optional] +**direction** | [**GSuiteDirectionTranslation**](GSuiteDirectionTranslation.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/GraphApi.md b/jcapiv2/docs/GraphApi.md index f699f9d..3eaf42a 100644 --- a/jcapiv2/docs/GraphApi.md +++ b/jcapiv2/docs/GraphApi.md @@ -30,37 +30,49 @@ Method | HTTP request | Description [**graph_office365_traverse_user_group**](GraphApi.md#graph_office365_traverse_user_group) | **GET** /office365s/{office365_id}/usergroups | List the User Groups bound to an Office 365 instance [**graph_policy_associations_list**](GraphApi.md#graph_policy_associations_list) | **GET** /policies/{policy_id}/associations | List the associations of a Policy [**graph_policy_associations_post**](GraphApi.md#graph_policy_associations_post) | **POST** /policies/{policy_id}/associations | Manage the associations of a Policy +[**graph_policy_group_associations_list**](GraphApi.md#graph_policy_group_associations_list) | **GET** /policygroups/{group_id}/associations | List the associations of a Policy Group. +[**graph_policy_group_associations_post**](GraphApi.md#graph_policy_group_associations_post) | **POST** /policygroups/{group_id}/associations | Manage the associations of a Policy Group +[**graph_policy_group_members_list**](GraphApi.md#graph_policy_group_members_list) | **GET** /policygroups/{group_id}/members | List the members of a Policy Group +[**graph_policy_group_members_post**](GraphApi.md#graph_policy_group_members_post) | **POST** /policygroups/{group_id}/members | Manage the members of a Policy Group +[**graph_policy_group_membership**](GraphApi.md#graph_policy_group_membership) | **GET** /policygroups/{group_id}/membership | List the Policy Group's membership +[**graph_policy_group_traverse_system**](GraphApi.md#graph_policy_group_traverse_system) | **GET** /policygroups/{group_id}/systems | List the Systems bound to a Policy Group +[**graph_policy_group_traverse_system_group**](GraphApi.md#graph_policy_group_traverse_system_group) | **GET** /policygroups/{group_id}/systemgroups | List the System Groups bound to Policy Groups +[**graph_policy_member_of**](GraphApi.md#graph_policy_member_of) | **GET** /policies/{policy_id}/memberof | List the parent Groups of a Policy [**graph_policy_traverse_system**](GraphApi.md#graph_policy_traverse_system) | **GET** /policies/{policy_id}/systems | List the Systems bound to a Policy [**graph_policy_traverse_system_group**](GraphApi.md#graph_policy_traverse_system_group) | **GET** /policies/{policy_id}/systemgroups | List the System Groups bound to a Policy [**graph_radius_server_associations_list**](GraphApi.md#graph_radius_server_associations_list) | **GET** /radiusservers/{radiusserver_id}/associations | List the associations of a RADIUS Server [**graph_radius_server_associations_post**](GraphApi.md#graph_radius_server_associations_post) | **POST** /radiusservers/{radiusserver_id}/associations | Manage the associations of a RADIUS Server [**graph_radius_server_traverse_user**](GraphApi.md#graph_radius_server_traverse_user) | **GET** /radiusservers/{radiusserver_id}/users | List the Users bound to a RADIUS Server [**graph_radius_server_traverse_user_group**](GraphApi.md#graph_radius_server_traverse_user_group) | **GET** /radiusservers/{radiusserver_id}/usergroups | List the User Groups bound to a RADIUS Server +[**graph_softwareapps_associations_list**](GraphApi.md#graph_softwareapps_associations_list) | **GET** /softwareapps/{software_app_id}/associations | List the associations of a Software Application +[**graph_softwareapps_associations_post**](GraphApi.md#graph_softwareapps_associations_post) | **POST** /softwareapps/{software_app_id}/associations | Manage the associations of a software application. +[**graph_softwareapps_traverse_system**](GraphApi.md#graph_softwareapps_traverse_system) | **GET** /softwareapps/{software_app_id}/systems | List the Systems bound to a Software App. +[**graph_softwareapps_traverse_system_group**](GraphApi.md#graph_softwareapps_traverse_system_group) | **GET** /softwareapps/{software_app_id}/systemgroups | List the System Groups bound to a Software App. [**graph_system_associations_list**](GraphApi.md#graph_system_associations_list) | **GET** /systems/{system_id}/associations | List the associations of a System [**graph_system_associations_post**](GraphApi.md#graph_system_associations_post) | **POST** /systems/{system_id}/associations | Manage associations of a System [**graph_system_group_associations_list**](GraphApi.md#graph_system_group_associations_list) | **GET** /systemgroups/{group_id}/associations | List the associations of a System Group [**graph_system_group_associations_post**](GraphApi.md#graph_system_group_associations_post) | **POST** /systemgroups/{group_id}/associations | Manage the associations of a System Group -[**graph_system_group_member_of**](GraphApi.md#graph_system_group_member_of) | **GET** /systemgroups/{group_id}/memberof | List the System Group's parents [**graph_system_group_members_list**](GraphApi.md#graph_system_group_members_list) | **GET** /systemgroups/{group_id}/members | List the members of a System Group [**graph_system_group_members_post**](GraphApi.md#graph_system_group_members_post) | **POST** /systemgroups/{group_id}/members | Manage the members of a System Group -[**graph_system_group_membership**](GraphApi.md#graph_system_group_membership) | **GET** /systemgroups/{group_id}/membership | List the System Group's membership +[**graph_system_group_membership**](GraphApi.md#graph_system_group_membership) | **GET** /systemgroups/{group_id}/membership | List the System Group's membership [**graph_system_group_traverse_command**](GraphApi.md#graph_system_group_traverse_command) | **GET** /systemgroups/{group_id}/commands | List the Commands bound to a System Group [**graph_system_group_traverse_policy**](GraphApi.md#graph_system_group_traverse_policy) | **GET** /systemgroups/{group_id}/policies | List the Policies bound to a System Group +[**graph_system_group_traverse_policy_group**](GraphApi.md#graph_system_group_traverse_policy_group) | **GET** /systemgroups/{group_id}/policygroups | List the Policy Groups bound to a System Group [**graph_system_group_traverse_user**](GraphApi.md#graph_system_group_traverse_user) | **GET** /systemgroups/{group_id}/users | List the Users bound to a System Group [**graph_system_group_traverse_user_group**](GraphApi.md#graph_system_group_traverse_user_group) | **GET** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group [**graph_system_member_of**](GraphApi.md#graph_system_member_of) | **GET** /systems/{system_id}/memberof | List the parent Groups of a System [**graph_system_traverse_command**](GraphApi.md#graph_system_traverse_command) | **GET** /systems/{system_id}/commands | List the Commands bound to a System [**graph_system_traverse_policy**](GraphApi.md#graph_system_traverse_policy) | **GET** /systems/{system_id}/policies | List the Policies bound to a System +[**graph_system_traverse_policy_group**](GraphApi.md#graph_system_traverse_policy_group) | **GET** /systems/{system_id}/policygroups | List the Policy Groups bound to a System [**graph_system_traverse_user**](GraphApi.md#graph_system_traverse_user) | **GET** /systems/{system_id}/users | List the Users bound to a System [**graph_system_traverse_user_group**](GraphApi.md#graph_system_traverse_user_group) | **GET** /systems/{system_id}/usergroups | List the User Groups bound to a System [**graph_user_associations_list**](GraphApi.md#graph_user_associations_list) | **GET** /users/{user_id}/associations | List the associations of a User [**graph_user_associations_post**](GraphApi.md#graph_user_associations_post) | **POST** /users/{user_id}/associations | Manage the associations of a User [**graph_user_group_associations_list**](GraphApi.md#graph_user_group_associations_list) | **GET** /usergroups/{group_id}/associations | List the associations of a User Group. [**graph_user_group_associations_post**](GraphApi.md#graph_user_group_associations_post) | **POST** /usergroups/{group_id}/associations | Manage the associations of a User Group -[**graph_user_group_member_of**](GraphApi.md#graph_user_group_member_of) | **GET** /usergroups/{group_id}/memberof | List the User Group's parents [**graph_user_group_members_list**](GraphApi.md#graph_user_group_members_list) | **GET** /usergroups/{group_id}/members | List the members of a User Group [**graph_user_group_members_post**](GraphApi.md#graph_user_group_members_post) | **POST** /usergroups/{group_id}/members | Manage the members of a User Group -[**graph_user_group_membership**](GraphApi.md#graph_user_group_membership) | **GET** /usergroups/{group_id}/membership | List the User Group's membership +[**graph_user_group_membership**](GraphApi.md#graph_user_group_membership) | **GET** /usergroups/{group_id}/membership | List the User Group's membership [**graph_user_group_traverse_active_directory**](GraphApi.md#graph_user_group_traverse_active_directory) | **GET** /usergroups/{group_id}/activedirectories | List the Active Directories bound to a User Group [**graph_user_group_traverse_application**](GraphApi.md#graph_user_group_traverse_application) | **GET** /usergroups/{group_id}/applications | List the Applications bound to a User Group [**graph_user_group_traverse_directory**](GraphApi.md#graph_user_group_traverse_directory) | **GET** /usergroups/{group_id}/directories | List the Directories bound to a User Group @@ -80,11 +92,10 @@ Method | HTTP request | Description [**graph_user_traverse_radius_server**](GraphApi.md#graph_user_traverse_radius_server) | **GET** /users/{user_id}/radiusservers | List the RADIUS Servers bound to a User [**graph_user_traverse_system**](GraphApi.md#graph_user_traverse_system) | **GET** /users/{user_id}/systems | List the Systems bound to a User [**graph_user_traverse_system_group**](GraphApi.md#graph_user_traverse_system_group) | **GET** /users/{user_id}/systemgroups | List the System Groups bound to a User -[**policystatuses_list**](GraphApi.md#policystatuses_list) | **GET** /systems/{system_id}/policystatuses | List the policy statuses for a system - +[**policystatuses_systems_list**](GraphApi.md#policystatuses_systems_list) | **GET** /systems/{system_id}/policystatuses | List the policy statuses for a system # **graph_active_directory_associations_list** -> list[GraphConnection] graph_active_directory_associations_list(activedirectory_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_active_directory_associations_list(activedirectory_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of an Active Directory instance @@ -107,16 +118,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) activedirectory_id = 'activedirectory_id_example' # str | -targets = ['targets_example'] # list[str] | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +targets = ['targets_example'] # list[str] | Targets which a \"active_directory\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of an Active Directory instance - api_response = api_instance.graph_active_directory_associations_list(activedirectory_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_active_directory_associations_list(activedirectory_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_active_directory_associations_list: %s\n" % e) @@ -127,12 +136,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **activedirectory_id** | **str**| | - **targets** | [**list[str]**](str.md)| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **targets** | [**list[str]**](str.md)| Targets which a \"active_directory\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -144,17 +151,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_active_directory_associations_post** -> graph_active_directory_associations_post(activedirectory_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_active_directory_associations_post(activedirectory_id, body=body, x_org_id=x_org_id) Manage the associations of an Active Directory instance -This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" } ' ``` +This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` ### Example ```python @@ -173,14 +180,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) activedirectory_id = 'activedirectory_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.GraphManagementReq() # GraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationActiveDirectory() # GraphOperationActiveDirectory | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of an Active Directory instance - api_instance.graph_active_directory_associations_post(activedirectory_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_active_directory_associations_post(activedirectory_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling GraphApi->graph_active_directory_associations_post: %s\n" % e) ``` @@ -190,10 +195,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **activedirectory_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationActiveDirectory**](GraphOperationActiveDirectory.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -206,12 +209,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_active_directory_traverse_user** -> list[GraphObjectWithPaths] graph_active_directory_traverse_user(activedirectory_id, content_type, accept, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip) +> list[GraphObjectWithPaths] graph_active_directory_traverse_user(activedirectory_id, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip) List the Users bound to an Active Directory instance @@ -234,16 +237,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) activedirectory_id = 'activedirectory_id_example' # str | ObjectID of the Active Directory instance. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) try: # List the Users bound to an Active Directory instance - api_response = api_instance.graph_active_directory_traverse_user(activedirectory_id, content_type, accept, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip) + api_response = api_instance.graph_active_directory_traverse_user(activedirectory_id, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_active_directory_traverse_user: %s\n" % e) @@ -254,11 +255,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **activedirectory_id** | **str**| ObjectID of the Active Directory instance. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] ### Return type @@ -271,13 +270,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_active_directory_traverse_user_group** -> list[GraphObjectWithPaths] graph_active_directory_traverse_user_group(activedirectory_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_active_directory_traverse_user_group(activedirectory_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the User Groups bound to an Active Directory instance @@ -300,16 +299,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) activedirectory_id = 'activedirectory_id_example' # str | ObjectID of the Active Directory instance. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the User Groups bound to an Active Directory instance - api_response = api_instance.graph_active_directory_traverse_user_group(activedirectory_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_active_directory_traverse_user_group(activedirectory_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_active_directory_traverse_user_group: %s\n" % e) @@ -320,12 +317,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **activedirectory_id** | **str**| ObjectID of the Active Directory instance. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -337,13 +332,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_application_associations_list** -> list[GraphConnection] graph_application_associations_list(application_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_application_associations_list(application_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of an Application @@ -366,16 +361,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) application_id = 'application_id_example' # str | ObjectID of the Application. -targets = ['targets_example'] # list[str] | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +targets = ['targets_example'] # list[str] | Targets which a \"application\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of an Application - api_response = api_instance.graph_application_associations_list(application_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_application_associations_list(application_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_application_associations_list: %s\n" % e) @@ -386,12 +379,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **application_id** | **str**| ObjectID of the Application. | - **targets** | [**list[str]**](str.md)| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **targets** | [**list[str]**](str.md)| Targets which a \"application\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -403,17 +394,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_application_associations_post** -> graph_application_associations_post(application_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_application_associations_post(application_id, body=body, x_org_id=x_org_id) Manage the associations of an Application -This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` +This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` ### Example ```python @@ -432,14 +423,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) application_id = 'application_id_example' # str | ObjectID of the Application. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.GraphManagementReq() # GraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationApplication() # GraphOperationApplication | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of an Application - api_instance.graph_application_associations_post(application_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_application_associations_post(application_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling GraphApi->graph_application_associations_post: %s\n" % e) ``` @@ -449,10 +438,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **application_id** | **str**| ObjectID of the Application. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationApplication**](GraphOperationApplication.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -465,12 +452,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_application_traverse_user** -> list[GraphObjectWithPaths] graph_application_traverse_user(application_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_application_traverse_user(application_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Users bound to an Application @@ -493,16 +480,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) application_id = 'application_id_example' # str | ObjectID of the Application. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Users bound to an Application - api_response = api_instance.graph_application_traverse_user(application_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_application_traverse_user(application_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_application_traverse_user: %s\n" % e) @@ -513,12 +498,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **application_id** | **str**| ObjectID of the Application. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -530,13 +513,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_application_traverse_user_group** -> list[GraphObjectWithPaths] graph_application_traverse_user_group(application_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_application_traverse_user_group(application_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the User Groups bound to an Application @@ -559,16 +542,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) application_id = 'application_id_example' # str | ObjectID of the Application. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the User Groups bound to an Application - api_response = api_instance.graph_application_traverse_user_group(application_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_application_traverse_user_group(application_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_application_traverse_user_group: %s\n" % e) @@ -579,12 +560,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **application_id** | **str**| ObjectID of the Application. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -596,13 +575,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_command_associations_list** -> list[GraphConnection] graph_command_associations_list(command_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_command_associations_list(command_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of a Command @@ -625,16 +604,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) command_id = 'command_id_example' # str | ObjectID of the Command. -targets = ['targets_example'] # list[str] | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +targets = ['targets_example'] # list[str] | Targets which a \"command\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of a Command - api_response = api_instance.graph_command_associations_list(command_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_command_associations_list(command_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_command_associations_list: %s\n" % e) @@ -645,12 +622,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **command_id** | **str**| ObjectID of the Command. | - **targets** | [**list[str]**](str.md)| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **targets** | [**list[str]**](str.md)| Targets which a \"command\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -662,17 +637,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_command_associations_post** -> graph_command_associations_post(command_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_command_associations_post(command_id, body=body, x_org_id=x_org_id) Manage the associations of a Command -This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` +This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` ### Example ```python @@ -691,14 +666,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) command_id = 'command_id_example' # str | ObjectID of the Command. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.GraphManagementReq() # GraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationCommand() # GraphOperationCommand | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of a Command - api_instance.graph_command_associations_post(command_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_command_associations_post(command_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling GraphApi->graph_command_associations_post: %s\n" % e) ``` @@ -708,10 +681,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **command_id** | **str**| ObjectID of the Command. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationCommand**](GraphOperationCommand.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -724,12 +695,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_command_traverse_system** -> list[GraphObjectWithPaths] graph_command_traverse_system(command_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_command_traverse_system(command_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Systems bound to a Command @@ -752,16 +723,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) command_id = 'command_id_example' # str | ObjectID of the Command. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Systems bound to a Command - api_response = api_instance.graph_command_traverse_system(command_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_command_traverse_system(command_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_command_traverse_system: %s\n" % e) @@ -772,12 +741,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **command_id** | **str**| ObjectID of the Command. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -789,13 +756,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_command_traverse_system_group** -> list[GraphObjectWithPaths] graph_command_traverse_system_group(command_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_command_traverse_system_group(command_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the System Groups bound to a Command @@ -818,16 +785,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) command_id = 'command_id_example' # str | ObjectID of the Command. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the System Groups bound to a Command - api_response = api_instance.graph_command_traverse_system_group(command_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_command_traverse_system_group(command_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_command_traverse_system_group: %s\n" % e) @@ -838,12 +803,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **command_id** | **str**| ObjectID of the Command. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -855,13 +818,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_g_suite_associations_list** -> list[GraphConnection] graph_g_suite_associations_list(gsuite_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_g_suite_associations_list(gsuite_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of a G Suite instance @@ -884,16 +847,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) gsuite_id = 'gsuite_id_example' # str | ObjectID of the G Suite instance. -targets = ['targets_example'] # list[str] | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +targets = ['targets_example'] # list[str] | Targets which a \"g_suite\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of a G Suite instance - api_response = api_instance.graph_g_suite_associations_list(gsuite_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_g_suite_associations_list(gsuite_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_g_suite_associations_list: %s\n" % e) @@ -904,12 +865,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **gsuite_id** | **str**| ObjectID of the G Suite instance. | - **targets** | [**list[str]**](str.md)| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **targets** | [**list[str]**](str.md)| Targets which a \"g_suite\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -921,7 +880,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -931,7 +890,7 @@ Name | Type | Description | Notes Manage the associations of a G Suite instance -This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` +This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` ### Example ```python @@ -950,8 +909,8 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) gsuite_id = 'gsuite_id_example' # str | ObjectID of the G Suite instance. -body = jcapiv2.GraphManagementReq() # GraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationGSuite() # GraphOperationGSuite | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of a G Suite instance @@ -965,8 +924,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **gsuite_id** | **str**| ObjectID of the G Suite instance. | - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationGSuite**](GraphOperationGSuite.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -979,12 +938,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_g_suite_traverse_user** -> list[GraphObjectWithPaths] graph_g_suite_traverse_user(gsuite_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_g_suite_traverse_user(gsuite_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Users bound to a G Suite instance @@ -1007,16 +966,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) gsuite_id = 'gsuite_id_example' # str | ObjectID of the G Suite instance. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Users bound to a G Suite instance - api_response = api_instance.graph_g_suite_traverse_user(gsuite_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_g_suite_traverse_user(gsuite_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_g_suite_traverse_user: %s\n" % e) @@ -1027,12 +984,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **gsuite_id** | **str**| ObjectID of the G Suite instance. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -1044,13 +999,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_g_suite_traverse_user_group** -> list[GraphObjectWithPaths] graph_g_suite_traverse_user_group(gsuite_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_g_suite_traverse_user_group(gsuite_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the User Groups bound to a G Suite instance @@ -1073,16 +1028,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) gsuite_id = 'gsuite_id_example' # str | ObjectID of the G Suite instance. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the User Groups bound to a G Suite instance - api_response = api_instance.graph_g_suite_traverse_user_group(gsuite_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_g_suite_traverse_user_group(gsuite_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_g_suite_traverse_user_group: %s\n" % e) @@ -1093,12 +1046,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **gsuite_id** | **str**| ObjectID of the G Suite instance. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -1110,13 +1061,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_ldap_server_associations_list** -> list[GraphConnection] graph_ldap_server_associations_list(ldapserver_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_ldap_server_associations_list(ldapserver_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of a LDAP Server @@ -1139,16 +1090,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) ldapserver_id = 'ldapserver_id_example' # str | ObjectID of the LDAP Server. -targets = ['targets_example'] # list[str] | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +targets = ['targets_example'] # list[str] | Targets which a \"ldap_server\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of a LDAP Server - api_response = api_instance.graph_ldap_server_associations_list(ldapserver_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_ldap_server_associations_list(ldapserver_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_ldap_server_associations_list: %s\n" % e) @@ -1159,12 +1108,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ldapserver_id** | **str**| ObjectID of the LDAP Server. | - **targets** | [**list[str]**](str.md)| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **targets** | [**list[str]**](str.md)| Targets which a \"ldap_server\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -1176,17 +1123,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_ldap_server_associations_post** -> graph_ldap_server_associations_post(ldapserver_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_ldap_server_associations_post(ldapserver_id, body=body, x_org_id=x_org_id) Manage the associations of a LDAP Server -This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` +This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` ### Example ```python @@ -1205,14 +1152,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) ldapserver_id = 'ldapserver_id_example' # str | ObjectID of the LDAP Server. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.GraphManagementReq() # GraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationLdapServer() # GraphOperationLdapServer | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of a LDAP Server - api_instance.graph_ldap_server_associations_post(ldapserver_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_ldap_server_associations_post(ldapserver_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling GraphApi->graph_ldap_server_associations_post: %s\n" % e) ``` @@ -1222,10 +1167,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ldapserver_id** | **str**| ObjectID of the LDAP Server. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationLdapServer**](GraphOperationLdapServer.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -1238,12 +1181,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_ldap_server_traverse_user** -> list[GraphObjectWithPaths] graph_ldap_server_traverse_user(ldapserver_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_ldap_server_traverse_user(ldapserver_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Users bound to a LDAP Server @@ -1266,16 +1209,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) ldapserver_id = 'ldapserver_id_example' # str | ObjectID of the LDAP Server. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Users bound to a LDAP Server - api_response = api_instance.graph_ldap_server_traverse_user(ldapserver_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_ldap_server_traverse_user(ldapserver_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_ldap_server_traverse_user: %s\n" % e) @@ -1286,12 +1227,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ldapserver_id** | **str**| ObjectID of the LDAP Server. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -1303,13 +1242,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_ldap_server_traverse_user_group** -> list[GraphObjectWithPaths] graph_ldap_server_traverse_user_group(ldapserver_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_ldap_server_traverse_user_group(ldapserver_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the User Groups bound to a LDAP Server @@ -1332,16 +1271,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) ldapserver_id = 'ldapserver_id_example' # str | ObjectID of the LDAP Server. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the User Groups bound to a LDAP Server - api_response = api_instance.graph_ldap_server_traverse_user_group(ldapserver_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_ldap_server_traverse_user_group(ldapserver_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_ldap_server_traverse_user_group: %s\n" % e) @@ -1352,12 +1289,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ldapserver_id** | **str**| ObjectID of the LDAP Server. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -1369,17 +1304,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_office365_associations_list** -> list[GraphConnection] graph_office365_associations_list(office365_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_office365_associations_list(office365_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of an Office 365 instance -This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations?targets=user_group' \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -1398,16 +1333,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) office365_id = 'office365_id_example' # str | ObjectID of the Office 365 instance. -targets = ['targets_example'] # list[str] | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +targets = ['targets_example'] # list[str] | Targets which a \"office_365\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of an Office 365 instance - api_response = api_instance.graph_office365_associations_list(office365_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_office365_associations_list(office365_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_office365_associations_list: %s\n" % e) @@ -1418,12 +1351,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **office365_id** | **str**| ObjectID of the Office 365 instance. | - **targets** | [**list[str]**](str.md)| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **targets** | [**list[str]**](str.md)| Targets which a \"office_365\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -1435,17 +1366,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_office365_associations_post** -> graph_office365_associations_post(office365_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_office365_associations_post(office365_id, body=body, x_org_id=x_org_id) Manage the associations of an Office 365 instance -This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` +This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` ### Example ```python @@ -1464,14 +1395,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) office365_id = 'office365_id_example' # str | ObjectID of the Office 365 instance. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.GraphManagementReq() # GraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationOffice365() # GraphOperationOffice365 | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of an Office 365 instance - api_instance.graph_office365_associations_post(office365_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_office365_associations_post(office365_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling GraphApi->graph_office365_associations_post: %s\n" % e) ``` @@ -1481,10 +1410,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **office365_id** | **str**| ObjectID of the Office 365 instance. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationOffice365**](GraphOperationOffice365.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -1497,16 +1424,16 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_office365_traverse_user** -> list[GraphObjectWithPaths] graph_office365_traverse_user(office365_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_office365_traverse_user(office365_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Users bound to an Office 365 instance -This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -1525,16 +1452,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) office365_id = 'office365_id_example' # str | ObjectID of the Office 365 suite. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Users bound to an Office 365 instance - api_response = api_instance.graph_office365_traverse_user(office365_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_office365_traverse_user(office365_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_office365_traverse_user: %s\n" % e) @@ -1545,12 +1470,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **office365_id** | **str**| ObjectID of the Office 365 suite. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -1562,17 +1485,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_office365_traverse_user_group** -> list[GraphObjectWithPaths] graph_office365_traverse_user_group(office365_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_office365_traverse_user_group(office365_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the User Groups bound to an Office 365 instance -This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -1591,16 +1514,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) office365_id = 'office365_id_example' # str | ObjectID of the Office 365 suite. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the User Groups bound to an Office 365 instance - api_response = api_instance.graph_office365_traverse_user_group(office365_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_office365_traverse_user_group(office365_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_office365_traverse_user_group: %s\n" % e) @@ -1611,12 +1532,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **office365_id** | **str**| ObjectID of the Office 365 suite. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -1628,13 +1547,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_policy_associations_list** -> list[GraphConnection] graph_policy_associations_list(policy_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_policy_associations_list(policy_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of a Policy @@ -1657,16 +1576,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) policy_id = 'policy_id_example' # str | ObjectID of the Policy. -targets = ['targets_example'] # list[str] | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +targets = ['targets_example'] # list[str] | Targets which a \"policy\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of a Policy - api_response = api_instance.graph_policy_associations_list(policy_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_policy_associations_list(policy_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_policy_associations_list: %s\n" % e) @@ -1677,12 +1594,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **policy_id** | **str**| ObjectID of the Policy. | - **targets** | [**list[str]**](str.md)| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **targets** | [**list[str]**](str.md)| Targets which a \"policy\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -1694,17 +1609,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_policy_associations_post** -> graph_policy_associations_post(policy_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_policy_associations_post(policy_id, body=body, x_org_id=x_org_id) Manage the associations of a Policy -This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` +This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` ### Example ```python @@ -1723,14 +1638,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) policy_id = 'policy_id_example' # str | ObjectID of the Policy. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.GraphManagementReq() # GraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationPolicy() # GraphOperationPolicy | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of a Policy - api_instance.graph_policy_associations_post(policy_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_policy_associations_post(policy_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling GraphApi->graph_policy_associations_post: %s\n" % e) ``` @@ -1740,10 +1653,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **policy_id** | **str**| ObjectID of the Policy. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationPolicy**](GraphOperationPolicy.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -1756,16 +1667,78 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_group_associations_list** +> list[GraphConnection] graph_policy_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) + +List the associations of a Policy Group. + +This endpoint returns the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +targets = ['targets_example'] # list[str] | Targets which a \"policy_group\" can be associated to. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List the associations of a Policy Group. + api_response = api_instance.graph_policy_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling GraphApi->graph_policy_group_associations_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **targets** | [**list[str]**](str.md)| Targets which a \"policy_group\" can be associated to. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**list[GraphConnection]**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_policy_traverse_system** -> list[GraphObjectWithPaths] graph_policy_traverse_system(policy_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +# **graph_policy_group_associations_post** +> graph_policy_group_associations_post(group_id, body=body, x_org_id=x_org_id) -List the Systems bound to a Policy +Manage the associations of a Policy Group -This endpoint will return all Systems bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint manages the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` ### Example ```python @@ -1783,37 +1756,145 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) -policy_id = 'policy_id_example' # str | ObjectID of the Command. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +body = jcapiv2.GraphOperationPolicyGroup() # GraphOperationPolicyGroup | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Manage the associations of a Policy Group + api_instance.graph_policy_group_associations_post(group_id, body=body, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling GraphApi->graph_policy_group_associations_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **body** | [**GraphOperationPolicyGroup**](GraphOperationPolicyGroup.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_group_members_list** +> list[GraphConnection] graph_policy_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) + +List the members of a Policy Group + +This endpoint returns the Policy members of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # List the Systems bound to a Policy - api_response = api_instance.graph_policy_traverse_system(policy_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + # List the members of a Policy Group + api_response = api_instance.graph_policy_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: - print("Exception when calling GraphApi->graph_policy_traverse_system: %s\n" % e) + print("Exception when calling GraphApi->graph_policy_group_members_list: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **policy_id** | **str**| ObjectID of the Command. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **group_id** | **str**| ObjectID of the Policy Group. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) +[**list[GraphConnection]**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_group_members_post** +> graph_policy_group_members_post(group_id, body=body, x_org_id=x_org_id) + +Manage the members of a Policy Group + +This endpoint allows you to manage the Policy members of a Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"policy\", \"id\": \"{Policy_ID}\" }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +body = jcapiv2.GraphOperationPolicyGroupMember() # GraphOperationPolicyGroupMember | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Manage the members of a Policy Group + api_instance.graph_policy_group_members_post(group_id, body=body, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling GraphApi->graph_policy_group_members_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **body** | [**GraphOperationPolicyGroupMember**](GraphOperationPolicyGroupMember.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) ### Authorization @@ -1822,16 +1903,577 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_group_membership** +> list[GraphObjectWithPaths] graph_policy_group_membership(group_id, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + +List the Policy Group's membership + +This endpoint returns all Policy members that are a member of this Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List the Policy Group's membership + api_response = api_instance.graph_policy_group_membership(group_id, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling GraphApi->graph_policy_group_membership: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_policy_traverse_system_group** -> list[GraphObjectWithPaths] graph_policy_traverse_system_group(policy_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +# **graph_policy_group_traverse_system** +> list[GraphObjectWithPaths] graph_policy_group_traverse_system(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) -List the System Groups bound to a Policy +List the Systems bound to a Policy Group -This endpoint will return all Systems Groups bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint will return all Systems bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) + +try: + # List the Systems bound to a Policy Group + api_response = api_instance.graph_policy_group_traverse_system(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + pprint(api_response) +except ApiException as e: + print("Exception when calling GraphApi->graph_policy_group_traverse_system: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_group_traverse_system_group** +> list[GraphObjectWithPaths] graph_policy_group_traverse_system_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + +List the System Groups bound to Policy Groups + +This endpoint will return all System Groups bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) + +try: + # List the System Groups bound to Policy Groups + api_response = api_instance.graph_policy_group_traverse_system_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + pprint(api_response) +except ApiException as e: + print("Exception when calling GraphApi->graph_policy_group_traverse_system_group: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_member_of** +> list[GraphObjectWithPaths] graph_policy_member_of(policy_id, filter=filter, limit=limit, skip=skip, _date=_date, authorization=authorization, sort=sort, x_org_id=x_org_id) + +List the parent Groups of a Policy + +This endpoint returns all the Policy Groups a Policy is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) +policy_id = 'policy_id_example' # str | ObjectID of the Policy. +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +_date = '_date_example' # str | Current date header for the System Context API (optional) +authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List the parent Groups of a Policy + api_response = api_instance.graph_policy_member_of(policy_id, filter=filter, limit=limit, skip=skip, _date=_date, authorization=authorization, sort=sort, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling GraphApi->graph_policy_member_of: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **policy_id** | **str**| ObjectID of the Policy. | + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **_date** | **str**| Current date header for the System Context API | [optional] + **authorization** | **str**| Authorization header for the System Context API | [optional] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_traverse_system** +> list[GraphObjectWithPaths] graph_policy_traverse_system(policy_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + +List the Systems bound to a Policy + +This endpoint will return all Systems bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) +policy_id = 'policy_id_example' # str | ObjectID of the Command. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) + +try: + # List the Systems bound to a Policy + api_response = api_instance.graph_policy_traverse_system(policy_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + pprint(api_response) +except ApiException as e: + print("Exception when calling GraphApi->graph_policy_traverse_system: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **policy_id** | **str**| ObjectID of the Command. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_traverse_system_group** +> list[GraphObjectWithPaths] graph_policy_traverse_system_group(policy_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + +List the System Groups bound to a Policy + +This endpoint will return all Systems Groups bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) +policy_id = 'policy_id_example' # str | ObjectID of the Command. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) + +try: + # List the System Groups bound to a Policy + api_response = api_instance.graph_policy_traverse_system_group(policy_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + pprint(api_response) +except ApiException as e: + print("Exception when calling GraphApi->graph_policy_traverse_system_group: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **policy_id** | **str**| ObjectID of the Command. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_radius_server_associations_list** +> list[GraphConnection] graph_radius_server_associations_list(radiusserver_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) + +List the associations of a RADIUS Server + +This endpoint returns the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) +radiusserver_id = 'radiusserver_id_example' # str | ObjectID of the Radius Server. +targets = ['targets_example'] # list[str] | Targets which a \"radius_server\" can be associated to. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List the associations of a RADIUS Server + api_response = api_instance.graph_radius_server_associations_list(radiusserver_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling GraphApi->graph_radius_server_associations_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **radiusserver_id** | **str**| ObjectID of the Radius Server. | + **targets** | [**list[str]**](str.md)| Targets which a \"radius_server\" can be associated to. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**list[GraphConnection]**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_radius_server_associations_post** +> graph_radius_server_associations_post(radiusserver_id, body=body, x_org_id=x_org_id) + +Manage the associations of a RADIUS Server + +This endpoint allows you to manage the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"type\":\"user\", \"id\":\"{USER_ID}\", \"op\":\"add\" }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) +radiusserver_id = 'radiusserver_id_example' # str | ObjectID of the Radius Server. +body = jcapiv2.GraphOperationRadiusServer() # GraphOperationRadiusServer | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Manage the associations of a RADIUS Server + api_instance.graph_radius_server_associations_post(radiusserver_id, body=body, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling GraphApi->graph_radius_server_associations_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **radiusserver_id** | **str**| ObjectID of the Radius Server. | + **body** | [**GraphOperationRadiusServer**](GraphOperationRadiusServer.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_radius_server_traverse_user** +> list[GraphObjectWithPaths] graph_radius_server_traverse_user(radiusserver_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + +List the Users bound to a RADIUS Server + +This endpoint will return all Users bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) +radiusserver_id = 'radiusserver_id_example' # str | ObjectID of the Radius Server. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) + +try: + # List the Users bound to a RADIUS Server + api_response = api_instance.graph_radius_server_traverse_user(radiusserver_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + pprint(api_response) +except ApiException as e: + print("Exception when calling GraphApi->graph_radius_server_traverse_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **radiusserver_id** | **str**| ObjectID of the Radius Server. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_radius_server_traverse_user_group** +> list[GraphObjectWithPaths] graph_radius_server_traverse_user_group(radiusserver_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + +List the User Groups bound to a RADIUS Server + +This endpoint will return all Users Groups bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -1849,33 +2491,29 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) -policy_id = 'policy_id_example' # str | ObjectID of the Command. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +radiusserver_id = 'radiusserver_id_example' # str | ObjectID of the Radius Server. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: - # List the System Groups bound to a Policy - api_response = api_instance.graph_policy_traverse_system_group(policy_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + # List the User Groups bound to a RADIUS Server + api_response = api_instance.graph_radius_server_traverse_user_group(radiusserver_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: - print("Exception when calling GraphApi->graph_policy_traverse_system_group: %s\n" % e) + print("Exception when calling GraphApi->graph_radius_server_traverse_user_group: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **policy_id** | **str**| ObjectID of the Command. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **radiusserver_id** | **str**| ObjectID of the Radius Server. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -1887,17 +2525,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_radius_server_associations_list** -> list[GraphConnection] graph_radius_server_associations_list(radiusserver_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +# **graph_softwareapps_associations_list** +> list[GraphConnection] graph_softwareapps_associations_list(software_app_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) -List the associations of a RADIUS Server +List the associations of a Software Application -This endpoint returns the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint will return the _direct_ associations of a Software Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Software Application and System Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -1915,33 +2553,29 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) -radiusserver_id = 'radiusserver_id_example' # str | ObjectID of the Radius Server. -targets = ['targets_example'] # list[str] | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +software_app_id = 'software_app_id_example' # str | ObjectID of the Software App. +targets = ['targets_example'] # list[str] | Targets which a \"software_app\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # List the associations of a RADIUS Server - api_response = api_instance.graph_radius_server_associations_list(radiusserver_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + # List the associations of a Software Application + api_response = api_instance.graph_softwareapps_associations_list(software_app_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: - print("Exception when calling GraphApi->graph_radius_server_associations_list: %s\n" % e) + print("Exception when calling GraphApi->graph_softwareapps_associations_list: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **radiusserver_id** | **str**| ObjectID of the Radius Server. | - **targets** | [**list[str]**](str.md)| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **software_app_id** | **str**| ObjectID of the Software App. | + **targets** | [**list[str]**](str.md)| Targets which a \"software_app\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -1953,17 +2587,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_radius_server_associations_post** -> graph_radius_server_associations_post(radiusserver_id, content_type, accept, body=body, x_org_id=x_org_id) +# **graph_softwareapps_associations_post** +> graph_softwareapps_associations_post(software_app_id, body=body, x_org_id=x_org_id) -Manage the associations of a RADIUS Server +Manage the associations of a software application. -This endpoint allows you to manage the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"type\":\"user\", \"id\":\"{USER_ID}\", \"op\":\"add\" }' ``` +This endpoint allows you to associate or disassociate a software application to a system or system group. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"id\": \"\", \"op\": \"add\", \"type\": \"system\" }' ``` ### Example ```python @@ -1981,28 +2615,24 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) -radiusserver_id = 'radiusserver_id_example' # str | ObjectID of the Radius Server. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.GraphManagementReq() # GraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +software_app_id = 'software_app_id_example' # str | ObjectID of the Software App. +body = jcapiv2.GraphOperationSoftwareApp() # GraphOperationSoftwareApp | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # Manage the associations of a RADIUS Server - api_instance.graph_radius_server_associations_post(radiusserver_id, content_type, accept, body=body, x_org_id=x_org_id) + # Manage the associations of a software application. + api_instance.graph_softwareapps_associations_post(software_app_id, body=body, x_org_id=x_org_id) except ApiException as e: - print("Exception when calling GraphApi->graph_radius_server_associations_post: %s\n" % e) + print("Exception when calling GraphApi->graph_softwareapps_associations_post: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **radiusserver_id** | **str**| ObjectID of the Radius Server. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **software_app_id** | **str**| ObjectID of the Software App. | + **body** | [**GraphOperationSoftwareApp**](GraphOperationSoftwareApp.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -2015,16 +2645,16 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_radius_server_traverse_user** -> list[GraphObjectWithPaths] graph_radius_server_traverse_user(radiusserver_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +# **graph_softwareapps_traverse_system** +> list[GraphObjectWithPaths] graph_softwareapps_traverse_system(software_app_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) -List the Users bound to a RADIUS Server +List the Systems bound to a Software App. -This endpoint will return all Users bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint will return all Systems bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -2042,33 +2672,29 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) -radiusserver_id = 'radiusserver_id_example' # str | ObjectID of the Radius Server. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +software_app_id = 'software_app_id_example' # str | ObjectID of the Software App. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: - # List the Users bound to a RADIUS Server - api_response = api_instance.graph_radius_server_traverse_user(radiusserver_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + # List the Systems bound to a Software App. + api_response = api_instance.graph_softwareapps_traverse_system(software_app_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: - print("Exception when calling GraphApi->graph_radius_server_traverse_user: %s\n" % e) + print("Exception when calling GraphApi->graph_softwareapps_traverse_system: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **radiusserver_id** | **str**| ObjectID of the Radius Server. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **software_app_id** | **str**| ObjectID of the Software App. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -2080,17 +2706,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_radius_server_traverse_user_group** -> list[GraphObjectWithPaths] graph_radius_server_traverse_user_group(radiusserver_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +# **graph_softwareapps_traverse_system_group** +> list[GraphObjectWithPaths] graph_softwareapps_traverse_system_group(software_app_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) -List the User Groups bound to a RADIUS Server +List the System Groups bound to a Software App. -This endpoint will return all Users Groups bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint will return all Systems Groups bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -2108,33 +2734,29 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) -radiusserver_id = 'radiusserver_id_example' # str | ObjectID of the Radius Server. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +software_app_id = 'software_app_id_example' # str | ObjectID of the Software App. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: - # List the User Groups bound to a RADIUS Server - api_response = api_instance.graph_radius_server_traverse_user_group(radiusserver_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + # List the System Groups bound to a Software App. + api_response = api_instance.graph_softwareapps_traverse_system_group(software_app_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: - print("Exception when calling GraphApi->graph_radius_server_traverse_user_group: %s\n" % e) + print("Exception when calling GraphApi->graph_softwareapps_traverse_system_group: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **radiusserver_id** | **str**| ObjectID of the Radius Server. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **software_app_id** | **str**| ObjectID of the Software App. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -2146,13 +2768,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_associations_list** -> list[GraphConnection] graph_system_associations_list(system_id, content_type, accept, targets, limit=limit, skip=skip, _date=_date, authorization=authorization, x_org_id=x_org_id) +> list[GraphConnection] graph_system_associations_list(system_id, targets, limit=limit, skip=skip, _date=_date, authorization=authorization, x_org_id=x_org_id) List the associations of a System @@ -2175,18 +2797,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | ObjectID of the System. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -targets = ['targets_example'] # list[str] | +targets = ['targets_example'] # list[str] | Targets which a \"system\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) _date = '_date_example' # str | Current date header for the System Context API (optional) authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of a System - api_response = api_instance.graph_system_associations_list(system_id, content_type, accept, targets, limit=limit, skip=skip, _date=_date, authorization=authorization, x_org_id=x_org_id) + api_response = api_instance.graph_system_associations_list(system_id, targets, limit=limit, skip=skip, _date=_date, authorization=authorization, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_system_associations_list: %s\n" % e) @@ -2197,14 +2817,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| ObjectID of the System. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **targets** | [**list[str]**](str.md)| | + **targets** | [**list[str]**](str.md)| Targets which a \"system\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] **_date** | **str**| Current date header for the System Context API | [optional] **authorization** | **str**| Authorization header for the System Context API | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -2216,17 +2834,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_associations_post** -> graph_system_associations_post(system_id, content_type, accept, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) +> graph_system_associations_post(system_id, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) Manage associations of a System -This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` +This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` ### Example ```python @@ -2245,16 +2863,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | ObjectID of the System. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.SystemGraphManagementReq() # SystemGraphManagementReq | (optional) +body = jcapiv2.GraphOperationSystem() # GraphOperationSystem | (optional) _date = '_date_example' # str | Current date header for the System Context API (optional) authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage associations of a System - api_instance.graph_system_associations_post(system_id, content_type, accept, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) + api_instance.graph_system_associations_post(system_id, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) except ApiException as e: print("Exception when calling GraphApi->graph_system_associations_post: %s\n" % e) ``` @@ -2264,12 +2880,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| ObjectID of the System. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**SystemGraphManagementReq**](SystemGraphManagementReq.md)| | [optional] + **body** | [**GraphOperationSystem**](GraphOperationSystem.md)| | [optional] **_date** | **str**| Current date header for the System Context API | [optional] **authorization** | **str**| Authorization header for the System Context API | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -2282,12 +2896,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_group_associations_list** -> list[GraphConnection] graph_system_group_associations_list(group_id, content_type, accept, targets, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_system_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of a System Group @@ -2310,16 +2924,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -targets = ['targets_example'] # list[str] | +targets = ['targets_example'] # list[str] | Targets which a \"system_group\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of a System Group - api_response = api_instance.graph_system_group_associations_list(group_id, content_type, accept, targets, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_system_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_system_group_associations_list: %s\n" % e) @@ -2330,12 +2942,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **targets** | [**list[str]**](str.md)| | + **targets** | [**list[str]**](str.md)| Targets which a \"system_group\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -2347,17 +2957,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_group_associations_post** -> graph_system_group_associations_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_system_group_associations_post(group_id, body=body, x_org_id=x_org_id) Manage the associations of a System Group -This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` +This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` ### Example ```python @@ -2376,14 +2986,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.SystemGroupGraphManagementReq() # SystemGroupGraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationSystemGroup() # GraphOperationSystemGroup | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of a System Group - api_instance.graph_system_group_associations_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_system_group_associations_post(group_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling GraphApi->graph_system_group_associations_post: %s\n" % e) ``` @@ -2393,10 +3001,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**SystemGroupGraphManagementReq**](SystemGroupGraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationSystemGroup**](GraphOperationSystemGroup.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -2409,16 +3015,16 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_system_group_member_of** -> list[GraphObjectWithPaths] graph_system_group_member_of(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +# **graph_system_group_members_list** +> list[GraphConnection] graph_system_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) -List the System Group's parents +List the members of a System Group -This endpoint returns all System Groups a System Group is a member of. This endpoint is not yet public as we haven't completed the code yet. +This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -2437,20 +3043,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # List the System Group's parents - api_response = api_instance.graph_system_group_member_of(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + # List the members of a System Group + api_response = api_instance.graph_system_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: - print("Exception when calling GraphApi->graph_system_group_member_of: %s\n" % e) + print("Exception when calling GraphApi->graph_system_group_members_list: %s\n" % e) ``` ### Parameters @@ -2458,17 +3060,13 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) +[**list[GraphConnection]**](GraphConnection.md) ### Authorization @@ -2476,17 +3074,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_system_group_members_list** -> list[GraphConnection] graph_system_group_members_list(group_id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +# **graph_system_group_members_post** +> graph_system_group_members_post(group_id, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) -List the members of a System Group +Manage the members of a System Group -This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` ### Example ```python @@ -2505,18 +3103,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationSystemGroupMember() # GraphOperationSystemGroupMember | (optional) +_date = '_date_example' # str | Current date header for the System Context API (optional) +authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # List the members of a System Group - api_response = api_instance.graph_system_group_members_list(group_id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) - pprint(api_response) + # Manage the members of a System Group + api_instance.graph_system_group_members_post(group_id, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) except ApiException as e: - print("Exception when calling GraphApi->graph_system_group_members_list: %s\n" % e) + print("Exception when calling GraphApi->graph_system_group_members_post: %s\n" % e) ``` ### Parameters @@ -2524,15 +3120,14 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationSystemGroupMember**](GraphOperationSystemGroupMember.md)| | [optional] + **_date** | **str**| Current date header for the System Context API | [optional] + **authorization** | **str**| Authorization header for the System Context API | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -[**list[GraphConnection]**](GraphConnection.md) +void (empty response body) ### Authorization @@ -2541,16 +3136,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_system_group_members_post** -> graph_system_group_members_post(group_id, content_type, accept, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) +# **graph_system_group_membership** +> list[GraphObjectWithPaths] graph_system_group_membership(group_id, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) -Manage the members of a System Group +List the System Group's membership -This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` +This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -2569,18 +3164,18 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.SystemGroupMembersReq() # SystemGroupMembersReq | (optional) -_date = '_date_example' # str | Current date header for the System Context API (optional) -authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) -x_org_id = '' # str | (optional) (default to ) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # Manage the members of a System Group - api_instance.graph_system_group_members_post(group_id, content_type, accept, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) + # List the System Group's membership + api_response = api_instance.graph_system_group_membership(group_id, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) + pprint(api_response) except ApiException as e: - print("Exception when calling GraphApi->graph_system_group_members_post: %s\n" % e) + print("Exception when calling GraphApi->graph_system_group_membership: %s\n" % e) ``` ### Parameters @@ -2588,16 +3183,15 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**SystemGroupMembersReq**](SystemGroupMembersReq.md)| | [optional] - **_date** | **str**| Current date header for the System Context API | [optional] - **authorization** | **str**| Authorization header for the System Context API | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -void (empty response body) +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) ### Authorization @@ -2605,17 +3199,17 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_system_group_membership** -> list[GraphObjectWithPaths] graph_system_group_membership(group_id, content_type, accept, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) +# **graph_system_group_traverse_command** +> list[GraphObjectWithPaths] graph_system_group_traverse_command(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) -List the System Group's membership +List the Commands bound to a System Group -This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint will return all Commands bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -2634,20 +3228,17 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: - # List the System Group's membership - api_response = api_instance.graph_system_group_membership(group_id, content_type, accept, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) + # List the Commands bound to a System Group + api_response = api_instance.graph_system_group_traverse_command(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: - print("Exception when calling GraphApi->graph_system_group_membership: %s\n" % e) + print("Exception when calling GraphApi->graph_system_group_traverse_command: %s\n" % e) ``` ### Parameters @@ -2655,13 +3246,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -2673,17 +3261,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_system_group_traverse_command** -> list[GraphObjectWithPaths] graph_system_group_traverse_command(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +# **graph_system_group_traverse_policy** +> list[GraphObjectWithPaths] graph_system_group_traverse_policy(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) -List the Commands bound to a System Group +List the Policies bound to a System Group -This endpoint will return all Commands bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -2702,19 +3290,17 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: - # List the Commands bound to a System Group - api_response = api_instance.graph_system_group_traverse_command(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + # List the Policies bound to a System Group + api_response = api_instance.graph_system_group_traverse_policy(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: - print("Exception when calling GraphApi->graph_system_group_traverse_command: %s\n" % e) + print("Exception when calling GraphApi->graph_system_group_traverse_policy: %s\n" % e) ``` ### Parameters @@ -2722,12 +3308,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -2739,17 +3323,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_system_group_traverse_policy** -> list[GraphObjectWithPaths] graph_system_group_traverse_policy(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +# **graph_system_group_traverse_policy_group** +> list[GraphObjectWithPaths] graph_system_group_traverse_policy_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) -List the Policies bound to a System Group +List the Policy Groups bound to a System Group -This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint will return all Policy Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -2768,19 +3352,17 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: - # List the Policies bound to a System Group - api_response = api_instance.graph_system_group_traverse_policy(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + # List the Policy Groups bound to a System Group + api_response = api_instance.graph_system_group_traverse_policy_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: - print("Exception when calling GraphApi->graph_system_group_traverse_policy: %s\n" % e) + print("Exception when calling GraphApi->graph_system_group_traverse_policy_group: %s\n" % e) ``` ### Parameters @@ -2788,12 +3370,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -2805,13 +3385,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_group_traverse_user** -> list[GraphObjectWithPaths] graph_system_group_traverse_user(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_system_group_traverse_user(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Users bound to a System Group @@ -2834,16 +3414,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Users bound to a System Group - api_response = api_instance.graph_system_group_traverse_user(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_system_group_traverse_user(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_system_group_traverse_user: %s\n" % e) @@ -2854,12 +3432,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -2871,13 +3447,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_group_traverse_user_group** -> list[GraphObjectWithPaths] graph_system_group_traverse_user_group(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_system_group_traverse_user_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the User Groups bound to a System Group @@ -2900,16 +3476,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the User Groups bound to a System Group - api_response = api_instance.graph_system_group_traverse_user_group(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_system_group_traverse_user_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_system_group_traverse_user_group: %s\n" % e) @@ -2920,12 +3494,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -2937,13 +3509,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_member_of** -> list[GraphObjectWithPaths] graph_system_member_of(system_id, content_type, accept, filter=filter, limit=limit, skip=skip, _date=_date, authorization=authorization, sort=sort, x_org_id=x_org_id) +> list[GraphObjectWithPaths] graph_system_member_of(system_id, filter=filter, limit=limit, skip=skip, _date=_date, authorization=authorization, sort=sort, x_org_id=x_org_id) List the parent Groups of a System @@ -2966,19 +3538,17 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | ObjectID of the System. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) _date = '_date_example' # str | Current date header for the System Context API (optional) authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the parent Groups of a System - api_response = api_instance.graph_system_member_of(system_id, content_type, accept, filter=filter, limit=limit, skip=skip, _date=_date, authorization=authorization, sort=sort, x_org_id=x_org_id) + api_response = api_instance.graph_system_member_of(system_id, filter=filter, limit=limit, skip=skip, _date=_date, authorization=authorization, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_system_member_of: %s\n" % e) @@ -2989,15 +3559,13 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| ObjectID of the System. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] **_date** | **str**| Current date header for the System Context API | [optional] **authorization** | **str**| Authorization header for the System Context API | [optional] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -3009,13 +3577,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_traverse_command** -> list[GraphObjectWithPaths] graph_system_traverse_command(system_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_system_traverse_command(system_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Commands bound to a System @@ -3038,16 +3606,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | ObjectID of the System. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Commands bound to a System - api_response = api_instance.graph_system_traverse_command(system_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_system_traverse_command(system_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_system_traverse_command: %s\n" % e) @@ -3058,12 +3624,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| ObjectID of the System. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -3075,13 +3639,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_traverse_policy** -> list[GraphObjectWithPaths] graph_system_traverse_policy(system_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_system_traverse_policy(system_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Policies bound to a System @@ -3104,16 +3668,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | ObjectID of the System. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Policies bound to a System - api_response = api_instance.graph_system_traverse_policy(system_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_system_traverse_policy(system_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_system_traverse_policy: %s\n" % e) @@ -3124,12 +3686,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| ObjectID of the System. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -3141,17 +3701,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_system_traverse_user** -> list[GraphObjectWithPaths] graph_system_traverse_user(system_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) +# **graph_system_traverse_policy_group** +> list[GraphObjectWithPaths] graph_system_traverse_policy_group(system_id, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) -List the Users bound to a System +List the Policy Groups bound to a System -This endpoint will return all Users bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint will return all Policy Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -3170,21 +3730,19 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | ObjectID of the System. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) _date = '_date_example' # str | Current date header for the System Context API (optional) authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: - # List the Users bound to a System - api_response = api_instance.graph_system_traverse_user(system_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) + # List the Policy Groups bound to a System + api_response = api_instance.graph_system_traverse_policy_group(system_id, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) pprint(api_response) except ApiException as e: - print("Exception when calling GraphApi->graph_system_traverse_user: %s\n" % e) + print("Exception when calling GraphApi->graph_system_traverse_policy_group: %s\n" % e) ``` ### Parameters @@ -3192,14 +3750,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| ObjectID of the System. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] **_date** | **str**| Current date header for the System Context API | [optional] **authorization** | **str**| Authorization header for the System Context API | [optional] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -3211,17 +3767,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_system_traverse_user_group** -> list[GraphObjectWithPaths] graph_system_traverse_user_group(system_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) +# **graph_system_traverse_user** +> list[GraphObjectWithPaths] graph_system_traverse_user(system_id, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) -List the User Groups bound to a System +List the Users bound to a System -This endpoint will return all User Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint will return all Users bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -3240,21 +3796,19 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | ObjectID of the System. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) _date = '_date_example' # str | Current date header for the System Context API (optional) authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: - # List the User Groups bound to a System - api_response = api_instance.graph_system_traverse_user_group(system_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) + # List the Users bound to a System + api_response = api_instance.graph_system_traverse_user(system_id, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) pprint(api_response) except ApiException as e: - print("Exception when calling GraphApi->graph_system_traverse_user_group: %s\n" % e) + print("Exception when calling GraphApi->graph_system_traverse_user: %s\n" % e) ``` ### Parameters @@ -3262,14 +3816,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| ObjectID of the System. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] **_date** | **str**| Current date header for the System Context API | [optional] **authorization** | **str**| Authorization header for the System Context API | [optional] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -3281,17 +3833,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_user_associations_list** -> list[GraphConnection] graph_user_associations_list(user_id, content_type, accept, targets, limit=limit, skip=skip, x_org_id=x_org_id) +# **graph_system_traverse_user_group** +> list[GraphObjectWithPaths] graph_system_traverse_user_group(system_id, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) -List the associations of a User +List the User Groups bound to a System -This endpoint returns the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint will return all User Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -3309,37 +3861,37 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) -user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -targets = ['targets_example'] # list[str] | +system_id = 'system_id_example' # str | ObjectID of the System. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +_date = '_date_example' # str | Current date header for the System Context API (optional) +authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: - # List the associations of a User - api_response = api_instance.graph_user_associations_list(user_id, content_type, accept, targets, limit=limit, skip=skip, x_org_id=x_org_id) + # List the User Groups bound to a System + api_response = api_instance.graph_system_traverse_user_group(system_id, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) pprint(api_response) except ApiException as e: - print("Exception when calling GraphApi->graph_user_associations_list: %s\n" % e) + print("Exception when calling GraphApi->graph_system_traverse_user_group: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **targets** | [**list[str]**](str.md)| | + **system_id** | **str**| ObjectID of the System. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **_date** | **str**| Current date header for the System Context API | [optional] + **authorization** | **str**| Authorization header for the System Context API | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type -[**list[GraphConnection]**](GraphConnection.md) +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) ### Authorization @@ -3347,17 +3899,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_user_associations_post** -> graph_user_associations_post(user_id, content_type, accept, body=body, x_org_id=x_org_id) +# **graph_user_associations_list** +> list[GraphConnection] graph_user_associations_list(user_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) -Manage the associations of a User +List the associations of a User -This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' +This endpoint returns the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -3376,16 +3928,17 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.UserGraphManagementReq() # UserGraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +targets = ['targets_example'] # list[str] | Targets which a \"user\" can be associated to. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # Manage the associations of a User - api_instance.graph_user_associations_post(user_id, content_type, accept, body=body, x_org_id=x_org_id) + # List the associations of a User + api_response = api_instance.graph_user_associations_list(user_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) + pprint(api_response) except ApiException as e: - print("Exception when calling GraphApi->graph_user_associations_post: %s\n" % e) + print("Exception when calling GraphApi->graph_user_associations_list: %s\n" % e) ``` ### Parameters @@ -3393,14 +3946,14 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**UserGraphManagementReq**](UserGraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **targets** | [**list[str]**](str.md)| Targets which a \"user\" can be associated to. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -void (empty response body) +[**list[GraphConnection]**](GraphConnection.md) ### Authorization @@ -3408,17 +3961,17 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_user_group_associations_list** -> list[GraphConnection] graph_user_group_associations_list(group_id, content_type, accept, targets, limit=limit, skip=skip, x_org_id=x_org_id) +# **graph_user_associations_post** +> graph_user_associations_post(user_id, body=body, x_org_id=x_org_id) -List the associations of a User Group. +Manage the associations of a User -This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' ``` ### Example ```python @@ -3436,37 +3989,28 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) -group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -targets = ['targets_example'] # list[str] | -limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +user_id = 'user_id_example' # str | ObjectID of the User. +body = jcapiv2.GraphOperationUser() # GraphOperationUser | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # List the associations of a User Group. - api_response = api_instance.graph_user_group_associations_list(group_id, content_type, accept, targets, limit=limit, skip=skip, x_org_id=x_org_id) - pprint(api_response) + # Manage the associations of a User + api_instance.graph_user_associations_post(user_id, body=body, x_org_id=x_org_id) except ApiException as e: - print("Exception when calling GraphApi->graph_user_group_associations_list: %s\n" % e) + print("Exception when calling GraphApi->graph_user_associations_post: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **targets** | [**list[str]**](str.md)| | - **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **user_id** | **str**| ObjectID of the User. | + **body** | [**GraphOperationUser**](GraphOperationUser.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -[**list[GraphConnection]**](GraphConnection.md) +void (empty response body) ### Authorization @@ -3475,16 +4019,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_user_group_associations_post** -> graph_user_group_associations_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) +# **graph_user_group_associations_list** +> list[GraphConnection] graph_user_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) -Manage the associations of a User Group +List the associations of a User Group. -This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` +This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -3503,16 +4047,17 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.UserGroupGraphManagementReq() # UserGroupGraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +targets = ['targets_example'] # list[str] | Targets which a \"user_group\" can be associated to. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # Manage the associations of a User Group - api_instance.graph_user_group_associations_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) + # List the associations of a User Group. + api_response = api_instance.graph_user_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) + pprint(api_response) except ApiException as e: - print("Exception when calling GraphApi->graph_user_group_associations_post: %s\n" % e) + print("Exception when calling GraphApi->graph_user_group_associations_list: %s\n" % e) ``` ### Parameters @@ -3520,14 +4065,14 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**UserGroupGraphManagementReq**](UserGroupGraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **targets** | [**list[str]**](str.md)| Targets which a \"user_group\" can be associated to. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -void (empty response body) +[**list[GraphConnection]**](GraphConnection.md) ### Authorization @@ -3535,17 +4080,17 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_user_group_member_of** -> list[GraphObjectWithPaths] graph_user_group_member_of(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +# **graph_user_group_associations_post** +> graph_user_group_associations_post(group_id, body=body, x_org_id=x_org_id) -List the User Group's parents +Manage the associations of a User Group -This endpoint returns all User Groups a User Group is a member of. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{group_id}/memberof ``` Not public yet, as the code is not finished, +This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` ### Example ```python @@ -3564,20 +4109,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) -limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationUserGroup() # GraphOperationUserGroup | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # List the User Group's parents - api_response = api_instance.graph_user_group_member_of(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) - pprint(api_response) + # Manage the associations of a User Group + api_instance.graph_user_group_associations_post(group_id, body=body, x_org_id=x_org_id) except ApiException as e: - print("Exception when calling GraphApi->graph_user_group_member_of: %s\n" % e) + print("Exception when calling GraphApi->graph_user_group_associations_post: %s\n" % e) ``` ### Parameters @@ -3585,17 +4124,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] - **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationUserGroup**](GraphOperationUserGroup.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) +void (empty response body) ### Authorization @@ -3604,12 +4138,12 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_members_list** -> list[GraphConnection] graph_user_group_members_list(group_id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_user_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) List the members of a User Group @@ -3632,15 +4166,13 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the members of a User Group - api_response = api_instance.graph_user_group_members_list(group_id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_user_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_group_members_list: %s\n" % e) @@ -3651,11 +4183,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -3667,17 +4197,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_members_post** -> graph_user_group_members_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_user_group_members_post(group_id, body=body, x_org_id=x_org_id) Manage the members of a User Group -This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` +This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` ### Example ```python @@ -3696,14 +4226,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.UserGroupMembersReq() # UserGroupMembersReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationUserGroupMember() # GraphOperationUserGroupMember | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the members of a User Group - api_instance.graph_user_group_members_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_user_group_members_post(group_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling GraphApi->graph_user_group_members_post: %s\n" % e) ``` @@ -3713,10 +4241,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**UserGroupMembersReq**](UserGroupMembersReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationUserGroupMember**](GraphOperationUserGroupMember.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -3729,12 +4255,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_membership** -> list[GraphObjectWithPaths] graph_user_group_membership(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +> list[GraphObjectWithPaths] graph_user_group_membership(group_id, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) List the User Group's membership @@ -3757,17 +4283,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the User Group's membership - api_response = api_instance.graph_user_group_membership(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.graph_user_group_membership(group_id, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_group_membership: %s\n" % e) @@ -3778,13 +4302,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -3796,13 +4318,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_active_directory** -> list[GraphObjectWithPaths] graph_user_group_traverse_active_directory(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_active_directory(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Active Directories bound to a User Group @@ -3825,16 +4347,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Active Directories bound to a User Group - api_response = api_instance.graph_user_group_traverse_active_directory(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_active_directory(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_group_traverse_active_directory: %s\n" % e) @@ -3845,12 +4365,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -3862,13 +4380,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_application** -> list[GraphObjectWithPaths] graph_user_group_traverse_application(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_application(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Applications bound to a User Group @@ -3891,16 +4409,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Applications bound to a User Group - api_response = api_instance.graph_user_group_traverse_application(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_application(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_group_traverse_application: %s\n" % e) @@ -3911,12 +4427,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -3928,13 +4442,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_directory** -> list[GraphObjectWithPaths] graph_user_group_traverse_directory(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_directory(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Directories bound to a User Group @@ -3957,16 +4471,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Directories bound to a User Group - api_response = api_instance.graph_user_group_traverse_directory(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_directory(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_group_traverse_directory: %s\n" % e) @@ -3977,12 +4489,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -3994,13 +4504,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_g_suite** -> list[GraphObjectWithPaths] graph_user_group_traverse_g_suite(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_g_suite(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the G Suite instances bound to a User Group @@ -4023,16 +4533,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the G Suite instances bound to a User Group - api_response = api_instance.graph_user_group_traverse_g_suite(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_g_suite(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_group_traverse_g_suite: %s\n" % e) @@ -4043,12 +4551,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -4060,13 +4566,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_ldap_server** -> list[GraphObjectWithPaths] graph_user_group_traverse_ldap_server(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_ldap_server(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the LDAP Servers bound to a User Group @@ -4089,16 +4595,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the LDAP Servers bound to a User Group - api_response = api_instance.graph_user_group_traverse_ldap_server(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_ldap_server(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_group_traverse_ldap_server: %s\n" % e) @@ -4109,12 +4613,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -4126,13 +4628,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_office365** -> list[GraphObjectWithPaths] graph_user_group_traverse_office365(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_office365(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Office 365 instances bound to a User Group @@ -4155,16 +4657,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Office 365 instances bound to a User Group - api_response = api_instance.graph_user_group_traverse_office365(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_office365(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_group_traverse_office365: %s\n" % e) @@ -4175,12 +4675,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -4192,13 +4690,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_radius_server** -> list[GraphObjectWithPaths] graph_user_group_traverse_radius_server(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_radius_server(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the RADIUS Servers bound to a User Group @@ -4221,16 +4719,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the RADIUS Servers bound to a User Group - api_response = api_instance.graph_user_group_traverse_radius_server(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_radius_server(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_group_traverse_radius_server: %s\n" % e) @@ -4241,12 +4737,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -4258,13 +4752,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_system** -> list[GraphObjectWithPaths] graph_user_group_traverse_system(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_system(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Systems bound to a User Group @@ -4287,16 +4781,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Systems bound to a User Group - api_response = api_instance.graph_user_group_traverse_system(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_system(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_group_traverse_system: %s\n" % e) @@ -4307,12 +4799,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -4324,13 +4814,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_system_group** -> list[GraphObjectWithPaths] graph_user_group_traverse_system_group(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_system_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the System Groups bound to User Groups @@ -4353,16 +4843,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the System Groups bound to User Groups - api_response = api_instance.graph_user_group_traverse_system_group(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_system_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_group_traverse_system_group: %s\n" % e) @@ -4373,12 +4861,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -4390,13 +4876,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_member_of** -> list[GraphObjectWithPaths] graph_user_member_of(user_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +> list[GraphObjectWithPaths] graph_user_member_of(user_id, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) List the parent Groups of a User @@ -4419,17 +4905,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the parent Groups of a User - api_response = api_instance.graph_user_member_of(user_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.graph_user_member_of(user_id, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_member_of: %s\n" % e) @@ -4440,13 +4924,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -4458,13 +4940,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_traverse_active_directory** -> list[GraphObjectWithPaths] graph_user_traverse_active_directory(user_id, content_type, accept, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip) +> list[GraphObjectWithPaths] graph_user_traverse_active_directory(user_id, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip) List the Active Directory instances bound to a User @@ -4487,16 +4969,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) try: # List the Active Directory instances bound to a User - api_response = api_instance.graph_user_traverse_active_directory(user_id, content_type, accept, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip) + api_response = api_instance.graph_user_traverse_active_directory(user_id, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_traverse_active_directory: %s\n" % e) @@ -4507,11 +4987,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] ### Return type @@ -4524,13 +5002,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_traverse_application** -> list[GraphObjectWithPaths] graph_user_traverse_application(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_traverse_application(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Applications bound to a User @@ -4553,16 +5031,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Applications bound to a User - api_response = api_instance.graph_user_traverse_application(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_traverse_application(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_traverse_application: %s\n" % e) @@ -4573,12 +5049,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -4590,13 +5064,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_traverse_directory** -> list[GraphObjectWithPaths] graph_user_traverse_directory(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_traverse_directory(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Directories bound to a User @@ -4619,16 +5093,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Directories bound to a User - api_response = api_instance.graph_user_traverse_directory(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_traverse_directory(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_traverse_directory: %s\n" % e) @@ -4639,12 +5111,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -4656,13 +5126,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_traverse_g_suite** -> list[GraphObjectWithPaths] graph_user_traverse_g_suite(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_traverse_g_suite(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the G Suite instances bound to a User @@ -4685,16 +5155,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the G Suite instances bound to a User - api_response = api_instance.graph_user_traverse_g_suite(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_traverse_g_suite(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_traverse_g_suite: %s\n" % e) @@ -4705,12 +5173,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -4722,13 +5188,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_traverse_ldap_server** -> list[GraphObjectWithPaths] graph_user_traverse_ldap_server(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_traverse_ldap_server(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the LDAP servers bound to a User @@ -4751,16 +5217,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the LDAP servers bound to a User - api_response = api_instance.graph_user_traverse_ldap_server(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_traverse_ldap_server(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_traverse_ldap_server: %s\n" % e) @@ -4771,12 +5235,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -4788,13 +5250,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_traverse_office365** -> list[GraphObjectWithPaths] graph_user_traverse_office365(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_traverse_office365(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Office 365 instances bound to a User @@ -4817,16 +5279,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Office 365 instances bound to a User - api_response = api_instance.graph_user_traverse_office365(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_traverse_office365(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_traverse_office365: %s\n" % e) @@ -4837,12 +5297,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -4854,13 +5312,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_traverse_radius_server** -> list[GraphObjectWithPaths] graph_user_traverse_radius_server(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_traverse_radius_server(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the RADIUS Servers bound to a User @@ -4883,16 +5341,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the RADIUS Servers bound to a User - api_response = api_instance.graph_user_traverse_radius_server(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_traverse_radius_server(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_traverse_radius_server: %s\n" % e) @@ -4903,12 +5359,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -4920,13 +5374,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_traverse_system** -> list[GraphObjectWithPaths] graph_user_traverse_system(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_traverse_system(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Systems bound to a User @@ -4949,16 +5403,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Systems bound to a User - api_response = api_instance.graph_user_traverse_system(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_traverse_system(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_traverse_system: %s\n" % e) @@ -4969,12 +5421,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -4986,13 +5436,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_traverse_system_group** -> list[GraphObjectWithPaths] graph_user_traverse_system_group(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_traverse_system_group(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the System Groups bound to a User @@ -5015,16 +5465,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the System Groups bound to a User - api_response = api_instance.graph_user_traverse_system_group(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_traverse_system_group(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling GraphApi->graph_user_traverse_system_group: %s\n" % e) @@ -5035,12 +5483,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -5052,13 +5498,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **policystatuses_list** -> list[PolicyResult] policystatuses_list(system_id, content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +# **policystatuses_systems_list** +> list[PolicyResult] policystatuses_systems_list(system_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) List the policy statuses for a system @@ -5081,21 +5527,19 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GraphApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | ObjectID of the System. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the policy statuses for a system - api_response = api_instance.policystatuses_list(system_id, content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.policystatuses_systems_list(system_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: - print("Exception when calling GraphApi->policystatuses_list: %s\n" % e) + print("Exception when calling GraphApi->policystatuses_systems_list: %s\n" % e) ``` ### Parameters @@ -5103,14 +5547,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| ObjectID of the System. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -5122,7 +5564,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/GraphAttributeLdapGroups.md b/jcapiv2/docs/GraphAttributeLdapGroups.md new file mode 100644 index 0000000..51df658 --- /dev/null +++ b/jcapiv2/docs/GraphAttributeLdapGroups.md @@ -0,0 +1,9 @@ +# GraphAttributeLdapGroups + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ldap_groups** | [**list[LdapGroup]**](LdapGroup.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributePosixGroups.md b/jcapiv2/docs/GraphAttributePosixGroups.md new file mode 100644 index 0000000..bf48225 --- /dev/null +++ b/jcapiv2/docs/GraphAttributePosixGroups.md @@ -0,0 +1,9 @@ +# GraphAttributePosixGroups + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**posix_groups** | [**list[GraphAttributePosixGroupsPosixGroups]**](GraphAttributePosixGroupsPosixGroups.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributePosixGroupsPosixGroups.md b/jcapiv2/docs/GraphAttributePosixGroupsPosixGroups.md new file mode 100644 index 0000000..af42b90 --- /dev/null +++ b/jcapiv2/docs/GraphAttributePosixGroupsPosixGroups.md @@ -0,0 +1,10 @@ +# GraphAttributePosixGroupsPosixGroups + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | +**name** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributeRadius.md b/jcapiv2/docs/GraphAttributeRadius.md new file mode 100644 index 0000000..5d73d8e --- /dev/null +++ b/jcapiv2/docs/GraphAttributeRadius.md @@ -0,0 +1,9 @@ +# GraphAttributeRadius + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**radius** | [**GraphAttributeRadiusRadius**](GraphAttributeRadiusRadius.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributeRadiusRadius.md b/jcapiv2/docs/GraphAttributeRadiusRadius.md new file mode 100644 index 0000000..1b6a312 --- /dev/null +++ b/jcapiv2/docs/GraphAttributeRadiusRadius.md @@ -0,0 +1,9 @@ +# GraphAttributeRadiusRadius + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reply** | [**list[GraphAttributeRadiusRadiusReply]**](GraphAttributeRadiusRadiusReply.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributeRadiusRadiusReply.md b/jcapiv2/docs/GraphAttributeRadiusRadiusReply.md new file mode 100644 index 0000000..47170bb --- /dev/null +++ b/jcapiv2/docs/GraphAttributeRadiusRadiusReply.md @@ -0,0 +1,10 @@ +# GraphAttributeRadiusRadiusReply + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**value** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributeSambaEnabled.md b/jcapiv2/docs/GraphAttributeSambaEnabled.md new file mode 100644 index 0000000..ecc31f0 --- /dev/null +++ b/jcapiv2/docs/GraphAttributeSambaEnabled.md @@ -0,0 +1,9 @@ +# GraphAttributeSambaEnabled + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**samba_enabled** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributeSudo.md b/jcapiv2/docs/GraphAttributeSudo.md new file mode 100644 index 0000000..bf829f4 --- /dev/null +++ b/jcapiv2/docs/GraphAttributeSudo.md @@ -0,0 +1,9 @@ +# GraphAttributeSudo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sudo** | [**GraphAttributeSudoSudo**](GraphAttributeSudoSudo.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributeSudoSudo.md b/jcapiv2/docs/GraphAttributeSudoSudo.md new file mode 100644 index 0000000..faed9a9 --- /dev/null +++ b/jcapiv2/docs/GraphAttributeSudoSudo.md @@ -0,0 +1,10 @@ +# GraphAttributeSudoSudo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **bool** | Enables sudo | +**without_password** | **bool** | Enable sudo without password (requires 'enabled' to be true) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributes.md b/jcapiv2/docs/GraphAttributes.md new file mode 100644 index 0000000..f3b28e6 --- /dev/null +++ b/jcapiv2/docs/GraphAttributes.md @@ -0,0 +1,8 @@ +# GraphAttributes + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphConnection.md b/jcapiv2/docs/GraphConnection.md index 126c703..7252ab2 100644 --- a/jcapiv2/docs/GraphConnection.md +++ b/jcapiv2/docs/GraphConnection.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] **_from** | [**GraphObject**](GraphObject.md) | | [optional] **to** | [**GraphObject**](GraphObject.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/GraphManagementReq.md b/jcapiv2/docs/GraphManagementReq.md deleted file mode 100644 index cb0ad93..0000000 --- a/jcapiv2/docs/GraphManagementReq.md +++ /dev/null @@ -1,12 +0,0 @@ -# GraphManagementReq - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | The ObjectID of graph object being added or removed as an association. | -**op** | **str** | How to modify the graph connection. | -**type** | [**GraphType**](GraphType.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv2/docs/GraphObject.md b/jcapiv2/docs/GraphObject.md index c8102a2..10cd228 100644 --- a/jcapiv2/docs/GraphObject.md +++ b/jcapiv2/docs/GraphObject.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] **id** | **str** | The ObjectID of the graph object. | **type** | **str** | The type of graph object. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/GraphObjectWithPaths.md b/jcapiv2/docs/GraphObjectWithPaths.md index 5f63ba8..fcc933c 100644 --- a/jcapiv2/docs/GraphObjectWithPaths.md +++ b/jcapiv2/docs/GraphObjectWithPaths.md @@ -3,10 +3,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**compiled_attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] **id** | **str** | Object ID of this graph object. | **paths** | **list[list[GraphConnection]]** | A path through the graph between two graph objects. | **type** | [**GraphType**](GraphType.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemGroupGraphManagementReq.md b/jcapiv2/docs/GraphOperation.md similarity index 87% rename from jcapiv2/docs/SystemGroupGraphManagementReq.md rename to jcapiv2/docs/GraphOperation.md index 8319fd1..eda87f5 100644 --- a/jcapiv2/docs/SystemGroupGraphManagementReq.md +++ b/jcapiv2/docs/GraphOperation.md @@ -1,12 +1,10 @@ -# SystemGroupGraphManagementReq +# GraphOperation ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | The ObjectID of graph object being added or removed as an association. | **op** | **str** | How to modify the graph connection. | -**type** | **str** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/GraphOperationActiveDirectory.md b/jcapiv2/docs/GraphOperationActiveDirectory.md new file mode 100644 index 0000000..295b159 --- /dev/null +++ b/jcapiv2/docs/GraphOperationActiveDirectory.md @@ -0,0 +1,10 @@ +# GraphOperationActiveDirectory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] +**type** | **str** | Targets which a \"active_directory\" can be associated to. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationApplication.md b/jcapiv2/docs/GraphOperationApplication.md new file mode 100644 index 0000000..ea9fa27 --- /dev/null +++ b/jcapiv2/docs/GraphOperationApplication.md @@ -0,0 +1,10 @@ +# GraphOperationApplication + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] +**type** | **str** | Targets which a \"application\" can be associated to. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationCommand.md b/jcapiv2/docs/GraphOperationCommand.md new file mode 100644 index 0000000..f14ceba --- /dev/null +++ b/jcapiv2/docs/GraphOperationCommand.md @@ -0,0 +1,10 @@ +# GraphOperationCommand + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] +**type** | **str** | Targets which a \"command\" can be associated to. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationGSuite.md b/jcapiv2/docs/GraphOperationGSuite.md new file mode 100644 index 0000000..96d97f0 --- /dev/null +++ b/jcapiv2/docs/GraphOperationGSuite.md @@ -0,0 +1,10 @@ +# GraphOperationGSuite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] +**type** | **str** | Targets which a \"g_suite\" can be associated to. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationLdapServer.md b/jcapiv2/docs/GraphOperationLdapServer.md new file mode 100644 index 0000000..cc7cf6b --- /dev/null +++ b/jcapiv2/docs/GraphOperationLdapServer.md @@ -0,0 +1,10 @@ +# GraphOperationLdapServer + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] +**type** | **str** | Targets which a \"ldap_server\" can be associated to. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationOffice365.md b/jcapiv2/docs/GraphOperationOffice365.md new file mode 100644 index 0000000..e86439a --- /dev/null +++ b/jcapiv2/docs/GraphOperationOffice365.md @@ -0,0 +1,10 @@ +# GraphOperationOffice365 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] +**type** | **str** | Targets which a \"office_365\" can be associated to. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationPolicy.md b/jcapiv2/docs/GraphOperationPolicy.md new file mode 100644 index 0000000..4c18034 --- /dev/null +++ b/jcapiv2/docs/GraphOperationPolicy.md @@ -0,0 +1,10 @@ +# GraphOperationPolicy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] +**type** | **str** | Targets which a \"policy\" can be associated to. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationPolicyGroup.md b/jcapiv2/docs/GraphOperationPolicyGroup.md new file mode 100644 index 0000000..738911e --- /dev/null +++ b/jcapiv2/docs/GraphOperationPolicyGroup.md @@ -0,0 +1,10 @@ +# GraphOperationPolicyGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] +**type** | **str** | Targets which a \"policy_group\" can be associated to. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/UserGroupMembersReq.md b/jcapiv2/docs/GraphOperationPolicyGroupMember.md similarity index 67% rename from jcapiv2/docs/UserGroupMembersReq.md rename to jcapiv2/docs/GraphOperationPolicyGroupMember.md index d5aaafd..2ec0691 100644 --- a/jcapiv2/docs/UserGroupMembersReq.md +++ b/jcapiv2/docs/GraphOperationPolicyGroupMember.md @@ -1,12 +1,10 @@ -# UserGroupMembersReq +# GraphOperationPolicyGroupMember ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | The ObjectID of member being added or removed. | -**op** | **str** | How to modify the membership connection. | +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] **type** | **str** | The member type. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/GraphOperationRadiusServer.md b/jcapiv2/docs/GraphOperationRadiusServer.md new file mode 100644 index 0000000..fa5a230 --- /dev/null +++ b/jcapiv2/docs/GraphOperationRadiusServer.md @@ -0,0 +1,10 @@ +# GraphOperationRadiusServer + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] +**type** | **str** | Targets which a \"radius_server\" can be associated to. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationSoftwareApp.md b/jcapiv2/docs/GraphOperationSoftwareApp.md new file mode 100644 index 0000000..9113281 --- /dev/null +++ b/jcapiv2/docs/GraphOperationSoftwareApp.md @@ -0,0 +1,10 @@ +# GraphOperationSoftwareApp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] +**type** | **str** | Targets which a \"software_app\" can be associated to. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationSystem.md b/jcapiv2/docs/GraphOperationSystem.md new file mode 100644 index 0000000..948770a --- /dev/null +++ b/jcapiv2/docs/GraphOperationSystem.md @@ -0,0 +1,10 @@ +# GraphOperationSystem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | **object** | | [optional] +**type** | **str** | Targets which a \"system\" can be associated to. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationSystemGroup.md b/jcapiv2/docs/GraphOperationSystemGroup.md new file mode 100644 index 0000000..9258e02 --- /dev/null +++ b/jcapiv2/docs/GraphOperationSystemGroup.md @@ -0,0 +1,10 @@ +# GraphOperationSystemGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] +**type** | **str** | Targets which a \"system_group\" can be associated to. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemGroupMembersReq.md b/jcapiv2/docs/GraphOperationSystemGroupMember.md similarity index 66% rename from jcapiv2/docs/SystemGroupMembersReq.md rename to jcapiv2/docs/GraphOperationSystemGroupMember.md index cf327c0..d1a383e 100644 --- a/jcapiv2/docs/SystemGroupMembersReq.md +++ b/jcapiv2/docs/GraphOperationSystemGroupMember.md @@ -1,12 +1,10 @@ -# SystemGroupMembersReq +# GraphOperationSystemGroupMember ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | The ObjectID of member being added or removed. | -**op** | **str** | How to modify the membership connection. | +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] **type** | **str** | The member type. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/GraphOperationUser.md b/jcapiv2/docs/GraphOperationUser.md new file mode 100644 index 0000000..fda3136 --- /dev/null +++ b/jcapiv2/docs/GraphOperationUser.md @@ -0,0 +1,10 @@ +# GraphOperationUser + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | **object** | | [optional] +**type** | **str** | Targets which a \"user\" can be associated to. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationUserGroup.md b/jcapiv2/docs/GraphOperationUserGroup.md new file mode 100644 index 0000000..eef759f --- /dev/null +++ b/jcapiv2/docs/GraphOperationUserGroup.md @@ -0,0 +1,10 @@ +# GraphOperationUserGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] +**type** | **str** | Targets which a \"user_group\" can be associated to. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationUserGroupMember.md b/jcapiv2/docs/GraphOperationUserGroupMember.md new file mode 100644 index 0000000..1a29bf7 --- /dev/null +++ b/jcapiv2/docs/GraphOperationUserGroupMember.md @@ -0,0 +1,10 @@ +# GraphOperationUserGroupMember + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] +**type** | **str** | The member type. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphType.md b/jcapiv2/docs/GraphType.md index e505470..bc471ff 100644 --- a/jcapiv2/docs/GraphType.md +++ b/jcapiv2/docs/GraphType.md @@ -6,4 +6,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/Group.md b/jcapiv2/docs/Group.md index 6594546..8cd99cf 100644 --- a/jcapiv2/docs/Group.md +++ b/jcapiv2/docs/Group.md @@ -3,10 +3,12 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] +**description** | **str** | Description of a Group | [optional] +**email** | **str** | E-mail address associated with a Group | [optional] **id** | **str** | ObjectId uniquely identifying a Group. | [optional] **name** | **str** | Display name of a Group. | [optional] **type** | [**GroupType**](GroupType.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/GroupAttributesUserGroup.md b/jcapiv2/docs/GroupAttributesUserGroup.md new file mode 100644 index 0000000..fbd1fbe --- /dev/null +++ b/jcapiv2/docs/GroupAttributesUserGroup.md @@ -0,0 +1,13 @@ +# GroupAttributesUserGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sudo** | [**GraphAttributeSudoSudo**](GraphAttributeSudoSudo.md) | | [optional] +**ldap_groups** | [**list[LdapGroup]**](LdapGroup.md) | | [optional] +**posix_groups** | [**list[GraphAttributePosixGroupsPosixGroups]**](GraphAttributePosixGroupsPosixGroups.md) | | [optional] +**radius** | [**GraphAttributeRadiusRadius**](GraphAttributeRadiusRadius.md) | | [optional] +**samba_enabled** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GroupIdSuggestionsBody.md b/jcapiv2/docs/GroupIdSuggestionsBody.md new file mode 100644 index 0000000..1f84d7c --- /dev/null +++ b/jcapiv2/docs/GroupIdSuggestionsBody.md @@ -0,0 +1,9 @@ +# GroupIdSuggestionsBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_ids** | **list[str]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GroupType.md b/jcapiv2/docs/GroupType.md index 02d2c1c..303c2b0 100644 --- a/jcapiv2/docs/GroupType.md +++ b/jcapiv2/docs/GroupType.md @@ -6,4 +6,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/GroupsApi.md b/jcapiv2/docs/GroupsApi.md index fc2acee..78c210a 100644 --- a/jcapiv2/docs/GroupsApi.md +++ b/jcapiv2/docs/GroupsApi.md @@ -6,9 +6,8 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**groups_list**](GroupsApi.md#groups_list) | **GET** /groups | List All Groups - # **groups_list** -> list[Group] groups_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +> list[Group] groups_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id, x_unfiltered_total_count=x_unfiltered_total_count) List All Groups @@ -30,18 +29,17 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.GroupsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +x_unfiltered_total_count = 56 # int | If provided in the request with any non-empty value, this header will be returned on the response populated with the total count of objects without filters taken into account (optional) try: # List All Groups - api_response = api_instance.groups_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.groups_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id, x_unfiltered_total_count=x_unfiltered_total_count) pprint(api_response) except ApiException as e: print("Exception when calling GroupsApi->groups_list: %s\n" % e) @@ -51,14 +49,13 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **x_unfiltered_total_count** | **int**| If provided in the request with any non-empty value, this header will be returned on the response populated with the total count of objects without filters taken into account | [optional] ### Return type @@ -70,7 +67,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/GsuiteOutput.md b/jcapiv2/docs/GsuiteOutput.md index 2c46479..eda16a0 100644 --- a/jcapiv2/docs/GsuiteOutput.md +++ b/jcapiv2/docs/GsuiteOutput.md @@ -3,10 +3,11 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**groups_enabled** | **bool** | | [optional] **id** | **str** | | [optional] +**name** | **str** | | [optional] **user_lockout_action** | **str** | | [optional] **user_password_expiration_action** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/GsuitePatchInput.md b/jcapiv2/docs/GsuitePatchInput.md index cde09c9..5866116 100644 --- a/jcapiv2/docs/GsuitePatchInput.md +++ b/jcapiv2/docs/GsuitePatchInput.md @@ -3,9 +3,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**groups_enabled** | **bool** | | [optional] +**name** | **str** | | [optional] **user_lockout_action** | **str** | | [optional] **user_password_expiration_action** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/IPList.md b/jcapiv2/docs/IPList.md new file mode 100644 index 0000000..df15e6d --- /dev/null +++ b/jcapiv2/docs/IPList.md @@ -0,0 +1,12 @@ +# IPList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**id** | **str** | | [optional] +**ips** | **list[str]** | | [optional] +**name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/IPListRequest.md b/jcapiv2/docs/IPListRequest.md new file mode 100644 index 0000000..fb40c82 --- /dev/null +++ b/jcapiv2/docs/IPListRequest.md @@ -0,0 +1,11 @@ +# IPListRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**ips** | **list[str]** | | [optional] +**name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/IPListsApi.md b/jcapiv2/docs/IPListsApi.md new file mode 100644 index 0000000..32394c6 --- /dev/null +++ b/jcapiv2/docs/IPListsApi.md @@ -0,0 +1,361 @@ +# jcapiv2.IPListsApi + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**iplists_delete**](IPListsApi.md#iplists_delete) | **DELETE** /iplists/{id} | Delete an IP list +[**iplists_get**](IPListsApi.md#iplists_get) | **GET** /iplists/{id} | Get an IP list +[**iplists_list**](IPListsApi.md#iplists_list) | **GET** /iplists | List IP Lists +[**iplists_patch**](IPListsApi.md#iplists_patch) | **PATCH** /iplists/{id} | Update an IP list +[**iplists_post**](IPListsApi.md#iplists_post) | **POST** /iplists | Create IP List +[**iplists_put**](IPListsApi.md#iplists_put) | **PUT** /iplists/{id} | Replace an IP list + +# **iplists_delete** +> IPList iplists_delete(id, x_org_id=x_org_id) + +Delete an IP list + +Delete a specific IP list. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.IPListsApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Delete an IP list + api_response = api_instance.iplists_delete(id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling IPListsApi->iplists_delete: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**IPList**](IPList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **iplists_get** +> IPList iplists_get(id, x_org_id=x_org_id) + +Get an IP list + +Return a specific IP list. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.IPListsApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Get an IP list + api_response = api_instance.iplists_get(id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling IPListsApi->iplists_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**IPList**](IPList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **iplists_list** +> list[IPList] iplists_list(x_org_id=x_org_id, x_total_count=x_total_count, limit=limit, skip=skip, filter=filter, sort=sort) + +List IP Lists + +Retrieve all IP lists. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/iplists \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.IPListsApi(jcapiv2.ApiClient(configuration)) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +x_total_count = 56 # int | (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) + +try: + # List IP Lists + api_response = api_instance.iplists_list(x_org_id=x_org_id, x_total_count=x_total_count, limit=limit, skip=skip, filter=filter, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling IPListsApi->iplists_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **x_total_count** | **int**| | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + +### Return type + +[**list[IPList]**](IPList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **iplists_patch** +> IPList iplists_patch(id, body=body, x_org_id=x_org_id) + +Update an IP list + +Update a specific IP list. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"name\": \"New IP List Name\"}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.IPListsApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | +body = jcapiv2.IPListRequest() # IPListRequest | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Update an IP list + api_response = api_instance.iplists_patch(id, body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling IPListsApi->iplists_patch: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **body** | [**IPListRequest**](IPListRequest.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**IPList**](IPList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **iplists_post** +> IPList iplists_post(body=body, x_org_id=x_org_id) + +Create IP List + +Create an IP list. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/iplists \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Sample IP List\", \"ips\": [ \"192.168.10.12\", \"192.168.10.20 - 192.168.10.30\", \"123.225.10.0/32\" ] }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.IPListsApi(jcapiv2.ApiClient(configuration)) +body = jcapiv2.IPListRequest() # IPListRequest | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Create IP List + api_response = api_instance.iplists_post(body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling IPListsApi->iplists_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**IPListRequest**](IPListRequest.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**IPList**](IPList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **iplists_put** +> IPList iplists_put(id, body=body, x_org_id=x_org_id) + +Replace an IP list + +Replace a specific IP list. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Sample IP List\", \"ips\": [ \"192.168.10.10\" ] }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.IPListsApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | +body = jcapiv2.IPListRequest() # IPListRequest | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Replace an IP list + api_response = api_instance.iplists_put(id, body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling IPListsApi->iplists_put: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **body** | [**IPListRequest**](IPListRequest.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**IPList**](IPList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ImageApi.md b/jcapiv2/docs/ImageApi.md new file mode 100644 index 0000000..0d8ad93 --- /dev/null +++ b/jcapiv2/docs/ImageApi.md @@ -0,0 +1,63 @@ +# jcapiv2.ImageApi + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**applications_delete_logo**](ImageApi.md#applications_delete_logo) | **DELETE** /applications/{application_id}/logo | Delete application image + +# **applications_delete_logo** +> applications_delete_logo(application_id, x_org_id=x_org_id) + +Delete application image + +Deletes the specified image from an application + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ImageApi(jcapiv2.ApiClient(configuration)) +application_id = 'application_id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Delete application image + api_instance.applications_delete_logo(application_id, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling ImageApi->applications_delete_logo: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **application_id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ImportUser.md b/jcapiv2/docs/ImportUser.md new file mode 100644 index 0000000..3b416da --- /dev/null +++ b/jcapiv2/docs/ImportUser.md @@ -0,0 +1,25 @@ +# ImportUser + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**addresses** | [**list[ImportUserAddress]**](ImportUserAddress.md) | | [optional] +**company** | **str** | | [optional] +**cost_center** | **str** | | [optional] +**department** | **str** | | [optional] +**displayname** | **str** | | [optional] +**email** | **str** | | [optional] +**employee_identifier** | **str** | | [optional] +**employee_type** | **str** | | [optional] +**firstname** | **str** | | [optional] +**id** | **str** | | [optional] +**job_title** | **str** | | [optional] +**lastname** | **str** | | [optional] +**location** | **str** | | [optional] +**manager** | **str** | | [optional] +**middlename** | **str** | | [optional] +**phone_numbers** | [**list[ImportUserPhoneNumber]**](ImportUserPhoneNumber.md) | | [optional] +**username** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ImportUserAddress.md b/jcapiv2/docs/ImportUserAddress.md new file mode 100644 index 0000000..b5de454 --- /dev/null +++ b/jcapiv2/docs/ImportUserAddress.md @@ -0,0 +1,14 @@ +# ImportUserAddress + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country** | **str** | | [optional] +**locality** | **str** | | [optional] +**postal_code** | **str** | | [optional] +**region** | **str** | | [optional] +**street_address** | **str** | | [optional] +**type** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ImportUserPhoneNumber.md b/jcapiv2/docs/ImportUserPhoneNumber.md new file mode 100644 index 0000000..a130daa --- /dev/null +++ b/jcapiv2/docs/ImportUserPhoneNumber.md @@ -0,0 +1,10 @@ +# ImportUserPhoneNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [optional] +**value** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ImportUsersResponse.md b/jcapiv2/docs/ImportUsersResponse.md new file mode 100644 index 0000000..de917b5 --- /dev/null +++ b/jcapiv2/docs/ImportUsersResponse.md @@ -0,0 +1,10 @@ +# ImportUsersResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total_count** | **float** | | [optional] +**users** | [**list[ImportUser]**](ImportUser.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse200.md b/jcapiv2/docs/InlineResponse200.md index 590630e..fe801a0 100644 --- a/jcapiv2/docs/InlineResponse200.md +++ b/jcapiv2/docs/InlineResponse200.md @@ -3,11 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | [optional] -**name** | **str** | | [optional] -**user_lockout_action** | [**LdapServerAction**](LdapServerAction.md) | | [optional] -**user_password_expiration_action** | [**LdapServerAction**](LdapServerAction.md) | | [optional] +**events_count** | **int** | | [optional] +**results** | [**list[ScheduledUserstateResult]**](ScheduledUserstateResult.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/InlineResponse2001.md b/jcapiv2/docs/InlineResponse2001.md index f84da03..e2f4110 100644 --- a/jcapiv2/docs/InlineResponse2001.md +++ b/jcapiv2/docs/InlineResponse2001.md @@ -3,9 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**results** | [**list[Administrator]**](Administrator.md) | | [optional] -**total_count** | **int** | | [optional] +**next_page_token** | **str** | | [optional] +**users** | [**list[User]**](User.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/InlineResponse20010.md b/jcapiv2/docs/InlineResponse20010.md new file mode 100644 index 0000000..0cf948c --- /dev/null +++ b/jcapiv2/docs/InlineResponse20010.md @@ -0,0 +1,12 @@ +# InlineResponse20010 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**name** | **str** | | [optional] +**user_lockout_action** | [**LdapServerAction**](LdapServerAction.md) | | [optional] +**user_password_expiration_action** | [**LdapServerAction**](LdapServerAction.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse20011.md b/jcapiv2/docs/InlineResponse20011.md new file mode 100644 index 0000000..c68de13 --- /dev/null +++ b/jcapiv2/docs/InlineResponse20011.md @@ -0,0 +1,11 @@ +# InlineResponse20011 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**skip_token** | **str** | | [optional] +**top** | **int** | | [optional] +**users** | [**list[InlineResponse20011Users]**](InlineResponse20011Users.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse20011Users.md b/jcapiv2/docs/InlineResponse20011Users.md new file mode 100644 index 0000000..75cbde7 --- /dev/null +++ b/jcapiv2/docs/InlineResponse20011Users.md @@ -0,0 +1,12 @@ +# InlineResponse20011Users + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**given_name** | **str** | | [optional] +**id** | **str** | | [optional] +**surname** | **str** | | [optional] +**user_principal_name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse20012.md b/jcapiv2/docs/InlineResponse20012.md new file mode 100644 index 0000000..3796cf8 --- /dev/null +++ b/jcapiv2/docs/InlineResponse20012.md @@ -0,0 +1,10 @@ +# InlineResponse20012 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**list[Administrator]**](Administrator.md) | | [optional] +**total_count** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse20013.md b/jcapiv2/docs/InlineResponse20013.md new file mode 100644 index 0000000..aac42c6 --- /dev/null +++ b/jcapiv2/docs/InlineResponse20013.md @@ -0,0 +1,10 @@ +# InlineResponse20013 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**list[Organization]**](Organization.md) | | [optional] +**total_count** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2002.md b/jcapiv2/docs/InlineResponse2002.md new file mode 100644 index 0000000..cababec --- /dev/null +++ b/jcapiv2/docs/InlineResponse2002.md @@ -0,0 +1,10 @@ +# InlineResponse2002 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_page_token** | **str** | | [optional] +**users** | [**list[InlineResponse2002Users]**](InlineResponse2002Users.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2002Users.md b/jcapiv2/docs/InlineResponse2002Users.md new file mode 100644 index 0000000..64b0d21 --- /dev/null +++ b/jcapiv2/docs/InlineResponse2002Users.md @@ -0,0 +1,13 @@ +# InlineResponse2002Users + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**family_name** | **str** | | [optional] +**given_name** | **str** | | [optional] +**id** | **str** | | [optional] +**primary_email** | **str** | | [optional] +**thumbnail_photo_url** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2003.md b/jcapiv2/docs/InlineResponse2003.md new file mode 100644 index 0000000..2b878ce --- /dev/null +++ b/jcapiv2/docs/InlineResponse2003.md @@ -0,0 +1,10 @@ +# InlineResponse2003 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**list[AutotaskContract]**](AutotaskContract.md) | | [optional] +**total_count** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2004.md b/jcapiv2/docs/InlineResponse2004.md new file mode 100644 index 0000000..68d9a86 --- /dev/null +++ b/jcapiv2/docs/InlineResponse2004.md @@ -0,0 +1,10 @@ +# InlineResponse2004 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**list[AutotaskContractField]**](AutotaskContractField.md) | | [optional] +**total_count** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2005.md b/jcapiv2/docs/InlineResponse2005.md new file mode 100644 index 0000000..a14d421 --- /dev/null +++ b/jcapiv2/docs/InlineResponse2005.md @@ -0,0 +1,10 @@ +# InlineResponse2005 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**list[AutotaskService]**](AutotaskService.md) | | [optional] +**total_count** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2006.md b/jcapiv2/docs/InlineResponse2006.md new file mode 100644 index 0000000..65a25ab --- /dev/null +++ b/jcapiv2/docs/InlineResponse2006.md @@ -0,0 +1,10 @@ +# InlineResponse2006 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**records** | [**list[AutotaskMappingResponse]**](AutotaskMappingResponse.md) | | [optional] +**total_count** | **float** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2007.md b/jcapiv2/docs/InlineResponse2007.md new file mode 100644 index 0000000..f1bd903 --- /dev/null +++ b/jcapiv2/docs/InlineResponse2007.md @@ -0,0 +1,10 @@ +# InlineResponse2007 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**list[ConnectwiseAgreement]**](ConnectwiseAgreement.md) | | [optional] +**total_count** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2008.md b/jcapiv2/docs/InlineResponse2008.md new file mode 100644 index 0000000..293a248 --- /dev/null +++ b/jcapiv2/docs/InlineResponse2008.md @@ -0,0 +1,10 @@ +# InlineResponse2008 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**list[ConnectwiseAddition]**](ConnectwiseAddition.md) | | [optional] +**total_count** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2009.md b/jcapiv2/docs/InlineResponse2009.md new file mode 100644 index 0000000..bed60f3 --- /dev/null +++ b/jcapiv2/docs/InlineResponse2009.md @@ -0,0 +1,10 @@ +# InlineResponse2009 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**records** | [**list[ConnectWiseMappingResponse]**](ConnectWiseMappingResponse.md) | | [optional] +**total_count** | **float** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse201.md b/jcapiv2/docs/InlineResponse201.md index cfdf053..b29a470 100644 --- a/jcapiv2/docs/InlineResponse201.md +++ b/jcapiv2/docs/InlineResponse201.md @@ -3,9 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**apple_mdm** | [**AppleMDM**](AppleMDM.md) | | [optional] -**signed_csr_plist** | **str** | | [optional] +**integration_id** | **str** | The identifier of the created integration | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/InlineResponse400.md b/jcapiv2/docs/InlineResponse400.md index 95bb2f7..29c731f 100644 --- a/jcapiv2/docs/InlineResponse400.md +++ b/jcapiv2/docs/InlineResponse400.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/Integration.md b/jcapiv2/docs/Integration.md new file mode 100644 index 0000000..781592d --- /dev/null +++ b/jcapiv2/docs/Integration.md @@ -0,0 +1,10 @@ +# Integration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integration_id** | **str** | Unique identifier for this integration | [optional] +**type** | [**IntegrationType**](IntegrationType.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/IntegrationSyncError.md b/jcapiv2/docs/IntegrationSyncError.md new file mode 100644 index 0000000..c0002a8 --- /dev/null +++ b/jcapiv2/docs/IntegrationSyncError.md @@ -0,0 +1,12 @@ +# IntegrationSyncError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_type** | **str** | | +**message** | **str** | | +**org_id** | **str** | | +**timestamp** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/IntegrationSyncErrorResp.md b/jcapiv2/docs/IntegrationSyncErrorResp.md new file mode 100644 index 0000000..b40781f --- /dev/null +++ b/jcapiv2/docs/IntegrationSyncErrorResp.md @@ -0,0 +1,10 @@ +# IntegrationSyncErrorResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**records** | [**list[IntegrationSyncError]**](IntegrationSyncError.md) | | +**total_count** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/IntegrationType.md b/jcapiv2/docs/IntegrationType.md new file mode 100644 index 0000000..7637921 --- /dev/null +++ b/jcapiv2/docs/IntegrationType.md @@ -0,0 +1,8 @@ +# IntegrationType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/IntegrationsResponse.md b/jcapiv2/docs/IntegrationsResponse.md new file mode 100644 index 0000000..1031dae --- /dev/null +++ b/jcapiv2/docs/IntegrationsResponse.md @@ -0,0 +1,10 @@ +# IntegrationsResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**records** | [**list[Integration]**](Integration.md) | | [optional] +**total_count** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/JobId.md b/jcapiv2/docs/JobId.md index 28d0b56..9de045a 100644 --- a/jcapiv2/docs/JobId.md +++ b/jcapiv2/docs/JobId.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/JobWorkresult.md b/jcapiv2/docs/JobWorkresult.md index 5dcc4b0..b74ce1d 100644 --- a/jcapiv2/docs/JobWorkresult.md +++ b/jcapiv2/docs/JobWorkresult.md @@ -3,8 +3,13 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**created_at** | **str** | | [optional] +**id** | **str** | | [optional] **meta** | **object** | | [optional] +**persisted_fields** | **object** | | [optional] +**status** | **str** | | [optional] +**status_msg** | **str** | | [optional] +**updated_at** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/KnowledgeApi.md b/jcapiv2/docs/KnowledgeApi.md deleted file mode 100644 index 6b36c0b..0000000 --- a/jcapiv2/docs/KnowledgeApi.md +++ /dev/null @@ -1,71 +0,0 @@ -# jcapiv2.KnowledgeApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**knowledge_salesforce_list**](KnowledgeApi.md#knowledge_salesforce_list) | **GET** /knowledge/salesforce | List Knowledge Articles - - -# **knowledge_salesforce_list** -> SalesforceKnowledgeListOutput knowledge_salesforce_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) - -List Knowledge Articles - -This endpoint returns a list of knowledge articles hosted in salesforce. ``` Sample Request curl -X GET https://console.jumpcloud.com/api/v2/knowledge/salesforce \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Example -```python -from __future__ import print_function -import time -import jcapiv2 -from jcapiv2.rest import ApiException -from pprint import pprint - -# Configure API key authorization: x-api-key -configuration = jcapiv2.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - -# create an instance of the API class -api_instance = jcapiv2.KnowledgeApi(jcapiv2.ApiClient(configuration)) -fields = ['[\"id\",\"body\",\"title\",\"publishedDate\"]'] # list[str] | (optional) (default to ["id","body","title","publishedDate"]) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) -limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) - -try: - # List Knowledge Articles - api_response = api_instance.knowledge_salesforce_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) - pprint(api_response) -except ApiException as e: - print("Exception when calling KnowledgeApi->knowledge_salesforce_list: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **fields** | [**list[str]**](str.md)| | [optional] [default to ["id","body","title","publishedDate"]] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] - **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - -### Return type - -[**SalesforceKnowledgeListOutput**](SalesforceKnowledgeListOutput.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/LDAPServersApi.md b/jcapiv2/docs/LDAPServersApi.md index 4381c5d..479fd08 100644 --- a/jcapiv2/docs/LDAPServersApi.md +++ b/jcapiv2/docs/LDAPServersApi.md @@ -12,9 +12,8 @@ Method | HTTP request | Description [**ldapservers_list**](LDAPServersApi.md#ldapservers_list) | **GET** /ldapservers | List LDAP Servers [**ldapservers_patch**](LDAPServersApi.md#ldapservers_patch) | **PATCH** /ldapservers/{id} | Update existing LDAP server - # **graph_ldap_server_associations_list** -> list[GraphConnection] graph_ldap_server_associations_list(ldapserver_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_ldap_server_associations_list(ldapserver_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of a LDAP Server @@ -37,16 +36,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.LDAPServersApi(jcapiv2.ApiClient(configuration)) ldapserver_id = 'ldapserver_id_example' # str | ObjectID of the LDAP Server. -targets = ['targets_example'] # list[str] | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +targets = ['targets_example'] # list[str] | Targets which a \"ldap_server\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of a LDAP Server - api_response = api_instance.graph_ldap_server_associations_list(ldapserver_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_ldap_server_associations_list(ldapserver_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling LDAPServersApi->graph_ldap_server_associations_list: %s\n" % e) @@ -57,12 +54,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ldapserver_id** | **str**| ObjectID of the LDAP Server. | - **targets** | [**list[str]**](str.md)| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **targets** | [**list[str]**](str.md)| Targets which a \"ldap_server\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -74,17 +69,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_ldap_server_associations_post** -> graph_ldap_server_associations_post(ldapserver_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_ldap_server_associations_post(ldapserver_id, body=body, x_org_id=x_org_id) Manage the associations of a LDAP Server -This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` +This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` ### Example ```python @@ -103,14 +98,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.LDAPServersApi(jcapiv2.ApiClient(configuration)) ldapserver_id = 'ldapserver_id_example' # str | ObjectID of the LDAP Server. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.GraphManagementReq() # GraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationLdapServer() # GraphOperationLdapServer | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of a LDAP Server - api_instance.graph_ldap_server_associations_post(ldapserver_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_ldap_server_associations_post(ldapserver_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling LDAPServersApi->graph_ldap_server_associations_post: %s\n" % e) ``` @@ -120,10 +113,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ldapserver_id** | **str**| ObjectID of the LDAP Server. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationLdapServer**](GraphOperationLdapServer.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -136,12 +127,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_ldap_server_traverse_user** -> list[GraphObjectWithPaths] graph_ldap_server_traverse_user(ldapserver_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_ldap_server_traverse_user(ldapserver_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Users bound to a LDAP Server @@ -164,16 +155,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.LDAPServersApi(jcapiv2.ApiClient(configuration)) ldapserver_id = 'ldapserver_id_example' # str | ObjectID of the LDAP Server. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Users bound to a LDAP Server - api_response = api_instance.graph_ldap_server_traverse_user(ldapserver_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_ldap_server_traverse_user(ldapserver_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling LDAPServersApi->graph_ldap_server_traverse_user: %s\n" % e) @@ -184,12 +173,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ldapserver_id** | **str**| ObjectID of the LDAP Server. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -201,13 +188,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_ldap_server_traverse_user_group** -> list[GraphObjectWithPaths] graph_ldap_server_traverse_user_group(ldapserver_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_ldap_server_traverse_user_group(ldapserver_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the User Groups bound to a LDAP Server @@ -230,16 +217,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.LDAPServersApi(jcapiv2.ApiClient(configuration)) ldapserver_id = 'ldapserver_id_example' # str | ObjectID of the LDAP Server. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the User Groups bound to a LDAP Server - api_response = api_instance.graph_ldap_server_traverse_user_group(ldapserver_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_ldap_server_traverse_user_group(ldapserver_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling LDAPServersApi->graph_ldap_server_traverse_user_group: %s\n" % e) @@ -250,12 +235,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ldapserver_id** | **str**| ObjectID of the LDAP Server. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -267,13 +250,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **ldapservers_get** -> LdapServerOutput ldapservers_get(id, content_type, accept, x_org_id=x_org_id) +> LdapServerOutput ldapservers_get(id, x_org_id=x_org_id) Get LDAP Server @@ -296,13 +279,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.LDAPServersApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | Unique identifier of the LDAP server. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Get LDAP Server - api_response = api_instance.ldapservers_get(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.ldapservers_get(id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling LDAPServersApi->ldapservers_get: %s\n" % e) @@ -313,9 +294,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| Unique identifier of the LDAP server. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -327,13 +306,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **ldapservers_list** -> list[LdapServerOutput] ldapservers_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +> list[LdapServerOutput] ldapservers_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) List LDAP Servers @@ -355,18 +334,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.LDAPServersApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List LDAP Servers - api_response = api_instance.ldapservers_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.ldapservers_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling LDAPServersApi->ldapservers_list: %s\n" % e) @@ -376,14 +353,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -395,13 +370,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **ldapservers_patch** -> InlineResponse200 ldapservers_patch(id, content_type, accept, body=body, x_api_key=x_api_key, x_org_id=x_org_id) +> InlineResponse20010 ldapservers_patch(id, body=body, x_org_id=x_org_id) Update existing LDAP server @@ -424,15 +399,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.LDAPServersApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | Unique identifier of the LDAP server. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.Body3() # Body3 | (optional) -x_api_key = 'x_api_key_example' # str | (optional) -x_org_id = 'x_org_id_example' # str | (optional) +body = jcapiv2.LdapserversIdBody() # LdapserversIdBody | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Update existing LDAP server - api_response = api_instance.ldapservers_patch(id, content_type, accept, body=body, x_api_key=x_api_key, x_org_id=x_org_id) + api_response = api_instance.ldapservers_patch(id, body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling LDAPServersApi->ldapservers_patch: %s\n" % e) @@ -443,15 +415,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| Unique identifier of the LDAP server. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**Body3**](Body3.md)| | [optional] - **x_api_key** | **str**| | [optional] - **x_org_id** | **str**| | [optional] + **body** | [**LdapserversIdBody**](LdapserversIdBody.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -[**InlineResponse200**](InlineResponse200.md) +[**InlineResponse20010**](InlineResponse20010.md) ### Authorization diff --git a/jcapiv2/docs/ProviderContact.md b/jcapiv2/docs/LdapGroup.md similarity index 84% rename from jcapiv2/docs/ProviderContact.md rename to jcapiv2/docs/LdapGroup.md index 529dd95..a2543be 100644 --- a/jcapiv2/docs/ProviderContact.md +++ b/jcapiv2/docs/LdapGroup.md @@ -1,11 +1,9 @@ -# ProviderContact +# LdapGroup ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**email** | **str** | | [optional] **name** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/LdapServerAction.md b/jcapiv2/docs/LdapServerAction.md index 54f1baa..a2a9056 100644 --- a/jcapiv2/docs/LdapServerAction.md +++ b/jcapiv2/docs/LdapServerAction.md @@ -6,4 +6,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/LdapServerInput.md b/jcapiv2/docs/LdapServerInput.md index a6a4cf9..9bfb2e7 100644 --- a/jcapiv2/docs/LdapServerInput.md +++ b/jcapiv2/docs/LdapServerInput.md @@ -4,9 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name of this LDAP server | [optional] -**user_lockout_action** | **str** | action to take; one of 'remove' or 'disable' | [optional] -**user_password_expiration_action** | **str** | action to take; one of 'remove' or 'disable' | [optional] +**user_lockout_action** | **str** | action to take; one of 'remove' or 'disable' | [optional] +**user_password_expiration_action** | **str** | action to take; one of 'remove' or 'disable' | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/LdapServerOutput.md b/jcapiv2/docs/LdapServerOutput.md index a8307ea..5298a70 100644 --- a/jcapiv2/docs/LdapServerOutput.md +++ b/jcapiv2/docs/LdapServerOutput.md @@ -4,10 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name of this LDAP server | [optional] -**user_lockout_action** | **str** | action to take; one of 'remove' or 'disable' | [optional] -**user_password_expiration_action** | **str** | action to take; one of 'remove' or 'disable' | [optional] -**id** | **str** | Unique identifier of this LDAP server | +**user_lockout_action** | **str** | action to take; one of 'remove' or 'disable' | [optional] +**user_password_expiration_action** | **str** | action to take; one of 'remove' or 'disable' | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/Body3.md b/jcapiv2/docs/LdapserversIdBody.md similarity index 96% rename from jcapiv2/docs/Body3.md rename to jcapiv2/docs/LdapserversIdBody.md index 8cae8ef..ea560ee 100644 --- a/jcapiv2/docs/Body3.md +++ b/jcapiv2/docs/LdapserversIdBody.md @@ -1,4 +1,4 @@ -# Body3 +# LdapserversIdBody ## Properties Name | Type | Description | Notes @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/LogosApi.md b/jcapiv2/docs/LogosApi.md new file mode 100644 index 0000000..8639f1c --- /dev/null +++ b/jcapiv2/docs/LogosApi.md @@ -0,0 +1,56 @@ +# jcapiv2.LogosApi + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**logos_get**](LogosApi.md#logos_get) | **GET** /logos/{id} | Get the logo associated with the specified id + +# **logos_get** +> str logos_get(id) + +Get the logo associated with the specified id + +Return the logo image associated with the specified id + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = jcapiv2.LogosApi() +id = 'id_example' # str | + +try: + # Get the logo associated with the specified id + api_response = api_instance.logos_get(id) + pprint(api_response) +except ApiException as e: + print("Exception when calling LogosApi->logos_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: image/gif, image/jpeg, image/png + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ManagedServiceProviderApi.md b/jcapiv2/docs/ManagedServiceProviderApi.md new file mode 100644 index 0000000..259eb68 --- /dev/null +++ b/jcapiv2/docs/ManagedServiceProviderApi.md @@ -0,0 +1,659 @@ +# jcapiv2.ManagedServiceProviderApi + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**administrator_organizations_create_by_administrator**](ManagedServiceProviderApi.md#administrator_organizations_create_by_administrator) | **POST** /administrators/{id}/organizationlinks | Allow Adminstrator access to an Organization. +[**administrator_organizations_list_by_administrator**](ManagedServiceProviderApi.md#administrator_organizations_list_by_administrator) | **GET** /administrators/{id}/organizationlinks | List the association links between an Administrator and Organizations. +[**administrator_organizations_list_by_organization**](ManagedServiceProviderApi.md#administrator_organizations_list_by_organization) | **GET** /organizations/{id}/administratorlinks | List the association links between an Organization and Administrators. +[**administrator_organizations_remove_by_administrator**](ManagedServiceProviderApi.md#administrator_organizations_remove_by_administrator) | **DELETE** /administrators/{administrator_id}/organizationlinks/{id} | Remove association between an Administrator and an Organization. +[**provider_organizations_update_org**](ManagedServiceProviderApi.md#provider_organizations_update_org) | **PUT** /providers/{provider_id}/organizations/{id} | Update Provider Organization +[**providers_get_provider**](ManagedServiceProviderApi.md#providers_get_provider) | **GET** /providers/{provider_id} | Retrieve Provider +[**providers_list_administrators**](ManagedServiceProviderApi.md#providers_list_administrators) | **GET** /providers/{provider_id}/administrators | List Provider Administrators +[**providers_list_organizations**](ManagedServiceProviderApi.md#providers_list_organizations) | **GET** /providers/{provider_id}/organizations | List Provider Organizations +[**providers_post_admins**](ManagedServiceProviderApi.md#providers_post_admins) | **POST** /providers/{provider_id}/administrators | Create a new Provider Administrator +[**providers_retrieve_invoice**](ManagedServiceProviderApi.md#providers_retrieve_invoice) | **GET** /providers/{provider_id}/invoices/{ID} | Download a provider's invoice. +[**providers_retrieve_invoices**](ManagedServiceProviderApi.md#providers_retrieve_invoices) | **GET** /providers/{provider_id}/invoices | List a provider's invoices. + +# **administrator_organizations_create_by_administrator** +> AdministratorOrganizationLink administrator_organizations_create_by_administrator(id, body=body) + +Allow Adminstrator access to an Organization. + +This endpoint allows you to grant Administrator access to an Organization. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ManagedServiceProviderApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | +body = jcapiv2.AdministratorOrganizationLinkReq() # AdministratorOrganizationLinkReq | (optional) + +try: + # Allow Adminstrator access to an Organization. + api_response = api_instance.administrator_organizations_create_by_administrator(id, body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling ManagedServiceProviderApi->administrator_organizations_create_by_administrator: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **body** | [**AdministratorOrganizationLinkReq**](AdministratorOrganizationLinkReq.md)| | [optional] + +### Return type + +[**AdministratorOrganizationLink**](AdministratorOrganizationLink.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **administrator_organizations_list_by_administrator** +> list[AdministratorOrganizationLink] administrator_organizations_list_by_administrator(id, limit=limit, skip=skip) + +List the association links between an Administrator and Organizations. + +This endpoint returns the association links between an Administrator and Organizations. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ManagedServiceProviderApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) + +try: + # List the association links between an Administrator and Organizations. + api_response = api_instance.administrator_organizations_list_by_administrator(id, limit=limit, skip=skip) + pprint(api_response) +except ApiException as e: + print("Exception when calling ManagedServiceProviderApi->administrator_organizations_list_by_administrator: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + +### Return type + +[**list[AdministratorOrganizationLink]**](AdministratorOrganizationLink.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **administrator_organizations_list_by_organization** +> list[AdministratorOrganizationLink] administrator_organizations_list_by_organization(id, limit=limit, skip=skip) + +List the association links between an Organization and Administrators. + +This endpoint returns the association links between an Organization and Administrators. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ManagedServiceProviderApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) + +try: + # List the association links between an Organization and Administrators. + api_response = api_instance.administrator_organizations_list_by_organization(id, limit=limit, skip=skip) + pprint(api_response) +except ApiException as e: + print("Exception when calling ManagedServiceProviderApi->administrator_organizations_list_by_organization: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + +### Return type + +[**list[AdministratorOrganizationLink]**](AdministratorOrganizationLink.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **administrator_organizations_remove_by_administrator** +> administrator_organizations_remove_by_administrator(administrator_id, id) + +Remove association between an Administrator and an Organization. + +This endpoint removes the association link between an Administrator and an Organization. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ManagedServiceProviderApi(jcapiv2.ApiClient(configuration)) +administrator_id = 'administrator_id_example' # str | +id = 'id_example' # str | + +try: + # Remove association between an Administrator and an Organization. + api_instance.administrator_organizations_remove_by_administrator(administrator_id, id) +except ApiException as e: + print("Exception when calling ManagedServiceProviderApi->administrator_organizations_remove_by_administrator: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **administrator_id** | **str**| | + **id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **provider_organizations_update_org** +> Organization provider_organizations_update_org(provider_id, id, body=body) + +Update Provider Organization + +This endpoint updates a provider's organization + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ManagedServiceProviderApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +id = 'id_example' # str | +body = jcapiv2.Organization() # Organization | (optional) + +try: + # Update Provider Organization + api_response = api_instance.provider_organizations_update_org(provider_id, id, body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling ManagedServiceProviderApi->provider_organizations_update_org: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **id** | **str**| | + **body** | [**Organization**](Organization.md)| | [optional] + +### Return type + +[**Organization**](Organization.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **providers_get_provider** +> Provider providers_get_provider(provider_id, fields=fields) + +Retrieve Provider + +This endpoint returns details about a provider + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ManagedServiceProviderApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) + +try: + # Retrieve Provider + api_response = api_instance.providers_get_provider(provider_id, fields=fields) + pprint(api_response) +except ApiException as e: + print("Exception when calling ManagedServiceProviderApi->providers_get_provider: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + +### Return type + +[**Provider**](Provider.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **providers_list_administrators** +> InlineResponse20012 providers_list_administrators(provider_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + +List Provider Administrators + +This endpoint returns a list of the Administrators associated with the Provider. You must be associated with the provider to use this route. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ManagedServiceProviderApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) + +try: + # List Provider Administrators + api_response = api_instance.providers_list_administrators(provider_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling ManagedServiceProviderApi->providers_list_administrators: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + +### Return type + +[**InlineResponse20012**](InlineResponse20012.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **providers_list_organizations** +> InlineResponse20013 providers_list_organizations(provider_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + +List Provider Organizations + +This endpoint returns a list of the Organizations associated with the Provider. You must be associated with the provider to use this route. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ManagedServiceProviderApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) + +try: + # List Provider Organizations + api_response = api_instance.providers_list_organizations(provider_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling ManagedServiceProviderApi->providers_list_organizations: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + +### Return type + +[**InlineResponse20013**](InlineResponse20013.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **providers_post_admins** +> Administrator providers_post_admins(provider_id, body=body) + +Create a new Provider Administrator + +This endpoint allows you to create a provider administrator. You must be associated with the provider to use this route. You must provide either `role` or `roleName`. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ManagedServiceProviderApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +body = jcapiv2.ProviderAdminReq() # ProviderAdminReq | (optional) + +try: + # Create a new Provider Administrator + api_response = api_instance.providers_post_admins(provider_id, body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling ManagedServiceProviderApi->providers_post_admins: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **body** | [**ProviderAdminReq**](ProviderAdminReq.md)| | [optional] + +### Return type + +[**Administrator**](Administrator.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **providers_retrieve_invoice** +> str providers_retrieve_invoice(provider_id, id) + +Download a provider's invoice. + +Retrieves an invoice for this provider. You must be associated to the provider to use this endpoint. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ManagedServiceProviderApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +id = 'id_example' # str | + +try: + # Download a provider's invoice. + api_response = api_instance.providers_retrieve_invoice(provider_id, id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ManagedServiceProviderApi->providers_retrieve_invoice: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **id** | **str**| | + +### Return type + +**str** + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/pdf + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **providers_retrieve_invoices** +> ProviderInvoiceResponse providers_retrieve_invoices(provider_id, skip=skip, sort=sort, limit=limit) + +List a provider's invoices. + +Retrieves a list of invoices for this provider. You must be associated to the provider to use this endpoint. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ManagedServiceProviderApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) + +try: + # List a provider's invoices. + api_response = api_instance.providers_retrieve_invoices(provider_id, skip=skip, sort=sort, limit=limit) + pprint(api_response) +except ApiException as e: + print("Exception when calling ManagedServiceProviderApi->providers_retrieve_invoices: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + +### Return type + +[**ProviderInvoiceResponse**](ProviderInvoiceResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/MemberSuggestion.md b/jcapiv2/docs/MemberSuggestion.md new file mode 100644 index 0000000..40b69ee --- /dev/null +++ b/jcapiv2/docs/MemberSuggestion.md @@ -0,0 +1,10 @@ +# MemberSuggestion + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | [**GraphObject**](GraphObject.md) | | [optional] +**op** | **str** | How to modify group membership. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/MemberSuggestionsPostResult.md b/jcapiv2/docs/MemberSuggestionsPostResult.md new file mode 100644 index 0000000..38be7cc --- /dev/null +++ b/jcapiv2/docs/MemberSuggestionsPostResult.md @@ -0,0 +1,10 @@ +# MemberSuggestionsPostResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**suggestions_found** | **list[str]** | | [optional] +**suggestions_not_found** | **list[str]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Mobileconfig.md b/jcapiv2/docs/Mobileconfig.md index efd98a3..6a00396 100644 --- a/jcapiv2/docs/Mobileconfig.md +++ b/jcapiv2/docs/Mobileconfig.md @@ -6,4 +6,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/OSRestriction.md b/jcapiv2/docs/OSRestriction.md new file mode 100644 index 0000000..83cbaf7 --- /dev/null +++ b/jcapiv2/docs/OSRestriction.md @@ -0,0 +1,13 @@ +# OSRestriction + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apple_restrictions** | [**OSRestrictionAppleRestrictions**](OSRestrictionAppleRestrictions.md) | | [optional] +**deprecated_version** | **str** | The version of the OS in which the policy was deprecated | [optional] +**earliest_version** | **str** | The earliest version of the OS in which the policy can be applied | [optional] +**os_name** | **str** | The name of the OS in which this restriction applies | [optional] +**supported_enrollment_types** | **list[str]** | This field is deprecated and will be ignored. Use appleRestrictions.supportedEnrollmentTypes instead | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/OSRestrictionAppleRestrictions.md b/jcapiv2/docs/OSRestrictionAppleRestrictions.md new file mode 100644 index 0000000..d68958c --- /dev/null +++ b/jcapiv2/docs/OSRestrictionAppleRestrictions.md @@ -0,0 +1,10 @@ +# OSRestrictionAppleRestrictions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requires_supervision** | **bool** | Boolean representing if the policy requires the Apple devices to be MDM supervised | [optional] +**supported_enrollment_types** | **list[str]** | The supported Apple enrollment types for this policy | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Office365Api.md b/jcapiv2/docs/Office365Api.md index be036e3..5854bf9 100644 --- a/jcapiv2/docs/Office365Api.md +++ b/jcapiv2/docs/Office365Api.md @@ -8,18 +8,20 @@ Method | HTTP request | Description [**graph_office365_associations_post**](Office365Api.md#graph_office365_associations_post) | **POST** /office365s/{office365_id}/associations | Manage the associations of an Office 365 instance [**graph_office365_traverse_user**](Office365Api.md#graph_office365_traverse_user) | **GET** /office365s/{office365_id}/users | List the Users bound to an Office 365 instance [**graph_office365_traverse_user_group**](Office365Api.md#graph_office365_traverse_user_group) | **GET** /office365s/{office365_id}/usergroups | List the User Groups bound to an Office 365 instance +[**office365s_get**](Office365Api.md#office365s_get) | **GET** /office365s/{office365_id} | Get Office 365 instance +[**office365s_list_import_users**](Office365Api.md#office365s_list_import_users) | **GET** /office365s/{office365_id}/import/users | Get a list of users to import from an Office 365 instance +[**office365s_patch**](Office365Api.md#office365s_patch) | **PATCH** /office365s/{office365_id} | Update existing Office 365 instance. [**translation_rules_office365_delete**](Office365Api.md#translation_rules_office365_delete) | **DELETE** /office365s/{office365_id}/translationrules/{id} | Deletes a Office 365 translation rule [**translation_rules_office365_get**](Office365Api.md#translation_rules_office365_get) | **GET** /office365s/{office365_id}/translationrules/{id} | Gets a specific Office 365 translation rule [**translation_rules_office365_list**](Office365Api.md#translation_rules_office365_list) | **GET** /office365s/{office365_id}/translationrules | List all the Office 365 Translation Rules [**translation_rules_office365_post**](Office365Api.md#translation_rules_office365_post) | **POST** /office365s/{office365_id}/translationrules | Create a new Office 365 Translation Rule - # **graph_office365_associations_list** -> list[GraphConnection] graph_office365_associations_list(office365_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_office365_associations_list(office365_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of an Office 365 instance -This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations?targets=user_group' \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -38,16 +40,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.Office365Api(jcapiv2.ApiClient(configuration)) office365_id = 'office365_id_example' # str | ObjectID of the Office 365 instance. -targets = ['targets_example'] # list[str] | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +targets = ['targets_example'] # list[str] | Targets which a \"office_365\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of an Office 365 instance - api_response = api_instance.graph_office365_associations_list(office365_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_office365_associations_list(office365_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling Office365Api->graph_office365_associations_list: %s\n" % e) @@ -58,12 +58,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **office365_id** | **str**| ObjectID of the Office 365 instance. | - **targets** | [**list[str]**](str.md)| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **targets** | [**list[str]**](str.md)| Targets which a \"office_365\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -75,17 +73,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_office365_associations_post** -> graph_office365_associations_post(office365_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_office365_associations_post(office365_id, body=body, x_org_id=x_org_id) Manage the associations of an Office 365 instance -This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` +This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` ### Example ```python @@ -104,14 +102,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.Office365Api(jcapiv2.ApiClient(configuration)) office365_id = 'office365_id_example' # str | ObjectID of the Office 365 instance. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.GraphManagementReq() # GraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationOffice365() # GraphOperationOffice365 | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of an Office 365 instance - api_instance.graph_office365_associations_post(office365_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_office365_associations_post(office365_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling Office365Api->graph_office365_associations_post: %s\n" % e) ``` @@ -121,10 +117,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **office365_id** | **str**| ObjectID of the Office 365 instance. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationOffice365**](GraphOperationOffice365.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -137,16 +131,16 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_office365_traverse_user** -> list[GraphObjectWithPaths] graph_office365_traverse_user(office365_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_office365_traverse_user(office365_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Users bound to an Office 365 instance -This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -165,16 +159,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.Office365Api(jcapiv2.ApiClient(configuration)) office365_id = 'office365_id_example' # str | ObjectID of the Office 365 suite. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Users bound to an Office 365 instance - api_response = api_instance.graph_office365_traverse_user(office365_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_office365_traverse_user(office365_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling Office365Api->graph_office365_traverse_user: %s\n" % e) @@ -185,12 +177,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **office365_id** | **str**| ObjectID of the Office 365 suite. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -202,17 +192,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_office365_traverse_user_group** -> list[GraphObjectWithPaths] graph_office365_traverse_user_group(office365_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_office365_traverse_user_group(office365_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the User Groups bound to an Office 365 instance -This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -231,16 +221,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.Office365Api(jcapiv2.ApiClient(configuration)) office365_id = 'office365_id_example' # str | ObjectID of the Office 365 suite. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the User Groups bound to an Office 365 instance - api_response = api_instance.graph_office365_traverse_user_group(office365_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_office365_traverse_user_group(office365_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling Office365Api->graph_office365_traverse_user_group: %s\n" % e) @@ -251,12 +239,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **office365_id** | **str**| ObjectID of the Office 365 suite. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -266,6 +252,188 @@ Name | Type | Description | Notes [x-api-key](../README.md#x-api-key) +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **office365s_get** +> Office365Output office365s_get(office365_id, x_org_id=x_org_id) + +Get Office 365 instance + +This endpoint returns a specific Office 365 instance. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.Office365Api(jcapiv2.ApiClient(configuration)) +office365_id = 'office365_id_example' # str | ObjectID of the Office 365 instance. +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Get Office 365 instance + api_response = api_instance.office365s_get(office365_id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling Office365Api->office365s_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **office365_id** | **str**| ObjectID of the Office 365 instance. | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**Office365Output**](Office365Output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **office365s_list_import_users** +> InlineResponse20011 office365s_list_import_users(office365_id, consistency_level=consistency_level, top=top, skip_token=skip_token, filter=filter, search=search, orderby=orderby, count=count) + +Get a list of users to import from an Office 365 instance + +Lists Office 365 users available for import. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.Office365Api(jcapiv2.ApiClient(configuration)) +office365_id = 'office365_id_example' # str | +consistency_level = 'consistency_level_example' # str | Defines the consistency header for O365 requests. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#request-headers (optional) +top = 56 # int | Office 365 API maximum number of results per page. See https://docs.microsoft.com/en-us/graph/paging. (optional) +skip_token = 'skip_token_example' # str | Office 365 API token used to access the next page of results. See https://docs.microsoft.com/en-us/graph/paging. (optional) +filter = 'filter_example' # str | Office 365 API filter parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. (optional) +search = 'search_example' # str | Office 365 API search parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. (optional) +orderby = 'orderby_example' # str | Office 365 API orderby parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. (optional) +count = true # bool | Office 365 API count parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. (optional) + +try: + # Get a list of users to import from an Office 365 instance + api_response = api_instance.office365s_list_import_users(office365_id, consistency_level=consistency_level, top=top, skip_token=skip_token, filter=filter, search=search, orderby=orderby, count=count) + pprint(api_response) +except ApiException as e: + print("Exception when calling Office365Api->office365s_list_import_users: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **office365_id** | **str**| | + **consistency_level** | **str**| Defines the consistency header for O365 requests. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#request-headers | [optional] + **top** | **int**| Office 365 API maximum number of results per page. See https://docs.microsoft.com/en-us/graph/paging. | [optional] + **skip_token** | **str**| Office 365 API token used to access the next page of results. See https://docs.microsoft.com/en-us/graph/paging. | [optional] + **filter** | **str**| Office 365 API filter parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. | [optional] + **search** | **str**| Office 365 API search parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. | [optional] + **orderby** | **str**| Office 365 API orderby parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. | [optional] + **count** | **bool**| Office 365 API count parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. | [optional] + +### Return type + +[**InlineResponse20011**](InlineResponse20011.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **office365s_patch** +> Office365Output office365s_patch(office365_id, body=body, x_org_id=x_org_id) + +Update existing Office 365 instance. + +This endpoint allows updating some attributes of an Office 365 instance. ##### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"maintain\", \"userPasswordExpirationAction\": \"suspend\" }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.Office365Api(jcapiv2.ApiClient(configuration)) +office365_id = 'office365_id_example' # str | ObjectID of the Office 365 instance. +body = jcapiv2.Office365PatchInput() # Office365PatchInput | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Update existing Office 365 instance. + api_response = api_instance.office365s_patch(office365_id, body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling Office365Api->office365s_patch: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **office365_id** | **str**| ObjectID of the Office 365 instance. | + **body** | [**Office365PatchInput**](Office365PatchInput.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**Office365Output**](Office365Output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + ### HTTP request headers - **Content-Type**: application/json @@ -274,7 +442,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **translation_rules_office365_delete** -> translation_rules_office365_delete(office365_id, id, content_type, accept) +> translation_rules_office365_delete(office365_id, id) Deletes a Office 365 translation rule @@ -298,12 +466,10 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' api_instance = jcapiv2.Office365Api(jcapiv2.ApiClient(configuration)) office365_id = 'office365_id_example' # str | id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) try: # Deletes a Office 365 translation rule - api_instance.translation_rules_office365_delete(office365_id, id, content_type, accept) + api_instance.translation_rules_office365_delete(office365_id, id) except ApiException as e: print("Exception when calling Office365Api->translation_rules_office365_delete: %s\n" % e) ``` @@ -314,8 +480,6 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **office365_id** | **str**| | **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] ### Return type @@ -327,13 +491,13 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **translation_rules_office365_get** -> Office365TranslationRule translation_rules_office365_get(office365_id, id, content_type, accept) +> Office365TranslationRule translation_rules_office365_get(office365_id, id) Gets a specific Office 365 translation rule @@ -357,12 +521,10 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' api_instance = jcapiv2.Office365Api(jcapiv2.ApiClient(configuration)) office365_id = 'office365_id_example' # str | id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) try: # Gets a specific Office 365 translation rule - api_response = api_instance.translation_rules_office365_get(office365_id, id, content_type, accept) + api_response = api_instance.translation_rules_office365_get(office365_id, id) pprint(api_response) except ApiException as e: print("Exception when calling Office365Api->translation_rules_office365_get: %s\n" % e) @@ -374,8 +536,6 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **office365_id** | **str**| | **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] ### Return type @@ -387,13 +547,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **translation_rules_office365_list** -> list[Office365TranslationRule] translation_rules_office365_list(office365_id, content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) +> list[Office365TranslationRule] translation_rules_office365_list(office365_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) List all the Office 365 Translation Rules @@ -416,17 +576,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.Office365Api(jcapiv2.ApiClient(configuration)) office365_id = 'office365_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) try: # List all the Office 365 Translation Rules - api_response = api_instance.translation_rules_office365_list(office365_id, content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + api_response = api_instance.translation_rules_office365_list(office365_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) pprint(api_response) except ApiException as e: print("Exception when calling Office365Api->translation_rules_office365_list: %s\n" % e) @@ -437,13 +595,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **office365_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] ### Return type @@ -455,17 +611,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **translation_rules_office365_post** -> Office365TranslationRule translation_rules_office365_post(office365_id, content_type, accept, body=body) +> Office365TranslationRule translation_rules_office365_post(office365_id, body=body) Create a new Office 365 Translation Rule -This endpoint allows you to create a translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` +This endpoint allows you to create a translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` ### Example ```python @@ -484,13 +640,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.Office365Api(jcapiv2.ApiClient(configuration)) office365_id = 'office365_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv2.Office365TranslationRuleRequest() # Office365TranslationRuleRequest | (optional) try: # Create a new Office 365 Translation Rule - api_response = api_instance.translation_rules_office365_post(office365_id, content_type, accept, body=body) + api_response = api_instance.translation_rules_office365_post(office365_id, body=body) pprint(api_response) except ApiException as e: print("Exception when calling Office365Api->translation_rules_office365_post: %s\n" % e) @@ -501,8 +655,6 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **office365_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**Office365TranslationRuleRequest**](Office365TranslationRuleRequest.md)| | [optional] ### Return type diff --git a/jcapiv2/docs/Office365BuiltinTranslation.md b/jcapiv2/docs/Office365BuiltinTranslation.md index 8a1c834..85c43f4 100644 --- a/jcapiv2/docs/Office365BuiltinTranslation.md +++ b/jcapiv2/docs/Office365BuiltinTranslation.md @@ -6,4 +6,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/Office365DirectionTranslation.md b/jcapiv2/docs/Office365DirectionTranslation.md new file mode 100644 index 0000000..dd1d2f3 --- /dev/null +++ b/jcapiv2/docs/Office365DirectionTranslation.md @@ -0,0 +1,8 @@ +# Office365DirectionTranslation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Office365ImportApi.md b/jcapiv2/docs/Office365ImportApi.md new file mode 100644 index 0000000..8c03e30 --- /dev/null +++ b/jcapiv2/docs/Office365ImportApi.md @@ -0,0 +1,76 @@ +# jcapiv2.Office365ImportApi + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**office365s_list_import_users**](Office365ImportApi.md#office365s_list_import_users) | **GET** /office365s/{office365_id}/import/users | Get a list of users to import from an Office 365 instance + +# **office365s_list_import_users** +> InlineResponse20011 office365s_list_import_users(office365_id, consistency_level=consistency_level, top=top, skip_token=skip_token, filter=filter, search=search, orderby=orderby, count=count) + +Get a list of users to import from an Office 365 instance + +Lists Office 365 users available for import. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.Office365ImportApi(jcapiv2.ApiClient(configuration)) +office365_id = 'office365_id_example' # str | +consistency_level = 'consistency_level_example' # str | Defines the consistency header for O365 requests. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#request-headers (optional) +top = 56 # int | Office 365 API maximum number of results per page. See https://docs.microsoft.com/en-us/graph/paging. (optional) +skip_token = 'skip_token_example' # str | Office 365 API token used to access the next page of results. See https://docs.microsoft.com/en-us/graph/paging. (optional) +filter = 'filter_example' # str | Office 365 API filter parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. (optional) +search = 'search_example' # str | Office 365 API search parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. (optional) +orderby = 'orderby_example' # str | Office 365 API orderby parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. (optional) +count = true # bool | Office 365 API count parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. (optional) + +try: + # Get a list of users to import from an Office 365 instance + api_response = api_instance.office365s_list_import_users(office365_id, consistency_level=consistency_level, top=top, skip_token=skip_token, filter=filter, search=search, orderby=orderby, count=count) + pprint(api_response) +except ApiException as e: + print("Exception when calling Office365ImportApi->office365s_list_import_users: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **office365_id** | **str**| | + **consistency_level** | **str**| Defines the consistency header for O365 requests. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#request-headers | [optional] + **top** | **int**| Office 365 API maximum number of results per page. See https://docs.microsoft.com/en-us/graph/paging. | [optional] + **skip_token** | **str**| Office 365 API token used to access the next page of results. See https://docs.microsoft.com/en-us/graph/paging. | [optional] + **filter** | **str**| Office 365 API filter parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. | [optional] + **search** | **str**| Office 365 API search parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. | [optional] + **orderby** | **str**| Office 365 API orderby parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. | [optional] + **count** | **bool**| Office 365 API count parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. | [optional] + +### Return type + +[**InlineResponse20011**](InlineResponse20011.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Office365Output.md b/jcapiv2/docs/Office365Output.md new file mode 100644 index 0000000..7ab7e6d --- /dev/null +++ b/jcapiv2/docs/Office365Output.md @@ -0,0 +1,13 @@ +# Office365Output + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**groups_enabled** | **bool** | | [optional] +**id** | **str** | | +**name** | **str** | | [optional] +**user_lockout_action** | **str** | | +**user_password_expiration_action** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Body.md b/jcapiv2/docs/Office365PatchInput.md similarity index 72% rename from jcapiv1/docs/Body.md rename to jcapiv2/docs/Office365PatchInput.md index 3d605f9..c2f9e85 100644 --- a/jcapiv1/docs/Body.md +++ b/jcapiv2/docs/Office365PatchInput.md @@ -1,15 +1,12 @@ -# Body +# Office365PatchInput ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mfa** | **str** | | [optional] -**name** | **str** | | -**network_source_ip** | **str** | | -**tags** | **list[str]** | | [optional] +**groups_enabled** | **bool** | | [optional] +**name** | **str** | | [optional] **user_lockout_action** | **str** | | [optional] **user_password_expiration_action** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/Office365TranslationRule.md b/jcapiv2/docs/Office365TranslationRule.md index 480d31d..9291b39 100644 --- a/jcapiv2/docs/Office365TranslationRule.md +++ b/jcapiv2/docs/Office365TranslationRule.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **built_in** | [**Office365BuiltinTranslation**](Office365BuiltinTranslation.md) | | [optional] +**direction** | [**Office365DirectionTranslation**](Office365DirectionTranslation.md) | | [optional] **id** | **str** | ObjectId uniquely identifying a Translation Rule. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/Office365TranslationRuleRequest.md b/jcapiv2/docs/Office365TranslationRuleRequest.md index 6f935ab..bcf7fe1 100644 --- a/jcapiv2/docs/Office365TranslationRuleRequest.md +++ b/jcapiv2/docs/Office365TranslationRuleRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **built_in** | [**Office365BuiltinTranslation**](Office365BuiltinTranslation.md) | | [optional] +**direction** | [**Office365DirectionTranslation**](Office365DirectionTranslation.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/OrgCryptoSettings.md b/jcapiv2/docs/OrgCryptoSettings.md deleted file mode 100644 index 249a7e3..0000000 --- a/jcapiv2/docs/OrgCryptoSettings.md +++ /dev/null @@ -1,10 +0,0 @@ -# OrgCryptoSettings - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ssh_keys** | [**OrgcryptosettingsSshKeys**](OrgcryptosettingsSshKeys.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv2/docs/JcEnrollmentProfile.md b/jcapiv2/docs/Organization.md similarity index 67% rename from jcapiv2/docs/JcEnrollmentProfile.md rename to jcapiv2/docs/Organization.md index a47074a..c558088 100644 --- a/jcapiv2/docs/JcEnrollmentProfile.md +++ b/jcapiv2/docs/Organization.md @@ -1,14 +1,11 @@ -# JcEnrollmentProfile +# Organization ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**groups** | **list[str]** | | [optional] **id** | **str** | | [optional] +**max_system_users** | **int** | The maximum number of users allowed in this organization. Requires organizations.billing scope to modify. | [optional] **name** | **str** | | [optional] -**organization** | **str** | | [optional] -**users** | **list[str]** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/OrganizationCase.md b/jcapiv2/docs/OrganizationCase.md new file mode 100644 index 0000000..a3509cb --- /dev/null +++ b/jcapiv2/docs/OrganizationCase.md @@ -0,0 +1,16 @@ +# OrganizationCase + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**case_number** | **str** | | [optional] +**_date** | **str** | | [optional] +**description** | **str** | | [optional] +**label** | **str** | | [optional] +**reporter** | **str** | | [optional] +**reporter_email** | **str** | | [optional] +**status** | **str** | | [optional] +**subject** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Tagslist.md b/jcapiv2/docs/OrganizationCasesResponse.md similarity index 64% rename from jcapiv1/docs/Tagslist.md rename to jcapiv2/docs/OrganizationCasesResponse.md index d65484d..ec1d3b1 100644 --- a/jcapiv1/docs/Tagslist.md +++ b/jcapiv2/docs/OrganizationCasesResponse.md @@ -1,11 +1,10 @@ -# Tagslist +# OrganizationCasesResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**results** | [**list[Tag]**](Tag.md) | The list of tags. | [optional] -**total_count** | **int** | The total number of tags. | [optional] +**results** | [**list[OrganizationCase]**](OrganizationCase.md) | | [optional] +**total_count** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/OrganizationsApi.md b/jcapiv2/docs/OrganizationsApi.md index c920247..4731415 100644 --- a/jcapiv2/docs/OrganizationsApi.md +++ b/jcapiv2/docs/OrganizationsApi.md @@ -4,14 +4,74 @@ All URIs are relative to *https://console.jumpcloud.com/api/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**org_crypto_get**](OrganizationsApi.md#org_crypto_get) | **GET** /organizations/{id}/crypto | Get Crypto Settings -[**org_crypto_put**](OrganizationsApi.md#org_crypto_put) | **PUT** /organizations/{id}/crypto | Edit Crypto Settings +[**administrator_organizations_create_by_administrator**](OrganizationsApi.md#administrator_organizations_create_by_administrator) | **POST** /administrators/{id}/organizationlinks | Allow Adminstrator access to an Organization. +[**administrator_organizations_list_by_administrator**](OrganizationsApi.md#administrator_organizations_list_by_administrator) | **GET** /administrators/{id}/organizationlinks | List the association links between an Administrator and Organizations. +[**administrator_organizations_list_by_organization**](OrganizationsApi.md#administrator_organizations_list_by_organization) | **GET** /organizations/{id}/administratorlinks | List the association links between an Organization and Administrators. +[**administrator_organizations_remove_by_administrator**](OrganizationsApi.md#administrator_organizations_remove_by_administrator) | **DELETE** /administrators/{administrator_id}/organizationlinks/{id} | Remove association between an Administrator and an Organization. +[**organizations_list_cases**](OrganizationsApi.md#organizations_list_cases) | **GET** /organizations/cases | Get all cases (Support/Feature requests) for organization +# **administrator_organizations_create_by_administrator** +> AdministratorOrganizationLink administrator_organizations_create_by_administrator(id, body=body) -# **org_crypto_get** -> OrgCryptoSettings org_crypto_get(id, content_type, accept, fields=fields, filter=filter, x_org_id=x_org_id, skip=skip, sort=sort, limit=limit) +Allow Adminstrator access to an Organization. -Get Crypto Settings +This endpoint allows you to grant Administrator access to an Organization. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.OrganizationsApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | +body = jcapiv2.AdministratorOrganizationLinkReq() # AdministratorOrganizationLinkReq | (optional) + +try: + # Allow Adminstrator access to an Organization. + api_response = api_instance.administrator_organizations_create_by_administrator(id, body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling OrganizationsApi->administrator_organizations_create_by_administrator: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **body** | [**AdministratorOrganizationLinkReq**](AdministratorOrganizationLinkReq.md)| | [optional] + +### Return type + +[**AdministratorOrganizationLink**](AdministratorOrganizationLink.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **administrator_organizations_list_by_administrator** +> list[AdministratorOrganizationLink] administrator_organizations_list_by_administrator(id, limit=limit, skip=skip) + +List the association links between an Administrator and Organizations. + +This endpoint returns the association links between an Administrator and Organizations. ### Example ```python @@ -30,21 +90,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.OrganizationsApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) -skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) try: - # Get Crypto Settings - api_response = api_instance.org_crypto_get(id, content_type, accept, fields=fields, filter=filter, x_org_id=x_org_id, skip=skip, sort=sort, limit=limit) + # List the association links between an Administrator and Organizations. + api_response = api_instance.administrator_organizations_list_by_administrator(id, limit=limit, skip=skip) pprint(api_response) except ApiException as e: - print("Exception when calling OrganizationsApi->org_crypto_get: %s\n" % e) + print("Exception when calling OrganizationsApi->administrator_organizations_list_by_administrator: %s\n" % e) ``` ### Parameters @@ -52,18 +106,70 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] + +### Return type + +[**list[AdministratorOrganizationLink]**](AdministratorOrganizationLink.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **administrator_organizations_list_by_organization** +> list[AdministratorOrganizationLink] administrator_organizations_list_by_organization(id, limit=limit, skip=skip) + +List the association links between an Organization and Administrators. + +This endpoint returns the association links between an Organization and Administrators. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.OrganizationsApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) + +try: + # List the association links between an Organization and Administrators. + api_response = api_instance.administrator_organizations_list_by_organization(id, limit=limit, skip=skip) + pprint(api_response) +except ApiException as e: + print("Exception when calling OrganizationsApi->administrator_organizations_list_by_organization: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] ### Return type -[**OrgCryptoSettings**](OrgCryptoSettings.md) +[**list[AdministratorOrganizationLink]**](AdministratorOrganizationLink.md) ### Authorization @@ -71,15 +177,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **org_crypto_put** -> object org_crypto_put(id, content_type, accept, body=body, fields=fields, filter=filter, x_org_id=x_org_id, skip=skip, sort=sort, limit=limit) +# **administrator_organizations_remove_by_administrator** +> administrator_organizations_remove_by_administrator(administrator_id, id) + +Remove association between an Administrator and an Organization. -Edit Crypto Settings +This endpoint removes the association link between an Administrator and an Organization. ### Example ```python @@ -97,43 +205,84 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.OrganizationsApi(jcapiv2.ApiClient(configuration)) +administrator_id = 'administrator_id_example' # str | id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.OrgCryptoSettings() # OrgCryptoSettings | (optional) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) + +try: + # Remove association between an Administrator and an Organization. + api_instance.administrator_organizations_remove_by_administrator(administrator_id, id) +except ApiException as e: + print("Exception when calling OrganizationsApi->administrator_organizations_remove_by_administrator: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **administrator_id** | **str**| | + **id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **organizations_list_cases** +> OrganizationCasesResponse organizations_list_cases(skip=skip, sort=sort, limit=limit) + +Get all cases (Support/Feature requests) for organization + +This endpoint returns the cases (Support/Feature requests) for the organization + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.OrganizationsApi(jcapiv2.ApiClient(configuration)) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) try: - # Edit Crypto Settings - api_response = api_instance.org_crypto_put(id, content_type, accept, body=body, fields=fields, filter=filter, x_org_id=x_org_id, skip=skip, sort=sort, limit=limit) + # Get all cases (Support/Feature requests) for organization + api_response = api_instance.organizations_list_cases(skip=skip, sort=sort, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling OrganizationsApi->org_crypto_put: %s\n" % e) + print("Exception when calling OrganizationsApi->organizations_list_cases: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**OrgCryptoSettings**](OrgCryptoSettings.md)| | [optional] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] ### Return type -**object** +[**OrganizationCasesResponse**](OrganizationCasesResponse.md) ### Authorization @@ -141,7 +290,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/OrgcryptosettingsSshKeys.md b/jcapiv2/docs/OrgcryptosettingsSshKeys.md deleted file mode 100644 index 3a1072f..0000000 --- a/jcapiv2/docs/OrgcryptosettingsSshKeys.md +++ /dev/null @@ -1,12 +0,0 @@ -# OrgcryptosettingsSshKeys - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**key_size** | **int** | | [optional] -**validate** | **bool** | | [optional] -**validate_key_size** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv2/docs/SystemuserputpostPhoneNumbers.md b/jcapiv2/docs/PhoneNumber.md similarity index 87% rename from jcapiv2/docs/SystemuserputpostPhoneNumbers.md rename to jcapiv2/docs/PhoneNumber.md index 1550349..77a6716 100644 --- a/jcapiv2/docs/SystemuserputpostPhoneNumbers.md +++ b/jcapiv2/docs/PhoneNumber.md @@ -1,11 +1,11 @@ -# SystemuserputpostPhoneNumbers +# PhoneNumber ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] **number** | **str** | | [optional] **type** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/PoliciesApi.md b/jcapiv2/docs/PoliciesApi.md index 4f43139..482a614 100644 --- a/jcapiv2/docs/PoliciesApi.md +++ b/jcapiv2/docs/PoliciesApi.md @@ -6,6 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**graph_policy_associations_list**](PoliciesApi.md#graph_policy_associations_list) | **GET** /policies/{policy_id}/associations | List the associations of a Policy [**graph_policy_associations_post**](PoliciesApi.md#graph_policy_associations_post) | **POST** /policies/{policy_id}/associations | Manage the associations of a Policy +[**graph_policy_member_of**](PoliciesApi.md#graph_policy_member_of) | **GET** /policies/{policy_id}/memberof | List the parent Groups of a Policy [**graph_policy_traverse_system**](PoliciesApi.md#graph_policy_traverse_system) | **GET** /policies/{policy_id}/systems | List the Systems bound to a Policy [**graph_policy_traverse_system_group**](PoliciesApi.md#graph_policy_traverse_system_group) | **GET** /policies/{policy_id}/systemgroups | List the System Groups bound to a Policy [**policies_delete**](PoliciesApi.md#policies_delete) | **DELETE** /policies/{id} | Deletes a Policy @@ -15,15 +16,14 @@ Method | HTTP request | Description [**policies_put**](PoliciesApi.md#policies_put) | **PUT** /policies/{id} | Update an existing Policy [**policyresults_get**](PoliciesApi.md#policyresults_get) | **GET** /policyresults/{id} | Get a specific Policy Result. [**policyresults_list**](PoliciesApi.md#policyresults_list) | **GET** /policies/{policy_id}/policyresults | Lists all the policy results of a policy. -[**policyresults_org_list**](PoliciesApi.md#policyresults_org_list) | **GET** /policyresults | Lists all the policy results for an organization. -[**policystatuses_list**](PoliciesApi.md#policystatuses_list) | **GET** /policies/{policy_id}/policystatuses | Lists the latest policy results of a policy. -[**policystatuses_list_0**](PoliciesApi.md#policystatuses_list_0) | **GET** /systems/{system_id}/policystatuses | List the policy statuses for a system +[**policyresults_org_list**](PoliciesApi.md#policyresults_org_list) | **GET** /policyresults | Lists all of the policy results for an organization. +[**policystatuses_policies_list**](PoliciesApi.md#policystatuses_policies_list) | **GET** /policies/{policy_id}/policystatuses | Lists the latest policy results of a policy. +[**policystatuses_systems_list**](PoliciesApi.md#policystatuses_systems_list) | **GET** /systems/{system_id}/policystatuses | List the policy statuses for a system [**policytemplates_get**](PoliciesApi.md#policytemplates_get) | **GET** /policytemplates/{id} | Get a specific Policy Template [**policytemplates_list**](PoliciesApi.md#policytemplates_list) | **GET** /policytemplates | Lists all of the Policy Templates - # **graph_policy_associations_list** -> list[GraphConnection] graph_policy_associations_list(policy_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_policy_associations_list(policy_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of a Policy @@ -46,16 +46,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.PoliciesApi(jcapiv2.ApiClient(configuration)) policy_id = 'policy_id_example' # str | ObjectID of the Policy. -targets = ['targets_example'] # list[str] | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +targets = ['targets_example'] # list[str] | Targets which a \"policy\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of a Policy - api_response = api_instance.graph_policy_associations_list(policy_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_policy_associations_list(policy_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling PoliciesApi->graph_policy_associations_list: %s\n" % e) @@ -66,12 +64,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **policy_id** | **str**| ObjectID of the Policy. | - **targets** | [**list[str]**](str.md)| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **targets** | [**list[str]**](str.md)| Targets which a \"policy\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -83,17 +79,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_policy_associations_post** -> graph_policy_associations_post(policy_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_policy_associations_post(policy_id, body=body, x_org_id=x_org_id) Manage the associations of a Policy -This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` +This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` ### Example ```python @@ -112,14 +108,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.PoliciesApi(jcapiv2.ApiClient(configuration)) policy_id = 'policy_id_example' # str | ObjectID of the Policy. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.GraphManagementReq() # GraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationPolicy() # GraphOperationPolicy | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of a Policy - api_instance.graph_policy_associations_post(policy_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_policy_associations_post(policy_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling PoliciesApi->graph_policy_associations_post: %s\n" % e) ``` @@ -129,10 +123,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **policy_id** | **str**| ObjectID of the Policy. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationPolicy**](GraphOperationPolicy.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -145,12 +137,80 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_member_of** +> list[GraphObjectWithPaths] graph_policy_member_of(policy_id, filter=filter, limit=limit, skip=skip, _date=_date, authorization=authorization, sort=sort, x_org_id=x_org_id) + +List the parent Groups of a Policy + +This endpoint returns all the Policy Groups a Policy is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PoliciesApi(jcapiv2.ApiClient(configuration)) +policy_id = 'policy_id_example' # str | ObjectID of the Policy. +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +_date = '_date_example' # str | Current date header for the System Context API (optional) +authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List the parent Groups of a Policy + api_response = api_instance.graph_policy_member_of(policy_id, filter=filter, limit=limit, skip=skip, _date=_date, authorization=authorization, sort=sort, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PoliciesApi->graph_policy_member_of: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **policy_id** | **str**| ObjectID of the Policy. | + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **_date** | **str**| Current date header for the System Context API | [optional] + **authorization** | **str**| Authorization header for the System Context API | [optional] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_policy_traverse_system** -> list[GraphObjectWithPaths] graph_policy_traverse_system(policy_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_policy_traverse_system(policy_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Systems bound to a Policy @@ -173,16 +233,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.PoliciesApi(jcapiv2.ApiClient(configuration)) policy_id = 'policy_id_example' # str | ObjectID of the Command. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Systems bound to a Policy - api_response = api_instance.graph_policy_traverse_system(policy_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_policy_traverse_system(policy_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling PoliciesApi->graph_policy_traverse_system: %s\n" % e) @@ -193,12 +251,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **policy_id** | **str**| ObjectID of the Command. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -210,13 +266,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_policy_traverse_system_group** -> list[GraphObjectWithPaths] graph_policy_traverse_system_group(policy_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_policy_traverse_system_group(policy_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the System Groups bound to a Policy @@ -239,16 +295,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.PoliciesApi(jcapiv2.ApiClient(configuration)) policy_id = 'policy_id_example' # str | ObjectID of the Command. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the System Groups bound to a Policy - api_response = api_instance.graph_policy_traverse_system_group(policy_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_policy_traverse_system_group(policy_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling PoliciesApi->graph_policy_traverse_system_group: %s\n" % e) @@ -259,12 +313,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **policy_id** | **str**| ObjectID of the Command. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -276,13 +328,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **policies_delete** -> policies_delete(id, content_type, accept, x_org_id=x_org_id) +> policies_delete(id, x_org_id=x_org_id) Deletes a Policy @@ -305,13 +357,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.PoliciesApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | ObjectID of the Policy object. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Deletes a Policy - api_instance.policies_delete(id, content_type, accept, x_org_id=x_org_id) + api_instance.policies_delete(id, x_org_id=x_org_id) except ApiException as e: print("Exception when calling PoliciesApi->policies_delete: %s\n" % e) ``` @@ -321,9 +371,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| ObjectID of the Policy object. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -335,13 +383,13 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **policies_get** -> PolicyWithDetails policies_get(id, content_type, accept, x_org_id=x_org_id) +> PolicyWithDetails policies_get(id, x_org_id=x_org_id) Gets a specific Policy. @@ -364,13 +412,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.PoliciesApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | ObjectID of the Policy object. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Gets a specific Policy. - api_response = api_instance.policies_get(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.policies_get(id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling PoliciesApi->policies_get: %s\n" % e) @@ -381,9 +427,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| ObjectID of the Policy object. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -395,13 +439,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **policies_list** -> list[Policy] policies_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +> list[Policy] policies_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) Lists all the Policies @@ -423,18 +467,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.PoliciesApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Lists all the Policies - api_response = api_instance.policies_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.policies_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling PoliciesApi->policies_list: %s\n" % e) @@ -444,14 +486,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -463,17 +503,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **policies_post** -> PolicyWithDetails policies_post(content_type, accept, body=body, x_org_id=x_org_id) +> PolicyWithDetails policies_post(body=body, x_org_id=x_org_id) Create a new Policy -This endpoint allows you to create a policy. Given the amount of configurable parameters required to create a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Policy_Parameters} }' ``` +This endpoint allows you to create a policy. Given the amount of configurable parameters required to create a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Policy_Parameters} }' ``` ### Example ```python @@ -491,14 +531,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.PoliciesApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv2.PolicyRequest() # PolicyRequest | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Create a new Policy - api_response = api_instance.policies_post(content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.policies_post(body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling PoliciesApi->policies_post: %s\n" % e) @@ -508,10 +546,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**PolicyRequest**](PolicyRequest.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -533,7 +569,7 @@ Name | Type | Description | Notes Update an existing Policy -This endpoint allows you to update a policy. Given the amount of configurable parameters required to update a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/policies/59fced45c9118022172547ff \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY' \\ -d '{ {Policy_Parameters} }' ``` +This endpoint allows you to update a policy. Given the amount of configurable parameters required to update a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/policies/59fced45c9118022172547ff \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Policy_Parameters} }' ``` ### Example ```python @@ -553,7 +589,7 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' api_instance = jcapiv2.PoliciesApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | ObjectID of the Policy object. body = jcapiv2.PolicyRequest() # PolicyRequest | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Update an existing Policy @@ -569,7 +605,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| ObjectID of the Policy object. | **body** | [**PolicyRequest**](PolicyRequest.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -587,7 +623,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **policyresults_get** -> PolicyResult policyresults_get(id, content_type, accept, x_org_id=x_org_id) +> PolicyResult policyresults_get(id, x_org_id=x_org_id) Get a specific Policy Result. @@ -610,13 +646,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.PoliciesApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | ObjectID of the Policy Result. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Get a specific Policy Result. - api_response = api_instance.policyresults_get(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.policyresults_get(id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling PoliciesApi->policyresults_get: %s\n" % e) @@ -627,9 +661,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| ObjectID of the Policy Result. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -641,13 +673,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **policyresults_list** -> list[PolicyResult] policyresults_list(policy_id, content_type, accept, fields=fields, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip, sort=sort) +> list[PolicyResult] policyresults_list(policy_id, fields=fields, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip, sort=sort) Lists all the policy results of a policy. @@ -670,18 +702,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.PoliciesApi(jcapiv2.ApiClient(configuration)) policy_id = 'policy_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) try: # Lists all the policy results of a policy. - api_response = api_instance.policyresults_list(policy_id, content_type, accept, fields=fields, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip, sort=sort) + api_response = api_instance.policyresults_list(policy_id, fields=fields, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip, sort=sort) pprint(api_response) except ApiException as e: print("Exception when calling PoliciesApi->policyresults_list: %s\n" % e) @@ -692,14 +722,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **policy_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] ### Return type @@ -711,17 +739,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **policyresults_org_list** -> list[PolicyResult] policyresults_org_list(content_type, accept, fields=fields, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip, sort=sort) +> list[PolicyResult] policyresults_org_list(fields=fields, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip, sort=sort) -Lists all the policy results for an organization. +Lists all of the policy results for an organization. -This endpoint returns all policies results for an organization. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policyresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint returns all policy results for an organization. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policyresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -739,18 +767,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.PoliciesApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) try: - # Lists all the policy results for an organization. - api_response = api_instance.policyresults_org_list(content_type, accept, fields=fields, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip, sort=sort) + # Lists all of the policy results for an organization. + api_response = api_instance.policyresults_org_list(fields=fields, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip, sort=sort) pprint(api_response) except ApiException as e: print("Exception when calling PoliciesApi->policyresults_org_list: %s\n" % e) @@ -760,14 +786,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] ### Return type @@ -779,17 +803,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **policystatuses_list** -> list[PolicyResult] policystatuses_list(policy_id, content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +# **policystatuses_policies_list** +> list[PolicyResult] policystatuses_policies_list(policy_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) Lists the latest policy results of a policy. -This endpoint returns the latest policies results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint returns the latest policy results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -808,21 +832,19 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.PoliciesApi(jcapiv2.ApiClient(configuration)) policy_id = 'policy_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Lists the latest policy results of a policy. - api_response = api_instance.policystatuses_list(policy_id, content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.policystatuses_policies_list(policy_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: - print("Exception when calling PoliciesApi->policystatuses_list: %s\n" % e) + print("Exception when calling PoliciesApi->policystatuses_policies_list: %s\n" % e) ``` ### Parameters @@ -830,14 +852,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **policy_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -849,13 +869,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **policystatuses_list_0** -> list[PolicyResult] policystatuses_list_0(system_id, content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +# **policystatuses_systems_list** +> list[PolicyResult] policystatuses_systems_list(system_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) List the policy statuses for a system @@ -878,21 +898,19 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.PoliciesApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | ObjectID of the System. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the policy statuses for a system - api_response = api_instance.policystatuses_list_0(system_id, content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.policystatuses_systems_list(system_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: - print("Exception when calling PoliciesApi->policystatuses_list_0: %s\n" % e) + print("Exception when calling PoliciesApi->policystatuses_systems_list: %s\n" % e) ``` ### Parameters @@ -900,14 +918,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| ObjectID of the System. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -919,17 +935,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **policytemplates_get** -> PolicyTemplateWithDetails policytemplates_get(id, content_type, accept, x_org_id=x_org_id) +> PolicyTemplateWithDetails policytemplates_get(id, x_org_id=x_org_id) Get a specific Policy Template -This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates/{Policy_Template_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -948,13 +964,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.PoliciesApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | ObjectID of the Policy Template. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Get a specific Policy Template - api_response = api_instance.policytemplates_get(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.policytemplates_get(id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling PoliciesApi->policytemplates_get: %s\n" % e) @@ -965,9 +979,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| ObjectID of the Policy Template. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -979,13 +991,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **policytemplates_list** -> list[PolicyTemplate] policytemplates_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +> list[PolicyTemplate] policytemplates_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) Lists all of the Policy Templates @@ -1007,18 +1019,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.PoliciesApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Lists all of the Policy Templates - api_response = api_instance.policytemplates_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.policytemplates_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling PoliciesApi->policytemplates_list: %s\n" % e) @@ -1028,14 +1038,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -1047,7 +1055,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/Policy.md b/jcapiv2/docs/Policy.md index 9a41e46..014ddac 100644 --- a/jcapiv2/docs/Policy.md +++ b/jcapiv2/docs/Policy.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/PolicyGroup.md b/jcapiv2/docs/PolicyGroup.md new file mode 100644 index 0000000..a75296f --- /dev/null +++ b/jcapiv2/docs/PolicyGroup.md @@ -0,0 +1,14 @@ +# PolicyGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] +**description** | **str** | Description of a Policy Group | [optional] +**email** | **str** | E-mail address associated with a Policy Group | [optional] +**id** | **str** | ObjectId uniquely identifying a Policy Group. | [optional] +**name** | **str** | Display name of a Policy Group. | [optional] +**type** | **str** | The type of the group; always 'policy' for a Policy Group. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PolicyGroupAssociationsApi.md b/jcapiv2/docs/PolicyGroupAssociationsApi.md new file mode 100644 index 0000000..755a6ec --- /dev/null +++ b/jcapiv2/docs/PolicyGroupAssociationsApi.md @@ -0,0 +1,254 @@ +# jcapiv2.PolicyGroupAssociationsApi + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**graph_policy_group_associations_list**](PolicyGroupAssociationsApi.md#graph_policy_group_associations_list) | **GET** /policygroups/{group_id}/associations | List the associations of a Policy Group. +[**graph_policy_group_associations_post**](PolicyGroupAssociationsApi.md#graph_policy_group_associations_post) | **POST** /policygroups/{group_id}/associations | Manage the associations of a Policy Group +[**graph_policy_group_traverse_system**](PolicyGroupAssociationsApi.md#graph_policy_group_traverse_system) | **GET** /policygroups/{group_id}/systems | List the Systems bound to a Policy Group +[**graph_policy_group_traverse_system_group**](PolicyGroupAssociationsApi.md#graph_policy_group_traverse_system_group) | **GET** /policygroups/{group_id}/systemgroups | List the System Groups bound to Policy Groups + +# **graph_policy_group_associations_list** +> list[GraphConnection] graph_policy_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) + +List the associations of a Policy Group. + +This endpoint returns the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupAssociationsApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +targets = ['targets_example'] # list[str] | Targets which a \"policy_group\" can be associated to. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List the associations of a Policy Group. + api_response = api_instance.graph_policy_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PolicyGroupAssociationsApi->graph_policy_group_associations_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **targets** | [**list[str]**](str.md)| Targets which a \"policy_group\" can be associated to. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**list[GraphConnection]**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_group_associations_post** +> graph_policy_group_associations_post(group_id, body=body, x_org_id=x_org_id) + +Manage the associations of a Policy Group + +This endpoint manages the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupAssociationsApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +body = jcapiv2.GraphOperationPolicyGroup() # GraphOperationPolicyGroup | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Manage the associations of a Policy Group + api_instance.graph_policy_group_associations_post(group_id, body=body, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling PolicyGroupAssociationsApi->graph_policy_group_associations_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **body** | [**GraphOperationPolicyGroup**](GraphOperationPolicyGroup.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_group_traverse_system** +> list[GraphObjectWithPaths] graph_policy_group_traverse_system(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + +List the Systems bound to a Policy Group + +This endpoint will return all Systems bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupAssociationsApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) + +try: + # List the Systems bound to a Policy Group + api_response = api_instance.graph_policy_group_traverse_system(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + pprint(api_response) +except ApiException as e: + print("Exception when calling PolicyGroupAssociationsApi->graph_policy_group_traverse_system: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_group_traverse_system_group** +> list[GraphObjectWithPaths] graph_policy_group_traverse_system_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + +List the System Groups bound to Policy Groups + +This endpoint will return all System Groups bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupAssociationsApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) + +try: + # List the System Groups bound to Policy Groups + api_response = api_instance.graph_policy_group_traverse_system_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + pprint(api_response) +except ApiException as e: + print("Exception when calling PolicyGroupAssociationsApi->graph_policy_group_traverse_system_group: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PolicyGroupData.md b/jcapiv2/docs/PolicyGroupData.md new file mode 100644 index 0000000..7c412f7 --- /dev/null +++ b/jcapiv2/docs/PolicyGroupData.md @@ -0,0 +1,9 @@ +# PolicyGroupData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Display name of a Policy Group. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PolicyGroupMembersMembershipApi.md b/jcapiv2/docs/PolicyGroupMembersMembershipApi.md new file mode 100644 index 0000000..906e03d --- /dev/null +++ b/jcapiv2/docs/PolicyGroupMembersMembershipApi.md @@ -0,0 +1,191 @@ +# jcapiv2.PolicyGroupMembersMembershipApi + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**graph_policy_group_members_list**](PolicyGroupMembersMembershipApi.md#graph_policy_group_members_list) | **GET** /policygroups/{group_id}/members | List the members of a Policy Group +[**graph_policy_group_members_post**](PolicyGroupMembersMembershipApi.md#graph_policy_group_members_post) | **POST** /policygroups/{group_id}/members | Manage the members of a Policy Group +[**graph_policy_group_membership**](PolicyGroupMembersMembershipApi.md#graph_policy_group_membership) | **GET** /policygroups/{group_id}/membership | List the Policy Group's membership + +# **graph_policy_group_members_list** +> list[GraphConnection] graph_policy_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) + +List the members of a Policy Group + +This endpoint returns the Policy members of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupMembersMembershipApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List the members of a Policy Group + api_response = api_instance.graph_policy_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PolicyGroupMembersMembershipApi->graph_policy_group_members_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**list[GraphConnection]**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_group_members_post** +> graph_policy_group_members_post(group_id, body=body, x_org_id=x_org_id) + +Manage the members of a Policy Group + +This endpoint allows you to manage the Policy members of a Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"policy\", \"id\": \"{Policy_ID}\" }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupMembersMembershipApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +body = jcapiv2.GraphOperationPolicyGroupMember() # GraphOperationPolicyGroupMember | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Manage the members of a Policy Group + api_instance.graph_policy_group_members_post(group_id, body=body, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling PolicyGroupMembersMembershipApi->graph_policy_group_members_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **body** | [**GraphOperationPolicyGroupMember**](GraphOperationPolicyGroupMember.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_group_membership** +> list[GraphObjectWithPaths] graph_policy_group_membership(group_id, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + +List the Policy Group's membership + +This endpoint returns all Policy members that are a member of this Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupMembersMembershipApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List the Policy Group's membership + api_response = api_instance.graph_policy_group_membership(group_id, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PolicyGroupMembersMembershipApi->graph_policy_group_membership: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PolicyGroupsApi.md b/jcapiv2/docs/PolicyGroupsApi.md new file mode 100644 index 0000000..2d0427e --- /dev/null +++ b/jcapiv2/docs/PolicyGroupsApi.md @@ -0,0 +1,733 @@ +# jcapiv2.PolicyGroupsApi + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**graph_policy_group_associations_list**](PolicyGroupsApi.md#graph_policy_group_associations_list) | **GET** /policygroups/{group_id}/associations | List the associations of a Policy Group. +[**graph_policy_group_associations_post**](PolicyGroupsApi.md#graph_policy_group_associations_post) | **POST** /policygroups/{group_id}/associations | Manage the associations of a Policy Group +[**graph_policy_group_members_list**](PolicyGroupsApi.md#graph_policy_group_members_list) | **GET** /policygroups/{group_id}/members | List the members of a Policy Group +[**graph_policy_group_members_post**](PolicyGroupsApi.md#graph_policy_group_members_post) | **POST** /policygroups/{group_id}/members | Manage the members of a Policy Group +[**graph_policy_group_membership**](PolicyGroupsApi.md#graph_policy_group_membership) | **GET** /policygroups/{group_id}/membership | List the Policy Group's membership +[**graph_policy_group_traverse_system**](PolicyGroupsApi.md#graph_policy_group_traverse_system) | **GET** /policygroups/{group_id}/systems | List the Systems bound to a Policy Group +[**graph_policy_group_traverse_system_group**](PolicyGroupsApi.md#graph_policy_group_traverse_system_group) | **GET** /policygroups/{group_id}/systemgroups | List the System Groups bound to Policy Groups +[**groups_policy_delete**](PolicyGroupsApi.md#groups_policy_delete) | **DELETE** /policygroups/{id} | Delete a Policy Group +[**groups_policy_get**](PolicyGroupsApi.md#groups_policy_get) | **GET** /policygroups/{id} | View an individual Policy Group details +[**groups_policy_list**](PolicyGroupsApi.md#groups_policy_list) | **GET** /policygroups | List all Policy Groups +[**groups_policy_post**](PolicyGroupsApi.md#groups_policy_post) | **POST** /policygroups | Create a new Policy Group +[**groups_policy_put**](PolicyGroupsApi.md#groups_policy_put) | **PUT** /policygroups/{id} | Update a Policy Group + +# **graph_policy_group_associations_list** +> list[GraphConnection] graph_policy_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) + +List the associations of a Policy Group. + +This endpoint returns the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupsApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +targets = ['targets_example'] # list[str] | Targets which a \"policy_group\" can be associated to. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List the associations of a Policy Group. + api_response = api_instance.graph_policy_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PolicyGroupsApi->graph_policy_group_associations_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **targets** | [**list[str]**](str.md)| Targets which a \"policy_group\" can be associated to. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**list[GraphConnection]**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_group_associations_post** +> graph_policy_group_associations_post(group_id, body=body, x_org_id=x_org_id) + +Manage the associations of a Policy Group + +This endpoint manages the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupsApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +body = jcapiv2.GraphOperationPolicyGroup() # GraphOperationPolicyGroup | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Manage the associations of a Policy Group + api_instance.graph_policy_group_associations_post(group_id, body=body, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling PolicyGroupsApi->graph_policy_group_associations_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **body** | [**GraphOperationPolicyGroup**](GraphOperationPolicyGroup.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_group_members_list** +> list[GraphConnection] graph_policy_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) + +List the members of a Policy Group + +This endpoint returns the Policy members of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupsApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List the members of a Policy Group + api_response = api_instance.graph_policy_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PolicyGroupsApi->graph_policy_group_members_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**list[GraphConnection]**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_group_members_post** +> graph_policy_group_members_post(group_id, body=body, x_org_id=x_org_id) + +Manage the members of a Policy Group + +This endpoint allows you to manage the Policy members of a Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"policy\", \"id\": \"{Policy_ID}\" }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupsApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +body = jcapiv2.GraphOperationPolicyGroupMember() # GraphOperationPolicyGroupMember | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Manage the members of a Policy Group + api_instance.graph_policy_group_members_post(group_id, body=body, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling PolicyGroupsApi->graph_policy_group_members_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **body** | [**GraphOperationPolicyGroupMember**](GraphOperationPolicyGroupMember.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_group_membership** +> list[GraphObjectWithPaths] graph_policy_group_membership(group_id, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + +List the Policy Group's membership + +This endpoint returns all Policy members that are a member of this Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupsApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List the Policy Group's membership + api_response = api_instance.graph_policy_group_membership(group_id, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PolicyGroupsApi->graph_policy_group_membership: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_group_traverse_system** +> list[GraphObjectWithPaths] graph_policy_group_traverse_system(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + +List the Systems bound to a Policy Group + +This endpoint will return all Systems bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupsApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) + +try: + # List the Systems bound to a Policy Group + api_response = api_instance.graph_policy_group_traverse_system(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + pprint(api_response) +except ApiException as e: + print("Exception when calling PolicyGroupsApi->graph_policy_group_traverse_system: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_policy_group_traverse_system_group** +> list[GraphObjectWithPaths] graph_policy_group_traverse_system_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + +List the System Groups bound to Policy Groups + +This endpoint will return all System Groups bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupsApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the Policy Group. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) + +try: + # List the System Groups bound to Policy Groups + api_response = api_instance.graph_policy_group_traverse_system_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + pprint(api_response) +except ApiException as e: + print("Exception when calling PolicyGroupsApi->graph_policy_group_traverse_system_group: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the Policy Group. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **groups_policy_delete** +> PolicyGroup groups_policy_delete(id, x_org_id=x_org_id) + +Delete a Policy Group + +This endpoint allows you to delete a Policy Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/policygroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupsApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | ObjectID of the Policy Group. +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Delete a Policy Group + api_response = api_instance.groups_policy_delete(id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PolicyGroupsApi->groups_policy_delete: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| ObjectID of the Policy Group. | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**PolicyGroup**](PolicyGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **groups_policy_get** +> PolicyGroup groups_policy_get(id, x_org_id=x_org_id) + +View an individual Policy Group details + +This endpoint returns the details of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupsApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | ObjectID of the Policy Group. +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # View an individual Policy Group details + api_response = api_instance.groups_policy_get(id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PolicyGroupsApi->groups_policy_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| ObjectID of the Policy Group. | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**PolicyGroup**](PolicyGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **groups_policy_list** +> list[PolicyGroup] groups_policy_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + +List all Policy Groups + +This endpoint returns all Policy Groups. Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupsApi(jcapiv2.ApiClient(configuration)) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List all Policy Groups + api_response = api_instance.groups_policy_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PolicyGroupsApi->groups_policy_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**list[PolicyGroup]**](PolicyGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **groups_policy_post** +> PolicyGroup groups_policy_post(body=body, x_org_id=x_org_id) + +Create a new Policy Group + +This endpoint allows you to create a new Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupsApi(jcapiv2.ApiClient(configuration)) +body = jcapiv2.PolicyGroupData() # PolicyGroupData | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Create a new Policy Group + api_response = api_instance.groups_policy_post(body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PolicyGroupsApi->groups_policy_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**PolicyGroupData**](PolicyGroupData.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**PolicyGroup**](PolicyGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **groups_policy_put** +> PolicyGroup groups_policy_put(id, body=body, x_org_id=x_org_id) + +Update a Policy Group + +This endpoint allows you to do a full update of the Policy Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/policygroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"group_update\" }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.PolicyGroupsApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | ObjectID of the Policy Group. +body = jcapiv2.PolicyGroupData() # PolicyGroupData | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Update a Policy Group + api_response = api_instance.groups_policy_put(id, body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PolicyGroupsApi->groups_policy_put: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| ObjectID of the Policy Group. | + **body** | [**PolicyGroupData**](PolicyGroupData.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**PolicyGroup**](PolicyGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PolicyRequest.md b/jcapiv2/docs/PolicyRequest.md index 1d59869..43b2769 100644 --- a/jcapiv2/docs/PolicyRequest.md +++ b/jcapiv2/docs/PolicyRequest.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/PolicyRequestTemplate.md b/jcapiv2/docs/PolicyRequestTemplate.md index cf6be66..2f9ac3a 100644 --- a/jcapiv2/docs/PolicyRequestTemplate.md +++ b/jcapiv2/docs/PolicyRequestTemplate.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/PolicyResult.md b/jcapiv2/docs/PolicyResult.md index ac18b5c..8557613 100644 --- a/jcapiv2/docs/PolicyResult.md +++ b/jcapiv2/docs/PolicyResult.md @@ -17,4 +17,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/PolicyTemplate.md b/jcapiv2/docs/PolicyTemplate.md index 8c9dde2..f127826 100644 --- a/jcapiv2/docs/PolicyTemplate.md +++ b/jcapiv2/docs/PolicyTemplate.md @@ -4,14 +4,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **activation** | **str** | Requirements before the policy can be activated. | [optional] +**alert** | **str** | Text to describe any risk associated with this policy. | [optional] **behavior** | **str** | Specifics about the behavior of the policy. | [optional] +**delivery_types** | **list[str]** | The supported delivery mechanisms for this policy template. | [optional] **description** | **str** | The default description for the Policy. | [optional] **display_name** | **str** | The default display name for the Policy. | [optional] **id** | **str** | ObjectId uniquely identifying a Policy Template. | [optional] **name** | **str** | The unique name for the Policy Template. | [optional] **os_meta_family** | **str** | | [optional] +**os_restrictions** | [**list[OSRestriction]**](OSRestriction.md) | | [optional] +**reference** | **str** | URL to visit for further information. | [optional] **state** | **str** | String describing the release status of the policy template. | [optional] [default to ''] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/PolicyTemplateConfigField.md b/jcapiv2/docs/PolicyTemplateConfigField.md index 9ac9753..3445a5f 100644 --- a/jcapiv2/docs/PolicyTemplateConfigField.md +++ b/jcapiv2/docs/PolicyTemplateConfigField.md @@ -3,6 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**default_value** | **str** | The default value for this field. | [optional] +**display_options** | **object** | The options that correspond to the display_type. | [optional] **display_type** | **str** | The default rendering for this field. | [optional] **id** | **str** | ObjectId uniquely identifying a Policy Template Configuration Field | **label** | **str** | The default label for this field. | [optional] @@ -10,8 +12,8 @@ Name | Type | Description | Notes **position** | **float** | The default position to render this field. | [optional] **read_only** | **bool** | If an admin is allowed to modify this field. | [optional] **required** | **bool** | If this field is required for this field. | [optional] +**sensitive** | **bool** | Defines if the policy template config field is sensitive or not. | [optional] **tooltip** | [**PolicyTemplateConfigFieldTooltip**](PolicyTemplateConfigFieldTooltip.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/PolicyTemplateConfigFieldTooltip.md b/jcapiv2/docs/PolicyTemplateConfigFieldTooltip.md index 11ac522..a1233c7 100644 --- a/jcapiv2/docs/PolicyTemplateConfigFieldTooltip.md +++ b/jcapiv2/docs/PolicyTemplateConfigFieldTooltip.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/PolicyTemplateConfigFieldTooltipVariables.md b/jcapiv2/docs/PolicyTemplateConfigFieldTooltipVariables.md index a30de28..75f6cad 100644 --- a/jcapiv2/docs/PolicyTemplateConfigFieldTooltipVariables.md +++ b/jcapiv2/docs/PolicyTemplateConfigFieldTooltipVariables.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/PolicyTemplateWithDetails.md b/jcapiv2/docs/PolicyTemplateWithDetails.md index 24c4815..997af59 100644 --- a/jcapiv2/docs/PolicyTemplateWithDetails.md +++ b/jcapiv2/docs/PolicyTemplateWithDetails.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **id** | **str** | ObjectId uniquely identifying a Policy Template. | [optional] **name** | **str** | The unique name for the Policy Template. | [optional] **os_meta_family** | **str** | | [optional] +**os_restrictions** | [**list[OSRestriction]**](OSRestriction.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/PolicyValue.md b/jcapiv2/docs/PolicyValue.md index b241893..8046c67 100644 --- a/jcapiv2/docs/PolicyValue.md +++ b/jcapiv2/docs/PolicyValue.md @@ -4,7 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **config_field_id** | **str** | The ObjectId of the corresponding Policy Template configuration field. | [optional] +**sensitive** | **bool** | Defines if the value is sensitive or not. | [optional] +**value** | **str** | The value for the configuration field for this Policy instance. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/PolicyWithDetails.md b/jcapiv2/docs/PolicyWithDetails.md index 43840da..f27af3d 100644 --- a/jcapiv2/docs/PolicyWithDetails.md +++ b/jcapiv2/docs/PolicyWithDetails.md @@ -11,4 +11,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/PolicytemplatesApi.md b/jcapiv2/docs/PolicytemplatesApi.md index 5ab0464..6511c3f 100644 --- a/jcapiv2/docs/PolicytemplatesApi.md +++ b/jcapiv2/docs/PolicytemplatesApi.md @@ -7,13 +7,12 @@ Method | HTTP request | Description [**policytemplates_get**](PolicytemplatesApi.md#policytemplates_get) | **GET** /policytemplates/{id} | Get a specific Policy Template [**policytemplates_list**](PolicytemplatesApi.md#policytemplates_list) | **GET** /policytemplates | Lists all of the Policy Templates - # **policytemplates_get** -> PolicyTemplateWithDetails policytemplates_get(id, content_type, accept, x_org_id=x_org_id) +> PolicyTemplateWithDetails policytemplates_get(id, x_org_id=x_org_id) Get a specific Policy Template -This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates/{Policy_Template_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -32,13 +31,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.PolicytemplatesApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | ObjectID of the Policy Template. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Get a specific Policy Template - api_response = api_instance.policytemplates_get(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.policytemplates_get(id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling PolicytemplatesApi->policytemplates_get: %s\n" % e) @@ -49,9 +46,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| ObjectID of the Policy Template. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -63,13 +58,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **policytemplates_list** -> list[PolicyTemplate] policytemplates_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +> list[PolicyTemplate] policytemplates_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) Lists all of the Policy Templates @@ -91,18 +86,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.PolicytemplatesApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Lists all of the Policy Templates - api_response = api_instance.policytemplates_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.policytemplates_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling PolicytemplatesApi->policytemplates_list: %s\n" % e) @@ -112,14 +105,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -131,7 +122,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/Provider.md b/jcapiv2/docs/Provider.md index 74c4c59..77d5264 100644 --- a/jcapiv2/docs/Provider.md +++ b/jcapiv2/docs/Provider.md @@ -3,9 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**contact** | [**ProviderContact**](ProviderContact.md) | | [optional] -**name** | **str** | | [optional] +**disallow_org_creation** | **bool** | | [optional] +**id** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/ProviderAdminReq.md b/jcapiv2/docs/ProviderAdminReq.md index b473469..7c3d524 100644 --- a/jcapiv2/docs/ProviderAdminReq.md +++ b/jcapiv2/docs/ProviderAdminReq.md @@ -3,11 +3,13 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**bind_no_orgs** | **bool** | | [optional] [default to False] **email** | **str** | | **enable_multi_factor** | **bool** | | [optional] **firstname** | **str** | | [optional] **lastname** | **str** | | [optional] +**role** | **str** | | [optional] +**role_name** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/ProviderInvoice.md b/jcapiv2/docs/ProviderInvoice.md new file mode 100644 index 0000000..75aeb37 --- /dev/null +++ b/jcapiv2/docs/ProviderInvoice.md @@ -0,0 +1,15 @@ +# ProviderInvoice + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount_billed** | **str** | | [optional] +**amount_paid** | **str** | | [optional] +**amount_remaining** | **str** | | [optional] +**currency** | **str** | | [optional] +**due_date** | **str** | | [optional] +**id** | **str** | | [optional] +**status** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ProviderInvoiceResponse.md b/jcapiv2/docs/ProviderInvoiceResponse.md new file mode 100644 index 0000000..dd21118 --- /dev/null +++ b/jcapiv2/docs/ProviderInvoiceResponse.md @@ -0,0 +1,10 @@ +# ProviderInvoiceResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**records** | [**list[ProviderInvoice]**](ProviderInvoice.md) | | [optional] +**total_count** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ProvidersApi.md b/jcapiv2/docs/ProvidersApi.md index 00634e6..33bd401 100644 --- a/jcapiv2/docs/ProvidersApi.md +++ b/jcapiv2/docs/ProvidersApi.md @@ -4,16 +4,2057 @@ All URIs are relative to *https://console.jumpcloud.com/api/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**autotask_create_configuration**](ProvidersApi.md#autotask_create_configuration) | **POST** /providers/{provider_id}/integrations/autotask | Creates a new Autotask integration for the provider +[**autotask_delete_configuration**](ProvidersApi.md#autotask_delete_configuration) | **DELETE** /integrations/autotask/{UUID} | Delete Autotask Integration +[**autotask_get_configuration**](ProvidersApi.md#autotask_get_configuration) | **GET** /integrations/autotask/{UUID} | Retrieve Autotask Integration Configuration +[**autotask_patch_mappings**](ProvidersApi.md#autotask_patch_mappings) | **PATCH** /integrations/autotask/{UUID}/mappings | Create, edit, and/or delete Autotask Mappings +[**autotask_patch_settings**](ProvidersApi.md#autotask_patch_settings) | **PATCH** /integrations/autotask/{UUID}/settings | Create, edit, and/or delete Autotask Integration settings +[**autotask_retrieve_all_alert_configuration_options**](ProvidersApi.md#autotask_retrieve_all_alert_configuration_options) | **GET** /providers/{provider_id}/integrations/autotask/alerts/configuration/options | Get all Autotask ticketing alert configuration options for a provider +[**autotask_retrieve_all_alert_configurations**](ProvidersApi.md#autotask_retrieve_all_alert_configurations) | **GET** /providers/{provider_id}/integrations/autotask/alerts/configuration | Get all Autotask ticketing alert configurations for a provider +[**autotask_retrieve_companies**](ProvidersApi.md#autotask_retrieve_companies) | **GET** /integrations/autotask/{UUID}/companies | Retrieve Autotask Companies +[**autotask_retrieve_company_types**](ProvidersApi.md#autotask_retrieve_company_types) | **GET** /integrations/autotask/{UUID}/companytypes | Retrieve Autotask Company Types +[**autotask_retrieve_contracts**](ProvidersApi.md#autotask_retrieve_contracts) | **GET** /integrations/autotask/{UUID}/contracts | Retrieve Autotask Contracts +[**autotask_retrieve_contracts_fields**](ProvidersApi.md#autotask_retrieve_contracts_fields) | **GET** /integrations/autotask/{UUID}/contracts/fields | Retrieve Autotask Contract Fields +[**autotask_retrieve_mappings**](ProvidersApi.md#autotask_retrieve_mappings) | **GET** /integrations/autotask/{UUID}/mappings | Retrieve Autotask mappings +[**autotask_retrieve_services**](ProvidersApi.md#autotask_retrieve_services) | **GET** /integrations/autotask/{UUID}/contracts/services | Retrieve Autotask Contract Services +[**autotask_retrieve_settings**](ProvidersApi.md#autotask_retrieve_settings) | **GET** /integrations/autotask/{UUID}/settings | Retrieve Autotask Integration settings +[**autotask_update_alert_configuration**](ProvidersApi.md#autotask_update_alert_configuration) | **PUT** /providers/{provider_id}/integrations/autotask/alerts/{alert_UUID}/configuration | Update an Autotask ticketing alert's configuration +[**autotask_update_configuration**](ProvidersApi.md#autotask_update_configuration) | **PATCH** /integrations/autotask/{UUID} | Update Autotask Integration configuration +[**connectwise_create_configuration**](ProvidersApi.md#connectwise_create_configuration) | **POST** /providers/{provider_id}/integrations/connectwise | Creates a new ConnectWise integration for the provider +[**connectwise_delete_configuration**](ProvidersApi.md#connectwise_delete_configuration) | **DELETE** /integrations/connectwise/{UUID} | Delete ConnectWise Integration +[**connectwise_get_configuration**](ProvidersApi.md#connectwise_get_configuration) | **GET** /integrations/connectwise/{UUID} | Retrieve ConnectWise Integration Configuration +[**connectwise_patch_mappings**](ProvidersApi.md#connectwise_patch_mappings) | **PATCH** /integrations/connectwise/{UUID}/mappings | Create, edit, and/or delete ConnectWise Mappings +[**connectwise_patch_settings**](ProvidersApi.md#connectwise_patch_settings) | **PATCH** /integrations/connectwise/{UUID}/settings | Create, edit, and/or delete ConnectWise Integration settings +[**connectwise_retrieve_additions**](ProvidersApi.md#connectwise_retrieve_additions) | **GET** /integrations/connectwise/{UUID}/agreements/{agreement_ID}/additions | Retrieve ConnectWise Additions +[**connectwise_retrieve_agreements**](ProvidersApi.md#connectwise_retrieve_agreements) | **GET** /integrations/connectwise/{UUID}/agreements | Retrieve ConnectWise Agreements +[**connectwise_retrieve_all_alert_configuration_options**](ProvidersApi.md#connectwise_retrieve_all_alert_configuration_options) | **GET** /providers/{provider_id}/integrations/connectwise/alerts/configuration/options | Get all ConnectWise ticketing alert configuration options for a provider +[**connectwise_retrieve_all_alert_configurations**](ProvidersApi.md#connectwise_retrieve_all_alert_configurations) | **GET** /providers/{provider_id}/integrations/connectwise/alerts/configuration | Get all ConnectWise ticketing alert configurations for a provider +[**connectwise_retrieve_companies**](ProvidersApi.md#connectwise_retrieve_companies) | **GET** /integrations/connectwise/{UUID}/companies | Retrieve ConnectWise Companies +[**connectwise_retrieve_company_types**](ProvidersApi.md#connectwise_retrieve_company_types) | **GET** /integrations/connectwise/{UUID}/companytypes | Retrieve ConnectWise Company Types +[**connectwise_retrieve_mappings**](ProvidersApi.md#connectwise_retrieve_mappings) | **GET** /integrations/connectwise/{UUID}/mappings | Retrieve ConnectWise mappings +[**connectwise_retrieve_settings**](ProvidersApi.md#connectwise_retrieve_settings) | **GET** /integrations/connectwise/{UUID}/settings | Retrieve ConnectWise Integration settings +[**connectwise_update_alert_configuration**](ProvidersApi.md#connectwise_update_alert_configuration) | **PUT** /providers/{provider_id}/integrations/connectwise/alerts/{alert_UUID}/configuration | Update a ConnectWise ticketing alert's configuration +[**connectwise_update_configuration**](ProvidersApi.md#connectwise_update_configuration) | **PATCH** /integrations/connectwise/{UUID} | Update ConnectWise Integration configuration +[**mtp_integration_retrieve_alerts**](ProvidersApi.md#mtp_integration_retrieve_alerts) | **GET** /providers/{provider_id}/integrations/ticketing/alerts | Get all ticketing alerts available for a provider's ticketing integration. +[**mtp_integration_retrieve_sync_errors**](ProvidersApi.md#mtp_integration_retrieve_sync_errors) | **GET** /integrations/{integration_type}/{UUID}/errors | Retrieve Recent Integration Sync Errors +[**provider_organizations_update_org**](ProvidersApi.md#provider_organizations_update_org) | **PUT** /providers/{provider_id}/organizations/{id} | Update Provider Organization +[**providers_get_provider**](ProvidersApi.md#providers_get_provider) | **GET** /providers/{provider_id} | Retrieve Provider [**providers_list_administrators**](ProvidersApi.md#providers_list_administrators) | **GET** /providers/{provider_id}/administrators | List Provider Administrators +[**providers_list_organizations**](ProvidersApi.md#providers_list_organizations) | **GET** /providers/{provider_id}/organizations | List Provider Organizations [**providers_post_admins**](ProvidersApi.md#providers_post_admins) | **POST** /providers/{provider_id}/administrators | Create a new Provider Administrator +[**providers_remove_administrator**](ProvidersApi.md#providers_remove_administrator) | **DELETE** /providers/{provider_id}/administrators/{id} | Delete Provider Administrator +[**providers_retrieve_integrations**](ProvidersApi.md#providers_retrieve_integrations) | **GET** /providers/{provider_id}/integrations | Retrieve Integrations for Provider +[**providers_retrieve_invoice**](ProvidersApi.md#providers_retrieve_invoice) | **GET** /providers/{provider_id}/invoices/{ID} | Download a provider's invoice. +[**providers_retrieve_invoices**](ProvidersApi.md#providers_retrieve_invoices) | **GET** /providers/{provider_id}/invoices | List a provider's invoices. +# **autotask_create_configuration** +> InlineResponse201 autotask_create_configuration(provider_id, body=body) + +Creates a new Autotask integration for the provider + +Creates a new Autotask integration for the provider. You must be associated with the provider to use this route. A 422 Unprocessable Entity response means the server failed to validate with Autotask. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +body = jcapiv2.AutotaskIntegrationReq() # AutotaskIntegrationReq | (optional) + +try: + # Creates a new Autotask integration for the provider + api_response = api_instance.autotask_create_configuration(provider_id, body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->autotask_create_configuration: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **body** | [**AutotaskIntegrationReq**](AutotaskIntegrationReq.md)| | [optional] + +### Return type + +[**InlineResponse201**](InlineResponse201.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **autotask_delete_configuration** +> autotask_delete_configuration(uuid) + +Delete Autotask Integration + +Removes a Autotask integration. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | + +try: + # Delete Autotask Integration + api_instance.autotask_delete_configuration(uuid) +except ApiException as e: + print("Exception when calling ProvidersApi->autotask_delete_configuration: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **autotask_get_configuration** +> AutotaskIntegration autotask_get_configuration(uuid) + +Retrieve Autotask Integration Configuration + +Retrieves configuration for given Autotask integration id. You must be associated to the provider the integration is tied to in order to use this api. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | + +try: + # Retrieve Autotask Integration Configuration + api_response = api_instance.autotask_get_configuration(uuid) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->autotask_get_configuration: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + +### Return type + +[**AutotaskIntegration**](AutotaskIntegration.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **autotask_patch_mappings** +> AutotaskMappingResponse autotask_patch_mappings(uuid, body=body) + +Create, edit, and/or delete Autotask Mappings + +Create, edit, and/or delete mappings between Jumpcloud organizations and Autotask companies/contracts/services. You must be associated to the same provider as the Autotask integration to use this api. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | +body = jcapiv2.AutotaskMappingRequest() # AutotaskMappingRequest | (optional) + +try: + # Create, edit, and/or delete Autotask Mappings + api_response = api_instance.autotask_patch_mappings(uuid, body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->autotask_patch_mappings: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + **body** | [**AutotaskMappingRequest**](AutotaskMappingRequest.md)| | [optional] + +### Return type + +[**AutotaskMappingResponse**](AutotaskMappingResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **autotask_patch_settings** +> AutotaskSettings autotask_patch_settings(uuid, body=body) + +Create, edit, and/or delete Autotask Integration settings + +Create, edit, and/or delete Autotask settings. You must be associated to the same provider as the Autotask integration to use this endpoint. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | +body = jcapiv2.AutotaskSettingsPatchReq() # AutotaskSettingsPatchReq | (optional) + +try: + # Create, edit, and/or delete Autotask Integration settings + api_response = api_instance.autotask_patch_settings(uuid, body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->autotask_patch_settings: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + **body** | [**AutotaskSettingsPatchReq**](AutotaskSettingsPatchReq.md)| | [optional] + +### Return type + +[**AutotaskSettings**](AutotaskSettings.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **autotask_retrieve_all_alert_configuration_options** +> AutotaskTicketingAlertConfigurationOptions autotask_retrieve_all_alert_configuration_options(provider_id) + +Get all Autotask ticketing alert configuration options for a provider + +Get all Autotask ticketing alert configuration options for a provider. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | + +try: + # Get all Autotask ticketing alert configuration options for a provider + api_response = api_instance.autotask_retrieve_all_alert_configuration_options(provider_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->autotask_retrieve_all_alert_configuration_options: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + +### Return type + +[**AutotaskTicketingAlertConfigurationOptions**](AutotaskTicketingAlertConfigurationOptions.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **autotask_retrieve_all_alert_configurations** +> AutotaskTicketingAlertConfigurationList autotask_retrieve_all_alert_configurations(provider_id) + +Get all Autotask ticketing alert configurations for a provider + +Get all Autotask ticketing alert configurations for a provider. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | + +try: + # Get all Autotask ticketing alert configurations for a provider + api_response = api_instance.autotask_retrieve_all_alert_configurations(provider_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->autotask_retrieve_all_alert_configurations: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + +### Return type + +[**AutotaskTicketingAlertConfigurationList**](AutotaskTicketingAlertConfigurationList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **autotask_retrieve_companies** +> AutotaskCompanyResp autotask_retrieve_companies(uuid, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + +Retrieve Autotask Companies + +Retrieves a list of Autotask companies for the given Autotask id. You must be associated to the same provider as the Autotask integration to use this endpoint. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) + +try: + # Retrieve Autotask Companies + api_response = api_instance.autotask_retrieve_companies(uuid, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->autotask_retrieve_companies: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + +### Return type + +[**AutotaskCompanyResp**](AutotaskCompanyResp.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **autotask_retrieve_company_types** +> AutotaskCompanyTypeResp autotask_retrieve_company_types(uuid) + +Retrieve Autotask Company Types + +Retrieves a list of user defined company types from Autotask for the given Autotask id. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | + +try: + # Retrieve Autotask Company Types + api_response = api_instance.autotask_retrieve_company_types(uuid) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->autotask_retrieve_company_types: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + +### Return type + +[**AutotaskCompanyTypeResp**](AutotaskCompanyTypeResp.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **autotask_retrieve_contracts** +> InlineResponse2003 autotask_retrieve_contracts(uuid, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + +Retrieve Autotask Contracts + +Retrieves a list of Autotask contracts for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) + +try: + # Retrieve Autotask Contracts + api_response = api_instance.autotask_retrieve_contracts(uuid, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->autotask_retrieve_contracts: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + +### Return type + +[**InlineResponse2003**](InlineResponse2003.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **autotask_retrieve_contracts_fields** +> InlineResponse2004 autotask_retrieve_contracts_fields(uuid) + +Retrieve Autotask Contract Fields + +Retrieves a list of Autotask contract fields for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | + +try: + # Retrieve Autotask Contract Fields + api_response = api_instance.autotask_retrieve_contracts_fields(uuid) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->autotask_retrieve_contracts_fields: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + +### Return type + +[**InlineResponse2004**](InlineResponse2004.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **autotask_retrieve_mappings** +> InlineResponse2006 autotask_retrieve_mappings(uuid, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + +Retrieve Autotask mappings + +Retrieves the list of mappings for this Autotask integration. You must be associated to the same provider as the Autotask integration to use this api. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) + +try: + # Retrieve Autotask mappings + api_response = api_instance.autotask_retrieve_mappings(uuid, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->autotask_retrieve_mappings: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + +### Return type + +[**InlineResponse2006**](InlineResponse2006.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **autotask_retrieve_services** +> InlineResponse2005 autotask_retrieve_services(uuid, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + +Retrieve Autotask Contract Services + +Retrieves a list of Autotask contract services for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) + +try: + # Retrieve Autotask Contract Services + api_response = api_instance.autotask_retrieve_services(uuid, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->autotask_retrieve_services: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + +### Return type + +[**InlineResponse2005**](InlineResponse2005.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **autotask_retrieve_settings** +> AutotaskSettings autotask_retrieve_settings(uuid) + +Retrieve Autotask Integration settings + +Retrieve the Autotask integration settings. You must be associated to the same provider as the Autotask integration to use this endpoint. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | + +try: + # Retrieve Autotask Integration settings + api_response = api_instance.autotask_retrieve_settings(uuid) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->autotask_retrieve_settings: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + +### Return type + +[**AutotaskSettings**](AutotaskSettings.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **autotask_update_alert_configuration** +> AutotaskTicketingAlertConfiguration autotask_update_alert_configuration(provider_id, alert_uuid, body=body) + +Update an Autotask ticketing alert's configuration + +Update an Autotask ticketing alert's configuration + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +alert_uuid = 'alert_uuid_example' # str | +body = jcapiv2.AutotaskTicketingAlertConfigurationRequest() # AutotaskTicketingAlertConfigurationRequest | (optional) + +try: + # Update an Autotask ticketing alert's configuration + api_response = api_instance.autotask_update_alert_configuration(provider_id, alert_uuid, body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->autotask_update_alert_configuration: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **alert_uuid** | **str**| | + **body** | [**AutotaskTicketingAlertConfigurationRequest**](AutotaskTicketingAlertConfigurationRequest.md)| | [optional] + +### Return type + +[**AutotaskTicketingAlertConfiguration**](AutotaskTicketingAlertConfiguration.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **autotask_update_configuration** +> AutotaskIntegration autotask_update_configuration(uuid, body=body) + +Update Autotask Integration configuration + +Update the Autotask integration configuration. A 422 Unprocessable Entity response means the server failed to validate with Autotask. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | +body = jcapiv2.AutotaskIntegrationPatchReq() # AutotaskIntegrationPatchReq | (optional) + +try: + # Update Autotask Integration configuration + api_response = api_instance.autotask_update_configuration(uuid, body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->autotask_update_configuration: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + **body** | [**AutotaskIntegrationPatchReq**](AutotaskIntegrationPatchReq.md)| | [optional] + +### Return type + +[**AutotaskIntegration**](AutotaskIntegration.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **connectwise_create_configuration** +> InlineResponse201 connectwise_create_configuration(provider_id, body=body) + +Creates a new ConnectWise integration for the provider + +Creates a new ConnectWise integration for the provider. You must be associated with the provider to use this route. A 422 Unprocessable Entity response means the server failed to validate with ConnectWise. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +body = jcapiv2.ConnectwiseIntegrationReq() # ConnectwiseIntegrationReq | (optional) + +try: + # Creates a new ConnectWise integration for the provider + api_response = api_instance.connectwise_create_configuration(provider_id, body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->connectwise_create_configuration: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **body** | [**ConnectwiseIntegrationReq**](ConnectwiseIntegrationReq.md)| | [optional] + +### Return type + +[**InlineResponse201**](InlineResponse201.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **connectwise_delete_configuration** +> connectwise_delete_configuration(uuid) + +Delete ConnectWise Integration + +Removes a ConnectWise integration. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | + +try: + # Delete ConnectWise Integration + api_instance.connectwise_delete_configuration(uuid) +except ApiException as e: + print("Exception when calling ProvidersApi->connectwise_delete_configuration: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **connectwise_get_configuration** +> ConnectwiseIntegration connectwise_get_configuration(uuid) + +Retrieve ConnectWise Integration Configuration + +Retrieves configuration for given ConnectWise integration id. You must be associated to the provider the integration is tied to in order to use this api. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | + +try: + # Retrieve ConnectWise Integration Configuration + api_response = api_instance.connectwise_get_configuration(uuid) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->connectwise_get_configuration: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + +### Return type + +[**ConnectwiseIntegration**](ConnectwiseIntegration.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **connectwise_patch_mappings** +> ConnectWiseMappingRequest connectwise_patch_mappings(uuid, body=body) + +Create, edit, and/or delete ConnectWise Mappings + +Create, edit, and/or delete mappings between Jumpcloud organizations and ConnectWise companies/agreements/additions. You must be associated to the same provider as the ConnectWise integration to use this api. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | +body = jcapiv2.ConnectWiseMappingRequest() # ConnectWiseMappingRequest | (optional) + +try: + # Create, edit, and/or delete ConnectWise Mappings + api_response = api_instance.connectwise_patch_mappings(uuid, body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->connectwise_patch_mappings: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + **body** | [**ConnectWiseMappingRequest**](ConnectWiseMappingRequest.md)| | [optional] + +### Return type + +[**ConnectWiseMappingRequest**](ConnectWiseMappingRequest.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **connectwise_patch_settings** +> ConnectWiseSettings connectwise_patch_settings(uuid, body=body) + +Create, edit, and/or delete ConnectWise Integration settings + +Create, edit, and/or delete ConnectWiseIntegration settings. You must be associated to the same provider as the ConnectWise integration to use this endpoint. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | +body = jcapiv2.ConnectWiseSettingsPatchReq() # ConnectWiseSettingsPatchReq | (optional) + +try: + # Create, edit, and/or delete ConnectWise Integration settings + api_response = api_instance.connectwise_patch_settings(uuid, body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->connectwise_patch_settings: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + **body** | [**ConnectWiseSettingsPatchReq**](ConnectWiseSettingsPatchReq.md)| | [optional] + +### Return type + +[**ConnectWiseSettings**](ConnectWiseSettings.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **connectwise_retrieve_additions** +> InlineResponse2008 connectwise_retrieve_additions(uuid, agreement_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + +Retrieve ConnectWise Additions + +Retrieves a list of ConnectWise additions for the given ConnectWise id and Agreement id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | +agreement_id = 'agreement_id_example' # str | +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) + +try: + # Retrieve ConnectWise Additions + api_response = api_instance.connectwise_retrieve_additions(uuid, agreement_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->connectwise_retrieve_additions: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + **agreement_id** | **str**| | + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + +### Return type + +[**InlineResponse2008**](InlineResponse2008.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **connectwise_retrieve_agreements** +> InlineResponse2007 connectwise_retrieve_agreements(uuid, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + +Retrieve ConnectWise Agreements + +Retrieves a list of ConnectWise agreements for the given ConnectWise id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) + +try: + # Retrieve ConnectWise Agreements + api_response = api_instance.connectwise_retrieve_agreements(uuid, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->connectwise_retrieve_agreements: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + +### Return type + +[**InlineResponse2007**](InlineResponse2007.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **connectwise_retrieve_all_alert_configuration_options** +> ConnectWiseTicketingAlertConfigurationOptions connectwise_retrieve_all_alert_configuration_options(provider_id) + +Get all ConnectWise ticketing alert configuration options for a provider + +Get all ConnectWise ticketing alert configuration options for a provider. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | + +try: + # Get all ConnectWise ticketing alert configuration options for a provider + api_response = api_instance.connectwise_retrieve_all_alert_configuration_options(provider_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->connectwise_retrieve_all_alert_configuration_options: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + +### Return type + +[**ConnectWiseTicketingAlertConfigurationOptions**](ConnectWiseTicketingAlertConfigurationOptions.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **connectwise_retrieve_all_alert_configurations** +> ConnectWiseTicketingAlertConfigurationList connectwise_retrieve_all_alert_configurations(provider_id) + +Get all ConnectWise ticketing alert configurations for a provider + +Get all ConnectWise ticketing alert configurations for a provider. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | + +try: + # Get all ConnectWise ticketing alert configurations for a provider + api_response = api_instance.connectwise_retrieve_all_alert_configurations(provider_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->connectwise_retrieve_all_alert_configurations: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + +### Return type + +[**ConnectWiseTicketingAlertConfigurationList**](ConnectWiseTicketingAlertConfigurationList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **connectwise_retrieve_companies** +> ConnectwiseCompanyResp connectwise_retrieve_companies(uuid, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + +Retrieve ConnectWise Companies + +Retrieves a list of ConnectWise companies for the given ConnectWise id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) + +try: + # Retrieve ConnectWise Companies + api_response = api_instance.connectwise_retrieve_companies(uuid, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->connectwise_retrieve_companies: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + +### Return type + +[**ConnectwiseCompanyResp**](ConnectwiseCompanyResp.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **connectwise_retrieve_company_types** +> ConnectwiseCompanyTypeResp connectwise_retrieve_company_types(uuid) + +Retrieve ConnectWise Company Types + +Retrieves a list of user defined company types from ConnectWise for the given ConnectWise id. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | + +try: + # Retrieve ConnectWise Company Types + api_response = api_instance.connectwise_retrieve_company_types(uuid) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->connectwise_retrieve_company_types: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + +### Return type + +[**ConnectwiseCompanyTypeResp**](ConnectwiseCompanyTypeResp.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **connectwise_retrieve_mappings** +> InlineResponse2009 connectwise_retrieve_mappings(uuid, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + +Retrieve ConnectWise mappings + +Retrieves the list of mappings for this ConnectWise integration. You must be associated to the same provider as the ConnectWise integration to use this api. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) + +try: + # Retrieve ConnectWise mappings + api_response = api_instance.connectwise_retrieve_mappings(uuid, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->connectwise_retrieve_mappings: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + +### Return type + +[**InlineResponse2009**](InlineResponse2009.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **connectwise_retrieve_settings** +> ConnectWiseSettings connectwise_retrieve_settings(uuid) + +Retrieve ConnectWise Integration settings + +Retrieve the ConnectWise integration settings. You must be associated to the same provider as the ConnectWise integration to use this endpoint. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | + +try: + # Retrieve ConnectWise Integration settings + api_response = api_instance.connectwise_retrieve_settings(uuid) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->connectwise_retrieve_settings: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + +### Return type + +[**ConnectWiseSettings**](ConnectWiseSettings.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **connectwise_update_alert_configuration** +> ConnectWiseTicketingAlertConfiguration connectwise_update_alert_configuration(provider_id, alert_uuid, body=body) + +Update a ConnectWise ticketing alert's configuration + +Update a ConnectWise ticketing alert's configuration. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +alert_uuid = 'alert_uuid_example' # str | +body = jcapiv2.ConnectWiseTicketingAlertConfigurationRequest() # ConnectWiseTicketingAlertConfigurationRequest | (optional) + +try: + # Update a ConnectWise ticketing alert's configuration + api_response = api_instance.connectwise_update_alert_configuration(provider_id, alert_uuid, body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->connectwise_update_alert_configuration: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **alert_uuid** | **str**| | + **body** | [**ConnectWiseTicketingAlertConfigurationRequest**](ConnectWiseTicketingAlertConfigurationRequest.md)| | [optional] + +### Return type + +[**ConnectWiseTicketingAlertConfiguration**](ConnectWiseTicketingAlertConfiguration.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **connectwise_update_configuration** +> ConnectwiseIntegration connectwise_update_configuration(uuid, body=body) + +Update ConnectWise Integration configuration + +Update the ConnectWise integration configuration. A 422 Unprocessable Entity response means the server failed to validate with ConnectWise. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | +body = jcapiv2.ConnectwiseIntegrationPatchReq() # ConnectwiseIntegrationPatchReq | (optional) + +try: + # Update ConnectWise Integration configuration + api_response = api_instance.connectwise_update_configuration(uuid, body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->connectwise_update_configuration: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + **body** | [**ConnectwiseIntegrationPatchReq**](ConnectwiseIntegrationPatchReq.md)| | [optional] + +### Return type + +[**ConnectwiseIntegration**](ConnectwiseIntegration.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **mtp_integration_retrieve_alerts** +> TicketingIntegrationAlertsResp mtp_integration_retrieve_alerts(provider_id) + +Get all ticketing alerts available for a provider's ticketing integration. + +Get all ticketing alerts available for a provider's ticketing integration. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | + +try: + # Get all ticketing alerts available for a provider's ticketing integration. + api_response = api_instance.mtp_integration_retrieve_alerts(provider_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->mtp_integration_retrieve_alerts: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + +### Return type + +[**TicketingIntegrationAlertsResp**](TicketingIntegrationAlertsResp.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **mtp_integration_retrieve_sync_errors** +> IntegrationSyncErrorResp mtp_integration_retrieve_sync_errors(uuid, integration_type) + +Retrieve Recent Integration Sync Errors + +Retrieves recent sync errors for given integration type and integration id. You must be associated to the provider the integration is tied to in order to use this api. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +uuid = 'uuid_example' # str | +integration_type = 'integration_type_example' # str | + +try: + # Retrieve Recent Integration Sync Errors + api_response = api_instance.mtp_integration_retrieve_sync_errors(uuid, integration_type) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->mtp_integration_retrieve_sync_errors: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **str**| | + **integration_type** | **str**| | + +### Return type + +[**IntegrationSyncErrorResp**](IntegrationSyncErrorResp.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **provider_organizations_update_org** +> Organization provider_organizations_update_org(provider_id, id, body=body) + +Update Provider Organization + +This endpoint updates a provider's organization + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +id = 'id_example' # str | +body = jcapiv2.Organization() # Organization | (optional) + +try: + # Update Provider Organization + api_response = api_instance.provider_organizations_update_org(provider_id, id, body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->provider_organizations_update_org: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **id** | **str**| | + **body** | [**Organization**](Organization.md)| | [optional] + +### Return type + +[**Organization**](Organization.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **providers_get_provider** +> Provider providers_get_provider(provider_id, fields=fields) + +Retrieve Provider + +This endpoint returns details about a provider + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) + +try: + # Retrieve Provider + api_response = api_instance.providers_get_provider(provider_id, fields=fields) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->providers_get_provider: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + +### Return type + +[**Provider**](Provider.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **providers_list_administrators** -> InlineResponse2001 providers_list_administrators(provider_id, content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) +> InlineResponse20012 providers_list_administrators(provider_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) List Provider Administrators -This endpoint returns a list of the Administrators associated with the Provider. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/providers/{ProviderID}/administrators \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint returns a list of the Administrators associated with the Provider. You must be associated with the provider to use this route. ### Example ```python @@ -32,17 +2073,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) provider_id = 'provider_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) try: # List Provider Administrators - api_response = api_instance.providers_list_administrators(provider_id, content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + api_response = api_instance.providers_list_administrators(provider_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) pprint(api_response) except ApiException as e: print("Exception when calling ProvidersApi->providers_list_administrators: %s\n" % e) @@ -53,17 +2092,15 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **provider_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] ### Return type -[**InlineResponse2001**](InlineResponse2001.md) +[**InlineResponse20012**](InlineResponse20012.md) ### Authorization @@ -71,17 +2108,81 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **providers_list_organizations** +> InlineResponse20013 providers_list_organizations(provider_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + +List Provider Organizations + +This endpoint returns a list of the Organizations associated with the Provider. You must be associated with the provider to use this route. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) + +try: + # List Provider Organizations + api_response = api_instance.providers_list_organizations(provider_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->providers_list_organizations: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + +### Return type + +[**InlineResponse20013**](InlineResponse20013.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **providers_post_admins** -> Administrator providers_post_admins(provider_id, content_type, accept, body=body) +> Administrator providers_post_admins(provider_id, body=body) Create a new Provider Administrator -This endpoint allows you to create a provider administrator. You must be associated to the provider to use this route. **Sample Request** ``` curl -X POST https://console.jumpcloud.com/api/v2/providers/{ProviderID}/administrators \\ -H 'Accept: application/json' \\ -H 'Context-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"email\":\"{ADMIN_EMAIL}\" }' ``` +This endpoint allows you to create a provider administrator. You must be associated with the provider to use this route. You must provide either `role` or `roleName`. ### Example ```python @@ -100,13 +2201,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) provider_id = 'provider_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv2.ProviderAdminReq() # ProviderAdminReq | (optional) try: # Create a new Provider Administrator - api_response = api_instance.providers_post_admins(provider_id, content_type, accept, body=body) + api_response = api_instance.providers_post_admins(provider_id, body=body) pprint(api_response) except ApiException as e: print("Exception when calling ProvidersApi->providers_post_admins: %s\n" % e) @@ -117,8 +2216,6 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **provider_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**ProviderAdminReq**](ProviderAdminReq.md)| | [optional] ### Return type @@ -136,3 +2233,236 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **providers_remove_administrator** +> providers_remove_administrator(provider_id, id) + +Delete Provider Administrator + +This endpoint removes an Administrator associated with the Provider. You must be associated with the provider to use this route. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +id = 'id_example' # str | + +try: + # Delete Provider Administrator + api_instance.providers_remove_administrator(provider_id, id) +except ApiException as e: + print("Exception when calling ProvidersApi->providers_remove_administrator: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **providers_retrieve_integrations** +> IntegrationsResponse providers_retrieve_integrations(provider_id, filter=filter, limit=limit, skip=skip, sort=sort) + +Retrieve Integrations for Provider + +Retrieves a list of integrations this provider has configured. You must be associated to the provider to use this endpoint. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) + +try: + # Retrieve Integrations for Provider + api_response = api_instance.providers_retrieve_integrations(provider_id, filter=filter, limit=limit, skip=skip, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->providers_retrieve_integrations: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + +### Return type + +[**IntegrationsResponse**](IntegrationsResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **providers_retrieve_invoice** +> str providers_retrieve_invoice(provider_id, id) + +Download a provider's invoice. + +Retrieves an invoice for this provider. You must be associated to the provider to use this endpoint. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +id = 'id_example' # str | + +try: + # Download a provider's invoice. + api_response = api_instance.providers_retrieve_invoice(provider_id, id) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->providers_retrieve_invoice: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **id** | **str**| | + +### Return type + +**str** + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/pdf + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **providers_retrieve_invoices** +> ProviderInvoiceResponse providers_retrieve_invoices(provider_id, skip=skip, sort=sort, limit=limit) + +List a provider's invoices. + +Retrieves a list of invoices for this provider. You must be associated to the provider to use this endpoint. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.ProvidersApi(jcapiv2.ApiClient(configuration)) +provider_id = 'provider_id_example' # str | +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) + +try: + # List a provider's invoices. + api_response = api_instance.providers_retrieve_invoices(provider_id, skip=skip, sort=sort, limit=limit) + pprint(api_response) +except ApiException as e: + print("Exception when calling ProvidersApi->providers_retrieve_invoices: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **provider_id** | **str**| | + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + +### Return type + +[**ProviderInvoiceResponse**](ProviderInvoiceResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PushEndpointResponse.md b/jcapiv2/docs/PushEndpointResponse.md new file mode 100644 index 0000000..0a8b4e2 --- /dev/null +++ b/jcapiv2/docs/PushEndpointResponse.md @@ -0,0 +1,14 @@ +# PushEndpointResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**device** | [**PushEndpointResponseDevice**](PushEndpointResponseDevice.md) | | [optional] +**enrollment_date** | **datetime** | | [optional] +**id** | **str** | | [optional] +**last_used_date** | **datetime** | | [optional] +**name** | **str** | | [optional] +**state** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PushEndpointResponseDevice.md b/jcapiv2/docs/PushEndpointResponseDevice.md new file mode 100644 index 0000000..6cc6e57 --- /dev/null +++ b/jcapiv2/docs/PushEndpointResponseDevice.md @@ -0,0 +1,14 @@ +# PushEndpointResponseDevice + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_version** | **str** | | [optional] +**make** | **str** | | [optional] +**model** | **str** | | [optional] +**os** | **str** | | [optional] +**os_version** | **str** | | [optional] +**uv_enabled** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PushendpointsPushEndpointIdBody.md b/jcapiv2/docs/PushendpointsPushEndpointIdBody.md new file mode 100644 index 0000000..bfe670d --- /dev/null +++ b/jcapiv2/docs/PushendpointsPushEndpointIdBody.md @@ -0,0 +1,10 @@ +# PushendpointsPushEndpointIdBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**state** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PwmAllUsers.md b/jcapiv2/docs/PwmAllUsers.md new file mode 100644 index 0000000..296e5ca --- /dev/null +++ b/jcapiv2/docs/PwmAllUsers.md @@ -0,0 +1,10 @@ +# PwmAllUsers + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**list[PwmAllUsersResults]**](PwmAllUsersResults.md) | | +**total_count** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PwmAllUsersGroups.md b/jcapiv2/docs/PwmAllUsersGroups.md new file mode 100644 index 0000000..fc983b8 --- /dev/null +++ b/jcapiv2/docs/PwmAllUsersGroups.md @@ -0,0 +1,10 @@ +# PwmAllUsersGroups + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**name** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PwmAllUsersResults.md b/jcapiv2/docs/PwmAllUsersResults.md new file mode 100644 index 0000000..6c7a2c3 --- /dev/null +++ b/jcapiv2/docs/PwmAllUsersResults.md @@ -0,0 +1,13 @@ +# PwmAllUsersResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **str** | | +**groups** | [**list[PwmAllUsersGroups]**](PwmAllUsersGroups.md) | | [optional] +**id** | **str** | | +**name** | **str** | | +**status** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PwmOverviewAppVersions.md b/jcapiv2/docs/PwmOverviewAppVersions.md new file mode 100644 index 0000000..14c3149 --- /dev/null +++ b/jcapiv2/docs/PwmOverviewAppVersions.md @@ -0,0 +1,10 @@ +# PwmOverviewAppVersions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**list[PwmOverviewAppVersionsResults]**](PwmOverviewAppVersionsResults.md) | | +**total_count** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PwmOverviewAppVersionsResults.md b/jcapiv2/docs/PwmOverviewAppVersionsResults.md new file mode 100644 index 0000000..75c88f9 --- /dev/null +++ b/jcapiv2/docs/PwmOverviewAppVersionsResults.md @@ -0,0 +1,10 @@ +# PwmOverviewAppVersionsResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**users_count** | **int** | | [optional] +**version** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PwmOverviewMain.md b/jcapiv2/docs/PwmOverviewMain.md new file mode 100644 index 0000000..43bb4c7 --- /dev/null +++ b/jcapiv2/docs/PwmOverviewMain.md @@ -0,0 +1,12 @@ +# PwmOverviewMain + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**devices** | [**list[PwmOverviewMainDevices]**](PwmOverviewMainDevices.md) | | +**pending_invites** | **int** | | +**shared_folders** | **int** | | +**total_users** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Body1.md b/jcapiv2/docs/PwmOverviewMainDevices.md similarity index 76% rename from jcapiv2/docs/Body1.md rename to jcapiv2/docs/PwmOverviewMainDevices.md index c4b01a8..39a57d6 100644 --- a/jcapiv2/docs/Body1.md +++ b/jcapiv2/docs/PwmOverviewMainDevices.md @@ -1,12 +1,11 @@ -# Body1 +# PwmOverviewMainDevices ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**groups** | **list[str]** | | [optional] +**count** | **int** | | [optional] +**id** | **int** | | [optional] **name** | **str** | | [optional] -**users** | **list[str]** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/Query.md b/jcapiv2/docs/Query.md new file mode 100644 index 0000000..4ad1a2a --- /dev/null +++ b/jcapiv2/docs/Query.md @@ -0,0 +1,9 @@ +# Query + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**query_type** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/QueuedCommandList.md b/jcapiv2/docs/QueuedCommandList.md new file mode 100644 index 0000000..9d18bf9 --- /dev/null +++ b/jcapiv2/docs/QueuedCommandList.md @@ -0,0 +1,10 @@ +# QueuedCommandList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**list[QueuedCommandListResults]**](QueuedCommandListResults.md) | | [optional] +**total_count** | **int** | The total number of queued command results. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/QueuedCommandListResults.md b/jcapiv2/docs/QueuedCommandListResults.md new file mode 100644 index 0000000..9170a45 --- /dev/null +++ b/jcapiv2/docs/QueuedCommandListResults.md @@ -0,0 +1,12 @@ +# QueuedCommandListResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**command** | **str** | The ID of the command, from savedAgentCommands. | [optional] +**id** | **str** | The workflowInstanceId. | [optional] +**pending_count** | **int** | The number of devices that still haven't received the directive. | [optional] +**system** | **str** | The ID of the device the command is bound to. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/RADIUSServersApi.md b/jcapiv2/docs/RADIUSServersApi.md index 335a842..4af3388 100644 --- a/jcapiv2/docs/RADIUSServersApi.md +++ b/jcapiv2/docs/RADIUSServersApi.md @@ -9,9 +9,8 @@ Method | HTTP request | Description [**graph_radius_server_traverse_user**](RADIUSServersApi.md#graph_radius_server_traverse_user) | **GET** /radiusservers/{radiusserver_id}/users | List the Users bound to a RADIUS Server [**graph_radius_server_traverse_user_group**](RADIUSServersApi.md#graph_radius_server_traverse_user_group) | **GET** /radiusservers/{radiusserver_id}/usergroups | List the User Groups bound to a RADIUS Server - # **graph_radius_server_associations_list** -> list[GraphConnection] graph_radius_server_associations_list(radiusserver_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_radius_server_associations_list(radiusserver_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of a RADIUS Server @@ -34,16 +33,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.RADIUSServersApi(jcapiv2.ApiClient(configuration)) radiusserver_id = 'radiusserver_id_example' # str | ObjectID of the Radius Server. -targets = ['targets_example'] # list[str] | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +targets = ['targets_example'] # list[str] | Targets which a \"radius_server\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of a RADIUS Server - api_response = api_instance.graph_radius_server_associations_list(radiusserver_id, targets, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_radius_server_associations_list(radiusserver_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling RADIUSServersApi->graph_radius_server_associations_list: %s\n" % e) @@ -54,12 +51,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **radiusserver_id** | **str**| ObjectID of the Radius Server. | - **targets** | [**list[str]**](str.md)| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] + **targets** | [**list[str]**](str.md)| Targets which a \"radius_server\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -71,13 +66,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_radius_server_associations_post** -> graph_radius_server_associations_post(radiusserver_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_radius_server_associations_post(radiusserver_id, body=body, x_org_id=x_org_id) Manage the associations of a RADIUS Server @@ -100,14 +95,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.RADIUSServersApi(jcapiv2.ApiClient(configuration)) radiusserver_id = 'radiusserver_id_example' # str | ObjectID of the Radius Server. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.GraphManagementReq() # GraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationRadiusServer() # GraphOperationRadiusServer | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of a RADIUS Server - api_instance.graph_radius_server_associations_post(radiusserver_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_radius_server_associations_post(radiusserver_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling RADIUSServersApi->graph_radius_server_associations_post: %s\n" % e) ``` @@ -117,10 +110,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **radiusserver_id** | **str**| ObjectID of the Radius Server. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationRadiusServer**](GraphOperationRadiusServer.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -133,12 +124,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_radius_server_traverse_user** -> list[GraphObjectWithPaths] graph_radius_server_traverse_user(radiusserver_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_radius_server_traverse_user(radiusserver_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Users bound to a RADIUS Server @@ -161,16 +152,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.RADIUSServersApi(jcapiv2.ApiClient(configuration)) radiusserver_id = 'radiusserver_id_example' # str | ObjectID of the Radius Server. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Users bound to a RADIUS Server - api_response = api_instance.graph_radius_server_traverse_user(radiusserver_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_radius_server_traverse_user(radiusserver_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling RADIUSServersApi->graph_radius_server_traverse_user: %s\n" % e) @@ -181,12 +170,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **radiusserver_id** | **str**| ObjectID of the Radius Server. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -198,13 +185,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_radius_server_traverse_user_group** -> list[GraphObjectWithPaths] graph_radius_server_traverse_user_group(radiusserver_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_radius_server_traverse_user_group(radiusserver_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the User Groups bound to a RADIUS Server @@ -227,16 +214,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.RADIUSServersApi(jcapiv2.ApiClient(configuration)) radiusserver_id = 'radiusserver_id_example' # str | ObjectID of the Radius Server. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the User Groups bound to a RADIUS Server - api_response = api_instance.graph_radius_server_traverse_user_group(radiusserver_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_radius_server_traverse_user_group(radiusserver_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling RADIUSServersApi->graph_radius_server_traverse_user_group: %s\n" % e) @@ -247,12 +232,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **radiusserver_id** | **str**| ObjectID of the Radius Server. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -264,7 +247,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/SCIMImportApi.md b/jcapiv2/docs/SCIMImportApi.md new file mode 100644 index 0000000..53a6677 --- /dev/null +++ b/jcapiv2/docs/SCIMImportApi.md @@ -0,0 +1,76 @@ +# jcapiv2.SCIMImportApi + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**import_users**](SCIMImportApi.md#import_users) | **GET** /applications/{application_id}/import/users | Get a list of users to import from an Application IdM service provider + +# **import_users** +> ImportUsersResponse import_users(application_id, filter=filter, query=query, sort=sort, sort_order=sort_order, x_org_id=x_org_id, limit=limit, skip=skip) + +Get a list of users to import from an Application IdM service provider + +Get a list of users to import from an Application IdM service provider. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SCIMImportApi(jcapiv2.ApiClient(configuration)) +application_id = 'application_id_example' # str | ObjectID of the Application. +filter = 'filter_example' # str | Filter users by a search term (optional) +query = 'query_example' # str | URL query to merge with the service provider request (optional) +sort = 'sort_example' # str | Sort users by supported fields (optional) +sort_order = 'asc' # str | (optional) (default to asc) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) + +try: + # Get a list of users to import from an Application IdM service provider + api_response = api_instance.import_users(application_id, filter=filter, query=query, sort=sort, sort_order=sort_order, x_org_id=x_org_id, limit=limit, skip=skip) + pprint(api_response) +except ApiException as e: + print("Exception when calling SCIMImportApi->import_users: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **application_id** | **str**| ObjectID of the Application. | + **filter** | **str**| Filter users by a search term | [optional] + **query** | **str**| URL query to merge with the service provider request | [optional] + **sort** | **str**| Sort users by supported fields | [optional] + **sort_order** | **str**| | [optional] [default to asc] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + +### Return type + +[**ImportUsersResponse**](ImportUsersResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SambaDomainInput.md b/jcapiv2/docs/SambaDomainInput.md index 429a9b9..586ff8c 100644 --- a/jcapiv2/docs/SambaDomainInput.md +++ b/jcapiv2/docs/SambaDomainInput.md @@ -3,9 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **str** | Name of this domain's WorkGroup | +**name** | **str** | Name of this domain's WorkGroup | **sid** | **str** | Security identifier of this domain | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SambaDomainOutput.md b/jcapiv2/docs/SambaDomainOutput.md index e2fa7c2..7a23ece 100644 --- a/jcapiv2/docs/SambaDomainOutput.md +++ b/jcapiv2/docs/SambaDomainOutput.md @@ -3,10 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **str** | Name of this domain's WorkGroup | +**name** | **str** | Name of this domain's WorkGroup | **sid** | **str** | Security identifier of this domain | -**id** | **str** | Unique identifier of this domain | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SambaDomainsApi.md b/jcapiv2/docs/SambaDomainsApi.md index 3b61bef..6cd2d8c 100644 --- a/jcapiv2/docs/SambaDomainsApi.md +++ b/jcapiv2/docs/SambaDomainsApi.md @@ -10,9 +10,8 @@ Method | HTTP request | Description [**ldapservers_samba_domains_post**](SambaDomainsApi.md#ldapservers_samba_domains_post) | **POST** /ldapservers/{ldapserver_id}/sambadomains | Create Samba Domain [**ldapservers_samba_domains_put**](SambaDomainsApi.md#ldapservers_samba_domains_put) | **PUT** /ldapservers/{ldapserver_id}/sambadomains/{id} | Update Samba Domain - # **ldapservers_samba_domains_delete** -> str ldapservers_samba_domains_delete(ldapserver_id, id, content_type=content_type, accept=accept, x_org_id=x_org_id) +> str ldapservers_samba_domains_delete(ldapserver_id, id, x_org_id=x_org_id) Delete Samba Domain @@ -36,13 +35,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' api_instance = jcapiv2.SambaDomainsApi(jcapiv2.ApiClient(configuration)) ldapserver_id = 'ldapserver_id_example' # str | Unique identifier of the LDAP server. id = 'id_example' # str | Unique identifier of the samba domain. -content_type = 'application/json' # str | (optional) (default to application/json) -accept = 'application/json' # str | (optional) (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Delete Samba Domain - api_response = api_instance.ldapservers_samba_domains_delete(ldapserver_id, id, content_type=content_type, accept=accept, x_org_id=x_org_id) + api_response = api_instance.ldapservers_samba_domains_delete(ldapserver_id, id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SambaDomainsApi->ldapservers_samba_domains_delete: %s\n" % e) @@ -54,9 +51,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ldapserver_id** | **str**| Unique identifier of the LDAP server. | **id** | **str**| Unique identifier of the samba domain. | - **content_type** | **str**| | [optional] [default to application/json] - **accept** | **str**| | [optional] [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -68,13 +63,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **ldapservers_samba_domains_get** -> SambaDomainOutput ldapservers_samba_domains_get(ldapserver_id, id, content_type=content_type, accept=accept, x_org_id=x_org_id) +> SambaDomainOutput ldapservers_samba_domains_get(ldapserver_id, id, x_org_id=x_org_id) Get Samba Domain @@ -98,13 +93,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' api_instance = jcapiv2.SambaDomainsApi(jcapiv2.ApiClient(configuration)) ldapserver_id = 'ldapserver_id_example' # str | Unique identifier of the LDAP server. id = 'id_example' # str | Unique identifier of the samba domain. -content_type = 'application/json' # str | (optional) (default to application/json) -accept = 'application/json' # str | (optional) (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Get Samba Domain - api_response = api_instance.ldapservers_samba_domains_get(ldapserver_id, id, content_type=content_type, accept=accept, x_org_id=x_org_id) + api_response = api_instance.ldapservers_samba_domains_get(ldapserver_id, id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SambaDomainsApi->ldapservers_samba_domains_get: %s\n" % e) @@ -116,9 +109,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ldapserver_id** | **str**| Unique identifier of the LDAP server. | **id** | **str**| Unique identifier of the samba domain. | - **content_type** | **str**| | [optional] [default to application/json] - **accept** | **str**| | [optional] [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -130,13 +121,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **ldapservers_samba_domains_list** -> list[SambaDomainOutput] ldapservers_samba_domains_list(ldapserver_id, content_type=content_type, accept=accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +> list[SambaDomainOutput] ldapservers_samba_domains_list(ldapserver_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) List Samba Domains @@ -159,18 +150,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SambaDomainsApi(jcapiv2.ApiClient(configuration)) ldapserver_id = 'ldapserver_id_example' # str | Unique identifier of the LDAP server. -content_type = 'application/json' # str | (optional) (default to application/json) -accept = 'application/json' # str | (optional) (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List Samba Domains - api_response = api_instance.ldapservers_samba_domains_list(ldapserver_id, content_type=content_type, accept=accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.ldapservers_samba_domains_list(ldapserver_id, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SambaDomainsApi->ldapservers_samba_domains_list: %s\n" % e) @@ -181,14 +170,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ldapserver_id** | **str**| Unique identifier of the LDAP server. | - **content_type** | **str**| | [optional] [default to application/json] - **accept** | **str**| | [optional] [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -200,17 +187,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **ldapservers_samba_domains_post** -> SambaDomainOutput ldapservers_samba_domains_post(ldapserver_id, body=body, content_type=content_type, accept=accept, x_org_id=x_org_id) +> SambaDomainOutput ldapservers_samba_domains_post(ldapserver_id, body=body, x_org_id=x_org_id) Create Samba Domain -This endpoint allows you to create a samba domain for an LDAP server. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` +This endpoint allows you to create a samba domain for an LDAP server. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` ### Example ```python @@ -230,13 +217,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' api_instance = jcapiv2.SambaDomainsApi(jcapiv2.ApiClient(configuration)) ldapserver_id = 'ldapserver_id_example' # str | Unique identifier of the LDAP server. body = jcapiv2.SambaDomainInput() # SambaDomainInput | (optional) -content_type = 'application/json' # str | (optional) (default to application/json) -accept = 'application/json' # str | (optional) (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Create Samba Domain - api_response = api_instance.ldapservers_samba_domains_post(ldapserver_id, body=body, content_type=content_type, accept=accept, x_org_id=x_org_id) + api_response = api_instance.ldapservers_samba_domains_post(ldapserver_id, body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SambaDomainsApi->ldapservers_samba_domains_post: %s\n" % e) @@ -248,9 +233,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ldapserver_id** | **str**| Unique identifier of the LDAP server. | **body** | [**SambaDomainInput**](SambaDomainInput.md)| | [optional] - **content_type** | **str**| | [optional] [default to application/json] - **accept** | **str**| | [optional] [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -268,11 +251,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **ldapservers_samba_domains_put** -> SambaDomainOutput ldapservers_samba_domains_put(ldapserver_id, id, body=body, content_type=content_type, accept=accept, x_org_id=x_org_id) +> SambaDomainOutput ldapservers_samba_domains_put(ldapserver_id, id, body=body) Update Samba Domain -This endpoint allows you to update the samba domain information for an LDAP server. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` +This endpoint allows you to update the samba domain information for an LDAP server. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` ### Example ```python @@ -293,13 +276,10 @@ api_instance = jcapiv2.SambaDomainsApi(jcapiv2.ApiClient(configuration)) ldapserver_id = 'ldapserver_id_example' # str | Unique identifier of the LDAP server. id = 'id_example' # str | Unique identifier of the samba domain. body = jcapiv2.SambaDomainInput() # SambaDomainInput | (optional) -content_type = 'application/json' # str | (optional) (default to application/json) -accept = 'application/json' # str | (optional) (default to application/json) -x_org_id = '' # str | (optional) (default to ) try: # Update Samba Domain - api_response = api_instance.ldapservers_samba_domains_put(ldapserver_id, id, body=body, content_type=content_type, accept=accept, x_org_id=x_org_id) + api_response = api_instance.ldapservers_samba_domains_put(ldapserver_id, id, body=body) pprint(api_response) except ApiException as e: print("Exception when calling SambaDomainsApi->ldapservers_samba_domains_put: %s\n" % e) @@ -312,9 +292,6 @@ Name | Type | Description | Notes **ldapserver_id** | **str**| Unique identifier of the LDAP server. | **id** | **str**| Unique identifier of the samba domain. | **body** | [**SambaDomainInput**](SambaDomainInput.md)| | [optional] - **content_type** | **str**| | [optional] [default to application/json] - **accept** | **str**| | [optional] [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] ### Return type diff --git a/jcapiv2/docs/ScheduledUserstateResult.md b/jcapiv2/docs/ScheduledUserstateResult.md new file mode 100644 index 0000000..371228a --- /dev/null +++ b/jcapiv2/docs/ScheduledUserstateResult.md @@ -0,0 +1,12 @@ +# ScheduledUserstateResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**scheduled_date** | **str** | | [optional] +**scheduled_job_id** | **str** | | [optional] +**state** | **str** | | [optional] +**system_user_id** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SetupAssistantOption.md b/jcapiv2/docs/SetupAssistantOption.md new file mode 100644 index 0000000..0990a24 --- /dev/null +++ b/jcapiv2/docs/SetupAssistantOption.md @@ -0,0 +1,8 @@ +# SetupAssistantOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SharedFolderAccessLevels.md b/jcapiv2/docs/SharedFolderAccessLevels.md new file mode 100644 index 0000000..6377041 --- /dev/null +++ b/jcapiv2/docs/SharedFolderAccessLevels.md @@ -0,0 +1,9 @@ +# SharedFolderAccessLevels + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**list[SharedFolderAccessLevelsResults]**](SharedFolderAccessLevelsResults.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SharedFolderAccessLevelsResults.md b/jcapiv2/docs/SharedFolderAccessLevelsResults.md new file mode 100644 index 0000000..c1b73c1 --- /dev/null +++ b/jcapiv2/docs/SharedFolderAccessLevelsResults.md @@ -0,0 +1,11 @@ +# SharedFolderAccessLevelsResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**id** | **str** | | +**name** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SharedFolderDetails.md b/jcapiv2/docs/SharedFolderDetails.md new file mode 100644 index 0000000..0adf7ed --- /dev/null +++ b/jcapiv2/docs/SharedFolderDetails.md @@ -0,0 +1,13 @@ +# SharedFolderDetails + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **str** | | +**items_in_folder** | **int** | | +**name** | **str** | | +**users_with_access** | **int** | | +**uuid** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SharedFolderUsers.md b/jcapiv2/docs/SharedFolderUsers.md new file mode 100644 index 0000000..6d81dde --- /dev/null +++ b/jcapiv2/docs/SharedFolderUsers.md @@ -0,0 +1,10 @@ +# SharedFolderUsers + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**list[SharedFolderUsersResults]**](SharedFolderUsersResults.md) | | +**total_count** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SharedFolderUsersResults.md b/jcapiv2/docs/SharedFolderUsersResults.md new file mode 100644 index 0000000..53a833f --- /dev/null +++ b/jcapiv2/docs/SharedFolderUsersResults.md @@ -0,0 +1,14 @@ +# SharedFolderUsersResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**access_level_id** | **str** | | +**access_level_name** | **str** | | +**email** | **str** | | +**id** | **str** | | +**name** | **str** | | +**status** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SharedFoldersList.md b/jcapiv2/docs/SharedFoldersList.md new file mode 100644 index 0000000..7665d48 --- /dev/null +++ b/jcapiv2/docs/SharedFoldersList.md @@ -0,0 +1,10 @@ +# SharedFoldersList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**list[SharedFoldersListResults]**](SharedFoldersListResults.md) | | +**total_count** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SharedFoldersListResults.md b/jcapiv2/docs/SharedFoldersListResults.md new file mode 100644 index 0000000..d462267 --- /dev/null +++ b/jcapiv2/docs/SharedFoldersListResults.md @@ -0,0 +1,13 @@ +# SharedFoldersListResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **str** | | +**items_in_folder** | **int** | | +**name** | **str** | | +**users_with_access** | **int** | | +**uuid** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SalesforceknowledgelistoutputInner.md b/jcapiv2/docs/SoftwareApp.md similarity index 67% rename from jcapiv2/docs/SalesforceknowledgelistoutputInner.md rename to jcapiv2/docs/SoftwareApp.md index a02febb..fe7aff2 100644 --- a/jcapiv2/docs/SalesforceknowledgelistoutputInner.md +++ b/jcapiv2/docs/SoftwareApp.md @@ -1,10 +1,11 @@ -# SalesforceknowledgelistoutputInner +# SoftwareApp ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**display_name** | **str** | | [optional] **id** | **str** | | [optional] +**settings** | [**list[SoftwareAppSettings]**](SoftwareAppSettings.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SoftwareAppAppleVpp.md b/jcapiv2/docs/SoftwareAppAppleVpp.md new file mode 100644 index 0000000..649509d --- /dev/null +++ b/jcapiv2/docs/SoftwareAppAppleVpp.md @@ -0,0 +1,15 @@ +# SoftwareAppAppleVpp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_configuration** | **str** | Text sent to configure the application, the text should be a valid plist. Returned only by 'GET /softwareapps/{id}'. | [optional] +**assigned_licenses** | **int** | | [optional] +**available_licenses** | **int** | | [optional] +**details** | **object** | App details returned by iTunes API. See example. The properties in this field are out of our control and we cannot guarantee consistency, so it should be checked by the client and manage the details accordingly. | [optional] +**is_config_enabled** | **bool** | Denotes if configuration has been enabled for the application. Returned only by ''GET /softwareapps/{id}''. | [optional] +**supported_device_families** | **list[str]** | The supported device families for this VPP Application. | [optional] +**total_licenses** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SoftwareAppReclaimLicenses.md b/jcapiv2/docs/SoftwareAppReclaimLicenses.md new file mode 100644 index 0000000..689ff8a --- /dev/null +++ b/jcapiv2/docs/SoftwareAppReclaimLicenses.md @@ -0,0 +1,12 @@ +# SoftwareAppReclaimLicenses + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assigned_licenses** | **int** | | [optional] +**available_licenses** | **int** | | [optional] +**reclaimed_licenses** | **int** | | [optional] +**total_licenses** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SoftwareAppSettings.md b/jcapiv2/docs/SoftwareAppSettings.md new file mode 100644 index 0000000..02beed2 --- /dev/null +++ b/jcapiv2/docs/SoftwareAppSettings.md @@ -0,0 +1,23 @@ +# SoftwareAppSettings + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allow_update_delay** | **bool** | | [optional] [default to False] +**apple_vpp** | [**SoftwareAppAppleVpp**](SoftwareAppAppleVpp.md) | | [optional] +**asset_kind** | **str** | The manifest asset kind (ex: software). | [optional] +**asset_sha256_size** | **int** | The incremental size to use for summing the package as it is downloaded. | [optional] +**asset_sha256_strings** | **list[str]** | The array of checksums, one each for the hash size up to the total size of the package. | [optional] +**auto_update** | **bool** | | [optional] [default to False] +**description** | **str** | The software app description. | [optional] +**desired_state** | **str** | State of Install or Uninstall | [optional] +**location** | **str** | Repository where the app is located within the package manager | [optional] +**location_object_id** | **str** | ID of the repository where the app is located within the package manager | [optional] +**package_id** | **str** | | [optional] +**package_kind** | **str** | The package manifest kind (ex: software-package). | [optional] +**package_manager** | **str** | App store serving the app: APPLE_VPP, CHOCOLATEY, etc. | [optional] +**package_subtitle** | **str** | The package manifest subtitle. | [optional] +**package_version** | **str** | The package manifest version. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SoftwareAppStatus.md b/jcapiv2/docs/SoftwareAppStatus.md new file mode 100644 index 0000000..e6cfbd3 --- /dev/null +++ b/jcapiv2/docs/SoftwareAppStatus.md @@ -0,0 +1,16 @@ +# SoftwareAppStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**details** | **str** | | [optional] +**id** | **str** | | [optional] +**software_app_id** | **str** | | [optional] +**state** | **str** | | [optional] +**system_id** | **str** | | [optional] +**timestamp** | **str** | | [optional] +**version** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SoftwareAppWithStatus.md b/jcapiv2/docs/SoftwareAppWithStatus.md new file mode 100644 index 0000000..6a51cd6 --- /dev/null +++ b/jcapiv2/docs/SoftwareAppWithStatus.md @@ -0,0 +1,10 @@ +# SoftwareAppWithStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app** | [**SoftwareApp**](SoftwareApp.md) | | [optional] +**status** | [**SoftwareAppStatus**](SoftwareAppStatus.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SoftwareAppsApi.md b/jcapiv2/docs/SoftwareAppsApi.md new file mode 100644 index 0000000..c68019f --- /dev/null +++ b/jcapiv2/docs/SoftwareAppsApi.md @@ -0,0 +1,722 @@ +# jcapiv2.SoftwareAppsApi + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**graph_softwareapps_associations_list**](SoftwareAppsApi.md#graph_softwareapps_associations_list) | **GET** /softwareapps/{software_app_id}/associations | List the associations of a Software Application +[**graph_softwareapps_associations_post**](SoftwareAppsApi.md#graph_softwareapps_associations_post) | **POST** /softwareapps/{software_app_id}/associations | Manage the associations of a software application. +[**graph_softwareapps_traverse_system**](SoftwareAppsApi.md#graph_softwareapps_traverse_system) | **GET** /softwareapps/{software_app_id}/systems | List the Systems bound to a Software App. +[**graph_softwareapps_traverse_system_group**](SoftwareAppsApi.md#graph_softwareapps_traverse_system_group) | **GET** /softwareapps/{software_app_id}/systemgroups | List the System Groups bound to a Software App. +[**software_app_statuses_list**](SoftwareAppsApi.md#software_app_statuses_list) | **GET** /softwareapps/{software_app_id}/statuses | Get the status of the provided Software Application +[**software_apps_delete**](SoftwareAppsApi.md#software_apps_delete) | **DELETE** /softwareapps/{id} | Delete a configured Software Application +[**software_apps_get**](SoftwareAppsApi.md#software_apps_get) | **GET** /softwareapps/{id} | Retrieve a configured Software Application. +[**software_apps_list**](SoftwareAppsApi.md#software_apps_list) | **GET** /softwareapps | Get all configured Software Applications. +[**software_apps_post**](SoftwareAppsApi.md#software_apps_post) | **POST** /softwareapps | Create a Software Application that will be managed by JumpCloud. +[**software_apps_reclaim_licenses**](SoftwareAppsApi.md#software_apps_reclaim_licenses) | **POST** /softwareapps/{software_app_id}/reclaim-licenses | Reclaim Licenses for a Software Application. +[**software_apps_retry_installation**](SoftwareAppsApi.md#software_apps_retry_installation) | **POST** /softwareapps/{software_app_id}/retry-installation | Retry Installation for a Software Application +[**software_apps_update**](SoftwareAppsApi.md#software_apps_update) | **PUT** /softwareapps/{id} | Update a Software Application Configuration. + +# **graph_softwareapps_associations_list** +> list[GraphConnection] graph_softwareapps_associations_list(software_app_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) + +List the associations of a Software Application + +This endpoint will return the _direct_ associations of a Software Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Software Application and System Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SoftwareAppsApi(jcapiv2.ApiClient(configuration)) +software_app_id = 'software_app_id_example' # str | ObjectID of the Software App. +targets = ['targets_example'] # list[str] | Targets which a \"software_app\" can be associated to. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List the associations of a Software Application + api_response = api_instance.graph_softwareapps_associations_list(software_app_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling SoftwareAppsApi->graph_softwareapps_associations_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **software_app_id** | **str**| ObjectID of the Software App. | + **targets** | [**list[str]**](str.md)| Targets which a \"software_app\" can be associated to. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**list[GraphConnection]**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_softwareapps_associations_post** +> graph_softwareapps_associations_post(software_app_id, body=body, x_org_id=x_org_id) + +Manage the associations of a software application. + +This endpoint allows you to associate or disassociate a software application to a system or system group. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"id\": \"\", \"op\": \"add\", \"type\": \"system\" }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SoftwareAppsApi(jcapiv2.ApiClient(configuration)) +software_app_id = 'software_app_id_example' # str | ObjectID of the Software App. +body = jcapiv2.GraphOperationSoftwareApp() # GraphOperationSoftwareApp | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Manage the associations of a software application. + api_instance.graph_softwareapps_associations_post(software_app_id, body=body, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling SoftwareAppsApi->graph_softwareapps_associations_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **software_app_id** | **str**| ObjectID of the Software App. | + **body** | [**GraphOperationSoftwareApp**](GraphOperationSoftwareApp.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_softwareapps_traverse_system** +> list[GraphObjectWithPaths] graph_softwareapps_traverse_system(software_app_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + +List the Systems bound to a Software App. + +This endpoint will return all Systems bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SoftwareAppsApi(jcapiv2.ApiClient(configuration)) +software_app_id = 'software_app_id_example' # str | ObjectID of the Software App. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) + +try: + # List the Systems bound to a Software App. + api_response = api_instance.graph_softwareapps_traverse_system(software_app_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + pprint(api_response) +except ApiException as e: + print("Exception when calling SoftwareAppsApi->graph_softwareapps_traverse_system: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **software_app_id** | **str**| ObjectID of the Software App. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_softwareapps_traverse_system_group** +> list[GraphObjectWithPaths] graph_softwareapps_traverse_system_group(software_app_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + +List the System Groups bound to a Software App. + +This endpoint will return all Systems Groups bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SoftwareAppsApi(jcapiv2.ApiClient(configuration)) +software_app_id = 'software_app_id_example' # str | ObjectID of the Software App. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) + +try: + # List the System Groups bound to a Software App. + api_response = api_instance.graph_softwareapps_traverse_system_group(software_app_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + pprint(api_response) +except ApiException as e: + print("Exception when calling SoftwareAppsApi->graph_softwareapps_traverse_system_group: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **software_app_id** | **str**| ObjectID of the Software App. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **software_app_statuses_list** +> list[SoftwareAppStatus] software_app_statuses_list(software_app_id, x_org_id=x_org_id, filter=filter, limit=limit, skip=skip, sort=sort) + +Get the status of the provided Software Application + +This endpoint allows you to get the status of the provided Software Application on associated JumpCloud systems. #### Sample Request ``` $ curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/statuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SoftwareAppsApi(jcapiv2.ApiClient(configuration)) +software_app_id = 'software_app_id_example' # str | ObjectID of the Software App. +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) + +try: + # Get the status of the provided Software Application + api_response = api_instance.software_app_statuses_list(software_app_id, x_org_id=x_org_id, filter=filter, limit=limit, skip=skip, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling SoftwareAppsApi->software_app_statuses_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **software_app_id** | **str**| ObjectID of the Software App. | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + +### Return type + +[**list[SoftwareAppStatus]**](SoftwareAppStatus.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **software_apps_delete** +> software_apps_delete(id, x_org_id=x_org_id) + +Delete a configured Software Application + +Removes a Software Application configuration. Warning: This is a destructive operation and will unmanage the application on all affected systems. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SoftwareAppsApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Delete a configured Software Application + api_instance.software_apps_delete(id, x_org_id=x_org_id) +except ApiException as e: + print("Exception when calling SoftwareAppsApi->software_apps_delete: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **software_apps_get** +> SoftwareApp software_apps_get(id, x_org_id=x_org_id) + +Retrieve a configured Software Application. + +Retrieves a Software Application. The optional isConfigEnabled and appConfiguration apple_vpp attributes are populated in this response. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SoftwareAppsApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Retrieve a configured Software Application. + api_response = api_instance.software_apps_get(id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling SoftwareAppsApi->software_apps_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**SoftwareApp**](SoftwareApp.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **software_apps_list** +> list[SoftwareApp] software_apps_list(x_org_id=x_org_id, filter=filter, limit=limit, skip=skip, sort=sort) + +Get all configured Software Applications. + +This endpoint allows you to get all configured Software Applications that will be managed by JumpCloud on associated JumpCloud systems. The optional isConfigEnabled and appConfiguration apple_vpp attributes are not included in the response. #### Sample Request ``` $ curl -X GET https://console.jumpcloud.com/api/v2/softwareapps \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SoftwareAppsApi(jcapiv2.ApiClient(configuration)) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) + +try: + # Get all configured Software Applications. + api_response = api_instance.software_apps_list(x_org_id=x_org_id, filter=filter, limit=limit, skip=skip, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling SoftwareAppsApi->software_apps_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + +### Return type + +[**list[SoftwareApp]**](SoftwareApp.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **software_apps_post** +> SoftwareApp software_apps_post(body=body, x_org_id=x_org_id) + +Create a Software Application that will be managed by JumpCloud. + +This endpoint allows you to create a Software Application that will be managed by JumpCloud on associated JumpCloud systems. The optional isConfigEnabled and appConfiguration apple_vpp attributes are not included in the response. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\": \"Adobe Reader\", \"settings\": [{\"packageId\": \"adobereader\"}] }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SoftwareAppsApi(jcapiv2.ApiClient(configuration)) +body = jcapiv2.SoftwareApp() # SoftwareApp | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Create a Software Application that will be managed by JumpCloud. + api_response = api_instance.software_apps_post(body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling SoftwareAppsApi->software_apps_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**SoftwareApp**](SoftwareApp.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**SoftwareApp**](SoftwareApp.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **software_apps_reclaim_licenses** +> SoftwareAppReclaimLicenses software_apps_reclaim_licenses(software_app_id) + +Reclaim Licenses for a Software Application. + +This endpoint allows you to reclaim the licenses from a software app associated with devices that are deleted. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/reclaim-licenses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SoftwareAppsApi(jcapiv2.ApiClient(configuration)) +software_app_id = 'software_app_id_example' # str | + +try: + # Reclaim Licenses for a Software Application. + api_response = api_instance.software_apps_reclaim_licenses(software_app_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling SoftwareAppsApi->software_apps_reclaim_licenses: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **software_app_id** | **str**| | + +### Return type + +[**SoftwareAppReclaimLicenses**](SoftwareAppReclaimLicenses.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **software_apps_retry_installation** +> software_apps_retry_installation(body, software_app_id) + +Retry Installation for a Software Application + +This endpoints initiates an installation retry of an Apple VPP App for the provided system IDs #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/retry-installation \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"system_ids\": \"{, , ...}\"}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SoftwareAppsApi(jcapiv2.ApiClient(configuration)) +body = jcapiv2.SoftwareAppsRetryInstallationRequest() # SoftwareAppsRetryInstallationRequest | +software_app_id = 'software_app_id_example' # str | + +try: + # Retry Installation for a Software Application + api_instance.software_apps_retry_installation(body, software_app_id) +except ApiException as e: + print("Exception when calling SoftwareAppsApi->software_apps_retry_installation: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**SoftwareAppsRetryInstallationRequest**](SoftwareAppsRetryInstallationRequest.md)| | + **software_app_id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **software_apps_update** +> SoftwareApp software_apps_update(id, body=body, x_org_id=x_org_id) + +Update a Software Application Configuration. + +This endpoint updates a specific Software Application configuration for the organization. displayName can be changed alone if no settings are provided. If a setting is provided, it should include all its information since this endpoint will update all the settings' fields. The optional isConfigEnabled and appConfiguration apple_vpp attributes are not included in the response. #### Sample Request - displayName only ``` curl -X PUT https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\": \"My Software App\" }' ``` #### Sample Request - all attributes ``` curl -X PUT https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\": \"My Software App\", \"settings\": [ { \"packageId\": \"123456\", \"autoUpdate\": false, \"allowUpdateDelay\": false, \"packageManager\": \"APPLE_VPP\", \"locationObjectId\": \"123456789012123456789012\", \"location\": \"123456\", \"desiredState\": \"Install\", \"appleVpp\": { \"appConfiguration\": \"MyKeyMy String\", \"assignedLicenses\": 20, \"availableLicenses\": 10, \"details\": {}, \"isConfigEnabled\": true, \"supportedDeviceFamilies\": [ \"IPAD\", \"MAC\" ], \"totalLicenses\": 30 }, \"packageSubtitle\": \"My package subtitle\", \"packageVersion\": \"1.2.3\", \"packageKind\": \"software-package\", \"assetKind\": \"software\", \"assetSha256Size\": 256, \"assetSha256Strings\": [ \"a123b123c123d123\" ], \"description\": \"My app description\" } ] }' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SoftwareAppsApi(jcapiv2.ApiClient(configuration)) +id = 'id_example' # str | +body = jcapiv2.SoftwareApp() # SoftwareApp | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Update a Software Application Configuration. + api_response = api_instance.software_apps_update(id, body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling SoftwareAppsApi->software_apps_update: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **body** | [**SoftwareApp**](SoftwareApp.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**SoftwareApp**](SoftwareApp.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SoftwareAppsRetryInstallationRequest.md b/jcapiv2/docs/SoftwareAppsRetryInstallationRequest.md new file mode 100644 index 0000000..d0dd722 --- /dev/null +++ b/jcapiv2/docs/SoftwareAppsRetryInstallationRequest.md @@ -0,0 +1,9 @@ +# SoftwareAppsRetryInstallationRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**system_ids** | **list[str]** | An array of system IDs to retry the software application installation. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Sshkeylist.md b/jcapiv2/docs/Sshkeylist.md deleted file mode 100644 index 94ed3d6..0000000 --- a/jcapiv2/docs/Sshkeylist.md +++ /dev/null @@ -1,13 +0,0 @@ -# Sshkeylist - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | The ID of the SSH key. | [optional] -**create_date** | **str** | The date the SSH key was created. | [optional] -**name** | **str** | The name of the SSH key. | [optional] -**public_key** | **str** | The Public SSH key. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv2/docs/Subscription.md b/jcapiv2/docs/Subscription.md new file mode 100644 index 0000000..688933e --- /dev/null +++ b/jcapiv2/docs/Subscription.md @@ -0,0 +1,13 @@ +# Subscription + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**annual_price** | **float** | The annual (discounted) price of this subscription. | +**display_name** | **str** | The display name of this subscription. | +**features** | [**list[Feature]**](Feature.md) | Array of the features included in the subscription. | +**list_price** | **float** | The list price of this subscription. | +**product_code** | **str** | Unique identifier corresponding to this subscription. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SubscriptionsApi.md b/jcapiv2/docs/SubscriptionsApi.md new file mode 100644 index 0000000..7bb8c2c --- /dev/null +++ b/jcapiv2/docs/SubscriptionsApi.md @@ -0,0 +1,52 @@ +# jcapiv2.SubscriptionsApi + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**subscriptions_get**](SubscriptionsApi.md#subscriptions_get) | **GET** /subscriptions | Lists all the Pricing & Packaging Subscriptions + +# **subscriptions_get** +> list[Subscription] subscriptions_get() + +Lists all the Pricing & Packaging Subscriptions + +This endpoint returns all pricing & packaging subscriptions. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/subscriptions \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = jcapiv2.SubscriptionsApi() + +try: + # Lists all the Pricing & Packaging Subscriptions + api_response = api_instance.subscriptions_get() + pprint(api_response) +except ApiException as e: + print("Exception when calling SubscriptionsApi->subscriptions_get: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[Subscription]**](Subscription.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SuggestionCounts.md b/jcapiv2/docs/SuggestionCounts.md new file mode 100644 index 0000000..02cc5be --- /dev/null +++ b/jcapiv2/docs/SuggestionCounts.md @@ -0,0 +1,11 @@ +# SuggestionCounts + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**add** | **int** | | [optional] +**remove** | **int** | | [optional] +**total** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemGraphManagementReq.md b/jcapiv2/docs/SystemGraphManagementReq.md deleted file mode 100644 index 140db47..0000000 --- a/jcapiv2/docs/SystemGraphManagementReq.md +++ /dev/null @@ -1,13 +0,0 @@ -# SystemGraphManagementReq - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attributes** | [**SystemGraphManagementReqAttributes**](SystemGraphManagementReqAttributes.md) | | [optional] -**id** | **str** | The ObjectID of graph object being added or removed as an association. | -**op** | **str** | How to modify the graph connection. | -**type** | **str** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv2/docs/SystemGraphManagementReqAttributes.md b/jcapiv2/docs/SystemGraphManagementReqAttributes.md deleted file mode 100644 index 45800f9..0000000 --- a/jcapiv2/docs/SystemGraphManagementReqAttributes.md +++ /dev/null @@ -1,10 +0,0 @@ -# SystemGraphManagementReqAttributes - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sudo** | [**SystemGraphManagementReqAttributesSudo**](SystemGraphManagementReqAttributesSudo.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv2/docs/SystemGroup.md b/jcapiv2/docs/SystemGroup.md index 9fa187b..0b1ca57 100644 --- a/jcapiv2/docs/SystemGroup.md +++ b/jcapiv2/docs/SystemGroup.md @@ -3,10 +3,12 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**attributes** | [**GraphAttributes**](GraphAttributes.md) | | [optional] +**description** | **str** | Description of a System Group | [optional] +**email** | **str** | E-mail address associated with a System Group | [optional] **id** | **str** | ObjectId uniquely identifying a System Group. | [optional] **name** | **str** | Display name of a System Group. | [optional] -**type** | **str** | The type of the group; always 'system' for a System Group. | [optional] +**type** | **str** | The type of the group; always 'system' for a System Group. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemGroupAssociationsApi.md b/jcapiv2/docs/SystemGroupAssociationsApi.md index 2689a4e..4195f24 100644 --- a/jcapiv2/docs/SystemGroupAssociationsApi.md +++ b/jcapiv2/docs/SystemGroupAssociationsApi.md @@ -8,12 +8,12 @@ Method | HTTP request | Description [**graph_system_group_associations_post**](SystemGroupAssociationsApi.md#graph_system_group_associations_post) | **POST** /systemgroups/{group_id}/associations | Manage the associations of a System Group [**graph_system_group_traverse_command**](SystemGroupAssociationsApi.md#graph_system_group_traverse_command) | **GET** /systemgroups/{group_id}/commands | List the Commands bound to a System Group [**graph_system_group_traverse_policy**](SystemGroupAssociationsApi.md#graph_system_group_traverse_policy) | **GET** /systemgroups/{group_id}/policies | List the Policies bound to a System Group +[**graph_system_group_traverse_policy_group**](SystemGroupAssociationsApi.md#graph_system_group_traverse_policy_group) | **GET** /systemgroups/{group_id}/policygroups | List the Policy Groups bound to a System Group [**graph_system_group_traverse_user**](SystemGroupAssociationsApi.md#graph_system_group_traverse_user) | **GET** /systemgroups/{group_id}/users | List the Users bound to a System Group [**graph_system_group_traverse_user_group**](SystemGroupAssociationsApi.md#graph_system_group_traverse_user_group) | **GET** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group - # **graph_system_group_associations_list** -> list[GraphConnection] graph_system_group_associations_list(group_id, content_type, accept, targets, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_system_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of a System Group @@ -36,16 +36,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupAssociationsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -targets = ['targets_example'] # list[str] | +targets = ['targets_example'] # list[str] | Targets which a \"system_group\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of a System Group - api_response = api_instance.graph_system_group_associations_list(group_id, content_type, accept, targets, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_system_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemGroupAssociationsApi->graph_system_group_associations_list: %s\n" % e) @@ -56,12 +54,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **targets** | [**list[str]**](str.md)| | + **targets** | [**list[str]**](str.md)| Targets which a \"system_group\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -73,17 +69,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_group_associations_post** -> graph_system_group_associations_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_system_group_associations_post(group_id, body=body, x_org_id=x_org_id) Manage the associations of a System Group -This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` +This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` ### Example ```python @@ -102,14 +98,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupAssociationsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.SystemGroupGraphManagementReq() # SystemGroupGraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationSystemGroup() # GraphOperationSystemGroup | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of a System Group - api_instance.graph_system_group_associations_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_system_group_associations_post(group_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling SystemGroupAssociationsApi->graph_system_group_associations_post: %s\n" % e) ``` @@ -119,10 +113,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**SystemGroupGraphManagementReq**](SystemGroupGraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationSystemGroup**](GraphOperationSystemGroup.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -135,12 +127,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_group_traverse_command** -> list[GraphObjectWithPaths] graph_system_group_traverse_command(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_system_group_traverse_command(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Commands bound to a System Group @@ -163,16 +155,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupAssociationsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Commands bound to a System Group - api_response = api_instance.graph_system_group_traverse_command(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_system_group_traverse_command(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling SystemGroupAssociationsApi->graph_system_group_traverse_command: %s\n" % e) @@ -183,12 +173,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -200,13 +188,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_group_traverse_policy** -> list[GraphObjectWithPaths] graph_system_group_traverse_policy(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_system_group_traverse_policy(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Policies bound to a System Group @@ -229,16 +217,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupAssociationsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Policies bound to a System Group - api_response = api_instance.graph_system_group_traverse_policy(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_system_group_traverse_policy(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling SystemGroupAssociationsApi->graph_system_group_traverse_policy: %s\n" % e) @@ -249,12 +235,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -266,13 +250,75 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_system_group_traverse_policy_group** +> list[GraphObjectWithPaths] graph_system_group_traverse_policy_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + +List the Policy Groups bound to a System Group + +This endpoint will return all Policy Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SystemGroupAssociationsApi(jcapiv2.ApiClient(configuration)) +group_id = 'group_id_example' # str | ObjectID of the System Group. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) + +try: + # List the Policy Groups bound to a System Group + api_response = api_instance.graph_system_group_traverse_policy_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + pprint(api_response) +except ApiException as e: + print("Exception when calling SystemGroupAssociationsApi->graph_system_group_traverse_policy_group: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| ObjectID of the System Group. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_group_traverse_user** -> list[GraphObjectWithPaths] graph_system_group_traverse_user(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_system_group_traverse_user(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Users bound to a System Group @@ -295,16 +341,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupAssociationsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Users bound to a System Group - api_response = api_instance.graph_system_group_traverse_user(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_system_group_traverse_user(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling SystemGroupAssociationsApi->graph_system_group_traverse_user: %s\n" % e) @@ -315,12 +359,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -332,13 +374,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_group_traverse_user_group** -> list[GraphObjectWithPaths] graph_system_group_traverse_user_group(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_system_group_traverse_user_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the User Groups bound to a System Group @@ -361,16 +403,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupAssociationsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the User Groups bound to a System Group - api_response = api_instance.graph_system_group_traverse_user_group(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_system_group_traverse_user_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling SystemGroupAssociationsApi->graph_system_group_traverse_user_group: %s\n" % e) @@ -381,12 +421,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -398,7 +436,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/SystemGroupData.md b/jcapiv2/docs/SystemGroupData.md index 092c8f2..8c973c3 100644 --- a/jcapiv2/docs/SystemGroupData.md +++ b/jcapiv2/docs/SystemGroupData.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemGroupMembersMembershipApi.md b/jcapiv2/docs/SystemGroupMembersMembershipApi.md index 1ddabc6..ce315b2 100644 --- a/jcapiv2/docs/SystemGroupMembersMembershipApi.md +++ b/jcapiv2/docs/SystemGroupMembersMembershipApi.md @@ -4,82 +4,12 @@ All URIs are relative to *https://console.jumpcloud.com/api/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**graph_system_group_member_of**](SystemGroupMembersMembershipApi.md#graph_system_group_member_of) | **GET** /systemgroups/{group_id}/memberof | List the System Group's parents [**graph_system_group_members_list**](SystemGroupMembersMembershipApi.md#graph_system_group_members_list) | **GET** /systemgroups/{group_id}/members | List the members of a System Group [**graph_system_group_members_post**](SystemGroupMembersMembershipApi.md#graph_system_group_members_post) | **POST** /systemgroups/{group_id}/members | Manage the members of a System Group -[**graph_system_group_membership**](SystemGroupMembersMembershipApi.md#graph_system_group_membership) | **GET** /systemgroups/{group_id}/membership | List the System Group's membership - - -# **graph_system_group_member_of** -> list[GraphObjectWithPaths] graph_system_group_member_of(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) - -List the System Group's parents - -This endpoint returns all System Groups a System Group is a member of. This endpoint is not yet public as we haven't completed the code yet. - -### Example -```python -from __future__ import print_function -import time -import jcapiv2 -from jcapiv2.rest import ApiException -from pprint import pprint - -# Configure API key authorization: x-api-key -configuration = jcapiv2.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - -# create an instance of the API class -api_instance = jcapiv2.SystemGroupMembersMembershipApi(jcapiv2.ApiClient(configuration)) -group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) -limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) - -try: - # List the System Group's parents - api_response = api_instance.graph_system_group_member_of(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling SystemGroupMembersMembershipApi->graph_system_group_member_of: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] - **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] - -### Return type - -[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[**graph_system_group_membership**](SystemGroupMembersMembershipApi.md#graph_system_group_membership) | **GET** /systemgroups/{group_id}/membership | List the System Group's membership # **graph_system_group_members_list** -> list[GraphConnection] graph_system_group_members_list(group_id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_system_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) List the members of a System Group @@ -102,15 +32,13 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupMembersMembershipApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the members of a System Group - api_response = api_instance.graph_system_group_members_list(group_id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_system_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemGroupMembersMembershipApi->graph_system_group_members_list: %s\n" % e) @@ -121,11 +49,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -137,17 +63,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_group_members_post** -> graph_system_group_members_post(group_id, content_type, accept, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) +> graph_system_group_members_post(group_id, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) Manage the members of a System Group -This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` +This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` ### Example ```python @@ -166,16 +92,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupMembersMembershipApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.SystemGroupMembersReq() # SystemGroupMembersReq | (optional) +body = jcapiv2.GraphOperationSystemGroupMember() # GraphOperationSystemGroupMember | (optional) _date = '_date_example' # str | Current date header for the System Context API (optional) authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the members of a System Group - api_instance.graph_system_group_members_post(group_id, content_type, accept, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) + api_instance.graph_system_group_members_post(group_id, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) except ApiException as e: print("Exception when calling SystemGroupMembersMembershipApi->graph_system_group_members_post: %s\n" % e) ``` @@ -185,12 +109,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**SystemGroupMembersReq**](SystemGroupMembersReq.md)| | [optional] + **body** | [**GraphOperationSystemGroupMember**](GraphOperationSystemGroupMember.md)| | [optional] **_date** | **str**| Current date header for the System Context API | [optional] **authorization** | **str**| Authorization header for the System Context API | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -203,12 +125,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_group_membership** -> list[GraphObjectWithPaths] graph_system_group_membership(group_id, content_type, accept, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) +> list[GraphObjectWithPaths] graph_system_group_membership(group_id, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) List the System Group's membership @@ -231,17 +153,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupMembersMembershipApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the System Group's membership - api_response = api_instance.graph_system_group_membership(group_id, content_type, accept, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) + api_response = api_instance.graph_system_group_membership(group_id, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemGroupMembersMembershipApi->graph_system_group_membership: %s\n" % e) @@ -252,13 +172,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -270,7 +188,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/SystemGroupsApi.md b/jcapiv2/docs/SystemGroupsApi.md index b1eddec..1cf7218 100644 --- a/jcapiv2/docs/SystemGroupsApi.md +++ b/jcapiv2/docs/SystemGroupsApi.md @@ -6,23 +6,21 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**graph_system_group_associations_list**](SystemGroupsApi.md#graph_system_group_associations_list) | **GET** /systemgroups/{group_id}/associations | List the associations of a System Group [**graph_system_group_associations_post**](SystemGroupsApi.md#graph_system_group_associations_post) | **POST** /systemgroups/{group_id}/associations | Manage the associations of a System Group -[**graph_system_group_member_of**](SystemGroupsApi.md#graph_system_group_member_of) | **GET** /systemgroups/{group_id}/memberof | List the System Group's parents [**graph_system_group_members_list**](SystemGroupsApi.md#graph_system_group_members_list) | **GET** /systemgroups/{group_id}/members | List the members of a System Group [**graph_system_group_members_post**](SystemGroupsApi.md#graph_system_group_members_post) | **POST** /systemgroups/{group_id}/members | Manage the members of a System Group -[**graph_system_group_membership**](SystemGroupsApi.md#graph_system_group_membership) | **GET** /systemgroups/{group_id}/membership | List the System Group's membership +[**graph_system_group_membership**](SystemGroupsApi.md#graph_system_group_membership) | **GET** /systemgroups/{group_id}/membership | List the System Group's membership [**graph_system_group_traverse_policy**](SystemGroupsApi.md#graph_system_group_traverse_policy) | **GET** /systemgroups/{group_id}/policies | List the Policies bound to a System Group +[**graph_system_group_traverse_policy_group**](SystemGroupsApi.md#graph_system_group_traverse_policy_group) | **GET** /systemgroups/{group_id}/policygroups | List the Policy Groups bound to a System Group [**graph_system_group_traverse_user**](SystemGroupsApi.md#graph_system_group_traverse_user) | **GET** /systemgroups/{group_id}/users | List the Users bound to a System Group [**graph_system_group_traverse_user_group**](SystemGroupsApi.md#graph_system_group_traverse_user_group) | **GET** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group [**groups_system_delete**](SystemGroupsApi.md#groups_system_delete) | **DELETE** /systemgroups/{id} | Delete a System Group [**groups_system_get**](SystemGroupsApi.md#groups_system_get) | **GET** /systemgroups/{id} | View an individual System Group details [**groups_system_list**](SystemGroupsApi.md#groups_system_list) | **GET** /systemgroups | List all System Groups -[**groups_system_patch**](SystemGroupsApi.md#groups_system_patch) | **PATCH** /systemgroups/{id} | Partial update a System Group [**groups_system_post**](SystemGroupsApi.md#groups_system_post) | **POST** /systemgroups | Create a new System Group [**groups_system_put**](SystemGroupsApi.md#groups_system_put) | **PUT** /systemgroups/{id} | Update a System Group - # **graph_system_group_associations_list** -> list[GraphConnection] graph_system_group_associations_list(group_id, content_type, accept, targets, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_system_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of a System Group @@ -45,16 +43,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -targets = ['targets_example'] # list[str] | +targets = ['targets_example'] # list[str] | Targets which a \"system_group\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of a System Group - api_response = api_instance.graph_system_group_associations_list(group_id, content_type, accept, targets, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_system_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemGroupsApi->graph_system_group_associations_list: %s\n" % e) @@ -65,12 +61,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **targets** | [**list[str]**](str.md)| | + **targets** | [**list[str]**](str.md)| Targets which a \"system_group\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -82,17 +76,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_group_associations_post** -> graph_system_group_associations_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_system_group_associations_post(group_id, body=body, x_org_id=x_org_id) Manage the associations of a System Group -This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` +This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` ### Example ```python @@ -111,14 +105,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.SystemGroupGraphManagementReq() # SystemGroupGraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationSystemGroup() # GraphOperationSystemGroup | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of a System Group - api_instance.graph_system_group_associations_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_system_group_associations_post(group_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling SystemGroupsApi->graph_system_group_associations_post: %s\n" % e) ``` @@ -128,10 +120,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**SystemGroupGraphManagementReq**](SystemGroupGraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationSystemGroup**](GraphOperationSystemGroup.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -144,16 +134,16 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_system_group_member_of** -> list[GraphObjectWithPaths] graph_system_group_member_of(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +# **graph_system_group_members_list** +> list[GraphConnection] graph_system_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) -List the System Group's parents +List the members of a System Group -This endpoint returns all System Groups a System Group is a member of. This endpoint is not yet public as we haven't completed the code yet. +This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -172,20 +162,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # List the System Group's parents - api_response = api_instance.graph_system_group_member_of(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + # List the members of a System Group + api_response = api_instance.graph_system_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: - print("Exception when calling SystemGroupsApi->graph_system_group_member_of: %s\n" % e) + print("Exception when calling SystemGroupsApi->graph_system_group_members_list: %s\n" % e) ``` ### Parameters @@ -193,17 +179,13 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) +[**list[GraphConnection]**](GraphConnection.md) ### Authorization @@ -211,17 +193,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_system_group_members_list** -> list[GraphConnection] graph_system_group_members_list(group_id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +# **graph_system_group_members_post** +> graph_system_group_members_post(group_id, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) -List the members of a System Group +Manage the members of a System Group -This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` ### Example ```python @@ -240,18 +222,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationSystemGroupMember() # GraphOperationSystemGroupMember | (optional) +_date = '_date_example' # str | Current date header for the System Context API (optional) +authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # List the members of a System Group - api_response = api_instance.graph_system_group_members_list(group_id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) - pprint(api_response) + # Manage the members of a System Group + api_instance.graph_system_group_members_post(group_id, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) except ApiException as e: - print("Exception when calling SystemGroupsApi->graph_system_group_members_list: %s\n" % e) + print("Exception when calling SystemGroupsApi->graph_system_group_members_post: %s\n" % e) ``` ### Parameters @@ -259,15 +239,14 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationSystemGroupMember**](GraphOperationSystemGroupMember.md)| | [optional] + **_date** | **str**| Current date header for the System Context API | [optional] + **authorization** | **str**| Authorization header for the System Context API | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -[**list[GraphConnection]**](GraphConnection.md) +void (empty response body) ### Authorization @@ -276,16 +255,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_system_group_members_post** -> graph_system_group_members_post(group_id, content_type, accept, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) +# **graph_system_group_membership** +> list[GraphObjectWithPaths] graph_system_group_membership(group_id, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) -Manage the members of a System Group +List the System Group's membership -This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` +This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -304,18 +283,18 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.SystemGroupMembersReq() # SystemGroupMembersReq | (optional) -_date = '_date_example' # str | Current date header for the System Context API (optional) -authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) -x_org_id = '' # str | (optional) (default to ) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # Manage the members of a System Group - api_instance.graph_system_group_members_post(group_id, content_type, accept, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) + # List the System Group's membership + api_response = api_instance.graph_system_group_membership(group_id, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) + pprint(api_response) except ApiException as e: - print("Exception when calling SystemGroupsApi->graph_system_group_members_post: %s\n" % e) + print("Exception when calling SystemGroupsApi->graph_system_group_membership: %s\n" % e) ``` ### Parameters @@ -323,16 +302,15 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**SystemGroupMembersReq**](SystemGroupMembersReq.md)| | [optional] - **_date** | **str**| Current date header for the System Context API | [optional] - **authorization** | **str**| Authorization header for the System Context API | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -void (empty response body) +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) ### Authorization @@ -340,17 +318,17 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_system_group_membership** -> list[GraphObjectWithPaths] graph_system_group_membership(group_id, content_type, accept, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) +# **graph_system_group_traverse_policy** +> list[GraphObjectWithPaths] graph_system_group_traverse_policy(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) -List the System Group's membership +List the Policies bound to a System Group -This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -369,20 +347,17 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: - # List the System Group's membership - api_response = api_instance.graph_system_group_membership(group_id, content_type, accept, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) + # List the Policies bound to a System Group + api_response = api_instance.graph_system_group_traverse_policy(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: - print("Exception when calling SystemGroupsApi->graph_system_group_membership: %s\n" % e) + print("Exception when calling SystemGroupsApi->graph_system_group_traverse_policy: %s\n" % e) ``` ### Parameters @@ -390,13 +365,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -408,17 +380,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **graph_system_group_traverse_policy** -> list[GraphObjectWithPaths] graph_system_group_traverse_policy(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +# **graph_system_group_traverse_policy_group** +> list[GraphObjectWithPaths] graph_system_group_traverse_policy_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) -List the Policies bound to a System Group +List the Policy Groups bound to a System Group -This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint will return all Policy Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -437,19 +409,17 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: - # List the Policies bound to a System Group - api_response = api_instance.graph_system_group_traverse_policy(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + # List the Policy Groups bound to a System Group + api_response = api_instance.graph_system_group_traverse_policy_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: - print("Exception when calling SystemGroupsApi->graph_system_group_traverse_policy: %s\n" % e) + print("Exception when calling SystemGroupsApi->graph_system_group_traverse_policy_group: %s\n" % e) ``` ### Parameters @@ -457,12 +427,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -474,13 +442,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_group_traverse_user** -> list[GraphObjectWithPaths] graph_system_group_traverse_user(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_system_group_traverse_user(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Users bound to a System Group @@ -503,16 +471,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Users bound to a System Group - api_response = api_instance.graph_system_group_traverse_user(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_system_group_traverse_user(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling SystemGroupsApi->graph_system_group_traverse_user: %s\n" % e) @@ -523,12 +489,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -540,13 +504,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_group_traverse_user_group** -> list[GraphObjectWithPaths] graph_system_group_traverse_user_group(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_system_group_traverse_user_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the User Groups bound to a System Group @@ -569,16 +533,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the User Groups bound to a System Group - api_response = api_instance.graph_system_group_traverse_user_group(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_system_group_traverse_user_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling SystemGroupsApi->graph_system_group_traverse_user_group: %s\n" % e) @@ -589,12 +551,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -606,13 +566,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **groups_system_delete** -> groups_system_delete(id, content_type, accept, x_org_id=x_org_id) +> SystemGroup groups_system_delete(id, x_org_id=x_org_id) Delete a System Group @@ -635,13 +595,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupsApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Delete a System Group - api_instance.groups_system_delete(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.groups_system_delete(id, x_org_id=x_org_id) + pprint(api_response) except ApiException as e: print("Exception when calling SystemGroupsApi->groups_system_delete: %s\n" % e) ``` @@ -651,13 +610,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -void (empty response body) +[**SystemGroup**](SystemGroup.md) ### Authorization @@ -665,13 +622,13 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **groups_system_get** -> SystemGroup groups_system_get(id, content_type, accept, x_org_id=x_org_id) +> SystemGroup groups_system_get(id, x_org_id=x_org_id) View an individual System Group details @@ -694,13 +651,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupsApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # View an individual System Group details - api_response = api_instance.groups_system_get(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.groups_system_get(id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemGroupsApi->groups_system_get: %s\n" % e) @@ -711,9 +666,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -725,13 +678,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **groups_system_list** -> list[SystemGroup] groups_system_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +> list[SystemGroup] groups_system_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) List all System Groups @@ -753,18 +706,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List all System Groups - api_response = api_instance.groups_system_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.groups_system_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemGroupsApi->groups_system_list: %s\n" % e) @@ -774,14 +725,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -793,79 +742,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **groups_system_patch** -> SystemGroup groups_system_patch(id, content_type, accept, body=body, x_org_id=x_org_id) - -Partial update a System Group - -We have hidden PATCH on the systemgroups and usergroups for now; we don't have that implemented correctly yet, people should use PUT until we do a true PATCH operation. #### Sample Request ``` https://console.jumpcloud.com/api/v2/systemgroups/{id} ``` - -### Example -```python -from __future__ import print_function -import time -import jcapiv2 -from jcapiv2.rest import ApiException -from pprint import pprint - -# Configure API key authorization: x-api-key -configuration = jcapiv2.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - -# create an instance of the API class -api_instance = jcapiv2.SystemGroupsApi(jcapiv2.ApiClient(configuration)) -id = 'id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.SystemGroupData() # SystemGroupData | (optional) -x_org_id = '' # str | (optional) (default to ) - -try: - # Partial update a System Group - api_response = api_instance.groups_system_patch(id, content_type, accept, body=body, x_org_id=x_org_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling SystemGroupsApi->groups_system_patch: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**SystemGroupData**](SystemGroupData.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] - -### Return type - -[**SystemGroup**](SystemGroup.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **groups_system_post** -> SystemGroup groups_system_post(content_type, accept, body=body, x_org_id=x_org_id) +> SystemGroup groups_system_post(body=body, x_org_id=x_org_id) Create a new System Group -This endpoint allows you to create a new System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` +This endpoint allows you to create a new System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` ### Example ```python @@ -883,14 +770,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv2.SystemGroupData() # SystemGroupData | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Create a new System Group - api_response = api_instance.groups_system_post(content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.groups_system_post(body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemGroupsApi->groups_system_post: %s\n" % e) @@ -900,10 +785,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**SystemGroupData**](SystemGroupData.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -921,11 +804,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **groups_system_put** -> SystemGroup groups_system_put(id, content_type, accept, body=body, x_org_id=x_org_id) +> SystemGroup groups_system_put(id, body=body, x_org_id=x_org_id) Update a System Group -This endpoint allows you to do a full update of the System Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Name_Update\" }' ``` +This endpoint allows you to do a full update of the System Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Name_Update\" }' ``` ### Example ```python @@ -944,14 +827,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemGroupsApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | ObjectID of the System Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv2.SystemGroupData() # SystemGroupData | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Update a System Group - api_response = api_instance.groups_system_put(id, content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.groups_system_put(id, body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemGroupsApi->groups_system_put: %s\n" % e) @@ -962,10 +843,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| ObjectID of the System Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**SystemGroupData**](SystemGroupData.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type diff --git a/jcapiv2/docs/SystemInsightsAlf.md b/jcapiv2/docs/SystemInsightsAlf.md new file mode 100644 index 0000000..b13aa9e --- /dev/null +++ b/jcapiv2/docs/SystemInsightsAlf.md @@ -0,0 +1,17 @@ +# SystemInsightsAlf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allow_signed_enabled** | **int** | | [optional] +**collection_time** | **str** | | [optional] +**firewall_unload** | **int** | | [optional] +**global_state** | **int** | | [optional] +**logging_enabled** | **int** | | [optional] +**logging_option** | **int** | | [optional] +**stealth_enabled** | **int** | | [optional] +**system_id** | **str** | | [optional] +**version** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsAlfExceptions.md b/jcapiv2/docs/SystemInsightsAlfExceptions.md new file mode 100644 index 0000000..2fbd182 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsAlfExceptions.md @@ -0,0 +1,12 @@ +# SystemInsightsAlfExceptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collection_time** | **str** | | [optional] +**path** | **str** | | [optional] +**state** | **float** | | [optional] +**system_id** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsAlfExplicitAuths.md b/jcapiv2/docs/SystemInsightsAlfExplicitAuths.md new file mode 100644 index 0000000..e3cda6f --- /dev/null +++ b/jcapiv2/docs/SystemInsightsAlfExplicitAuths.md @@ -0,0 +1,11 @@ +# SystemInsightsAlfExplicitAuths + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collection_time** | **str** | | [optional] +**process** | **str** | | [optional] +**system_id** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsApi.md b/jcapiv2/docs/SystemInsightsApi.md index 46474f0..41caf49 100644 --- a/jcapiv2/docs/SystemInsightsApi.md +++ b/jcapiv2/docs/SystemInsightsApi.md @@ -4,64 +4,321 @@ All URIs are relative to *https://console.jumpcloud.com/api/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**systeminsights_list_alf**](SystemInsightsApi.md#systeminsights_list_alf) | **GET** /systeminsights/alf | List System Insights ALF +[**systeminsights_list_alf_exceptions**](SystemInsightsApi.md#systeminsights_list_alf_exceptions) | **GET** /systeminsights/alf_exceptions | List System Insights ALF Exceptions +[**systeminsights_list_alf_explicit_auths**](SystemInsightsApi.md#systeminsights_list_alf_explicit_auths) | **GET** /systeminsights/alf_explicit_auths | List System Insights ALF Explicit Authentications +[**systeminsights_list_appcompat_shims**](SystemInsightsApi.md#systeminsights_list_appcompat_shims) | **GET** /systeminsights/appcompat_shims | List System Insights Application Compatibility Shims [**systeminsights_list_apps**](SystemInsightsApi.md#systeminsights_list_apps) | **GET** /systeminsights/apps | List System Insights Apps +[**systeminsights_list_authorized_keys**](SystemInsightsApi.md#systeminsights_list_authorized_keys) | **GET** /systeminsights/authorized_keys | List System Insights Authorized Keys +[**systeminsights_list_azure_instance_metadata**](SystemInsightsApi.md#systeminsights_list_azure_instance_metadata) | **GET** /systeminsights/azure_instance_metadata | List System Insights Azure Instance Metadata +[**systeminsights_list_azure_instance_tags**](SystemInsightsApi.md#systeminsights_list_azure_instance_tags) | **GET** /systeminsights/azure_instance_tags | List System Insights Azure Instance Tags [**systeminsights_list_battery**](SystemInsightsApi.md#systeminsights_list_battery) | **GET** /systeminsights/battery | List System Insights Battery [**systeminsights_list_bitlocker_info**](SystemInsightsApi.md#systeminsights_list_bitlocker_info) | **GET** /systeminsights/bitlocker_info | List System Insights Bitlocker Info [**systeminsights_list_browser_plugins**](SystemInsightsApi.md#systeminsights_list_browser_plugins) | **GET** /systeminsights/browser_plugins | List System Insights Browser Plugins +[**systeminsights_list_certificates**](SystemInsightsApi.md#systeminsights_list_certificates) | **GET** /systeminsights/certificates | List System Insights Certificates +[**systeminsights_list_chassis_info**](SystemInsightsApi.md#systeminsights_list_chassis_info) | **GET** /systeminsights/chassis_info | List System Insights Chassis Info [**systeminsights_list_chrome_extensions**](SystemInsightsApi.md#systeminsights_list_chrome_extensions) | **GET** /systeminsights/chrome_extensions | List System Insights Chrome Extensions +[**systeminsights_list_connectivity**](SystemInsightsApi.md#systeminsights_list_connectivity) | **GET** /systeminsights/connectivity | List System Insights Connectivity [**systeminsights_list_crashes**](SystemInsightsApi.md#systeminsights_list_crashes) | **GET** /systeminsights/crashes | List System Insights Crashes +[**systeminsights_list_cups_destinations**](SystemInsightsApi.md#systeminsights_list_cups_destinations) | **GET** /systeminsights/cups_destinations | List System Insights CUPS Destinations [**systeminsights_list_disk_encryption**](SystemInsightsApi.md#systeminsights_list_disk_encryption) | **GET** /systeminsights/disk_encryption | List System Insights Disk Encryption [**systeminsights_list_disk_info**](SystemInsightsApi.md#systeminsights_list_disk_info) | **GET** /systeminsights/disk_info | List System Insights Disk Info +[**systeminsights_list_dns_resolvers**](SystemInsightsApi.md#systeminsights_list_dns_resolvers) | **GET** /systeminsights/dns_resolvers | List System Insights DNS Resolvers [**systeminsights_list_etc_hosts**](SystemInsightsApi.md#systeminsights_list_etc_hosts) | **GET** /systeminsights/etc_hosts | List System Insights Etc Hosts [**systeminsights_list_firefox_addons**](SystemInsightsApi.md#systeminsights_list_firefox_addons) | **GET** /systeminsights/firefox_addons | List System Insights Firefox Addons [**systeminsights_list_groups**](SystemInsightsApi.md#systeminsights_list_groups) | **GET** /systeminsights/groups | List System Insights Groups [**systeminsights_list_ie_extensions**](SystemInsightsApi.md#systeminsights_list_ie_extensions) | **GET** /systeminsights/ie_extensions | List System Insights IE Extensions [**systeminsights_list_interface_addresses**](SystemInsightsApi.md#systeminsights_list_interface_addresses) | **GET** /systeminsights/interface_addresses | List System Insights Interface Addresses +[**systeminsights_list_interface_details**](SystemInsightsApi.md#systeminsights_list_interface_details) | **GET** /systeminsights/interface_details | List System Insights Interface Details [**systeminsights_list_kernel_info**](SystemInsightsApi.md#systeminsights_list_kernel_info) | **GET** /systeminsights/kernel_info | List System Insights Kernel Info [**systeminsights_list_launchd**](SystemInsightsApi.md#systeminsights_list_launchd) | **GET** /systeminsights/launchd | List System Insights Launchd +[**systeminsights_list_linux_packages**](SystemInsightsApi.md#systeminsights_list_linux_packages) | **GET** /systeminsights/linux_packages | List System Insights Linux Packages [**systeminsights_list_logged_in_users**](SystemInsightsApi.md#systeminsights_list_logged_in_users) | **GET** /systeminsights/logged_in_users | List System Insights Logged-In Users [**systeminsights_list_logical_drives**](SystemInsightsApi.md#systeminsights_list_logical_drives) | **GET** /systeminsights/logical_drives | List System Insights Logical Drives +[**systeminsights_list_managed_policies**](SystemInsightsApi.md#systeminsights_list_managed_policies) | **GET** /systeminsights/managed_policies | List System Insights Managed Policies [**systeminsights_list_mounts**](SystemInsightsApi.md#systeminsights_list_mounts) | **GET** /systeminsights/mounts | List System Insights Mounts [**systeminsights_list_os_version**](SystemInsightsApi.md#systeminsights_list_os_version) | **GET** /systeminsights/os_version | List System Insights OS Version [**systeminsights_list_patches**](SystemInsightsApi.md#systeminsights_list_patches) | **GET** /systeminsights/patches | List System Insights Patches [**systeminsights_list_programs**](SystemInsightsApi.md#systeminsights_list_programs) | **GET** /systeminsights/programs | List System Insights Programs +[**systeminsights_list_python_packages**](SystemInsightsApi.md#systeminsights_list_python_packages) | **GET** /systeminsights/python_packages | List System Insights Python Packages [**systeminsights_list_safari_extensions**](SystemInsightsApi.md#systeminsights_list_safari_extensions) | **GET** /systeminsights/safari_extensions | List System Insights Safari Extensions -[**systeminsights_list_system_apps**](SystemInsightsApi.md#systeminsights_list_system_apps) | **GET** /systeminsights/{system_id}/apps | List System Insights System Apps -[**systeminsights_list_system_bitlocker_info**](SystemInsightsApi.md#systeminsights_list_system_bitlocker_info) | **GET** /systeminsights/{system_id}/bitlocker_info | List System Insights System Bitlocker Info -[**systeminsights_list_system_browser_plugins**](SystemInsightsApi.md#systeminsights_list_system_browser_plugins) | **GET** /systeminsights/{system_id}/browser_plugins | List System Insights System Browser Plugins -[**systeminsights_list_system_chrome_extensions**](SystemInsightsApi.md#systeminsights_list_system_chrome_extensions) | **GET** /systeminsights/{system_id}/chrome_extensions | List System Insights System Chrome Extensions +[**systeminsights_list_scheduled_tasks**](SystemInsightsApi.md#systeminsights_list_scheduled_tasks) | **GET** /systeminsights/scheduled_tasks | List System Insights Scheduled Tasks +[**systeminsights_list_secureboot**](SystemInsightsApi.md#systeminsights_list_secureboot) | **GET** /systeminsights/secureboot | List System Insights Secure Boot +[**systeminsights_list_services**](SystemInsightsApi.md#systeminsights_list_services) | **GET** /systeminsights/services | List System Insights Services +[**systeminsights_list_shadow**](SystemInsightsApi.md#systeminsights_list_shadow) | **GET** /systeminsights/shadow | LIst System Insights Shadow +[**systeminsights_list_shared_folders**](SystemInsightsApi.md#systeminsights_list_shared_folders) | **GET** /systeminsights/shared_folders | List System Insights Shared Folders +[**systeminsights_list_shared_resources**](SystemInsightsApi.md#systeminsights_list_shared_resources) | **GET** /systeminsights/shared_resources | List System Insights Shared Resources +[**systeminsights_list_sharing_preferences**](SystemInsightsApi.md#systeminsights_list_sharing_preferences) | **GET** /systeminsights/sharing_preferences | List System Insights Sharing Preferences +[**systeminsights_list_sip_config**](SystemInsightsApi.md#systeminsights_list_sip_config) | **GET** /systeminsights/sip_config | List System Insights SIP Config +[**systeminsights_list_startup_items**](SystemInsightsApi.md#systeminsights_list_startup_items) | **GET** /systeminsights/startup_items | List System Insights Startup Items [**systeminsights_list_system_controls**](SystemInsightsApi.md#systeminsights_list_system_controls) | **GET** /systeminsights/system_controls | List System Insights System Control -[**systeminsights_list_system_disk_encryption**](SystemInsightsApi.md#systeminsights_list_system_disk_encryption) | **GET** /systeminsights/{system_id}/disk_encryption | List System Insights System Disk Encryption -[**systeminsights_list_system_disk_info**](SystemInsightsApi.md#systeminsights_list_system_disk_info) | **GET** /systeminsights/{system_id}/disk_info | List System Insights System Disk Info -[**systeminsights_list_system_etc_hosts**](SystemInsightsApi.md#systeminsights_list_system_etc_hosts) | **GET** /systeminsights/{system_id}/etc_hosts | List System Insights System Etc Hosts -[**systeminsights_list_system_firefox_addons**](SystemInsightsApi.md#systeminsights_list_system_firefox_addons) | **GET** /systeminsights/{system_id}/firefox_addons | List System Insights System Firefox Addons -[**systeminsights_list_system_groups**](SystemInsightsApi.md#systeminsights_list_system_groups) | **GET** /systeminsights/{system_id}/groups | List System Insights System Groups [**systeminsights_list_system_info**](SystemInsightsApi.md#systeminsights_list_system_info) | **GET** /systeminsights/system_info | List System Insights System Info -[**systeminsights_list_system_interface_addresses**](SystemInsightsApi.md#systeminsights_list_system_interface_addresses) | **GET** /systeminsights/{system_id}/interface_addresses | List System Insights System Interface Addresses -[**systeminsights_list_system_kernel_info**](SystemInsightsApi.md#systeminsights_list_system_kernel_info) | **GET** /systeminsights/{system_id}/kernel_info | List System Insights System Kernel Info -[**systeminsights_list_system_logical_drives**](SystemInsightsApi.md#systeminsights_list_system_logical_drives) | **GET** /systeminsights/{system_id}/logical_drives | List System Insights System Logical Drives -[**systeminsights_list_system_mounts**](SystemInsightsApi.md#systeminsights_list_system_mounts) | **GET** /systeminsights/{system_id}/mounts | List System Insights System Mounts -[**systeminsights_list_system_os_version**](SystemInsightsApi.md#systeminsights_list_system_os_version) | **GET** /systeminsights/{system_id}/os_version | List System Insights System OS Version -[**systeminsights_list_system_patches**](SystemInsightsApi.md#systeminsights_list_system_patches) | **GET** /systeminsights/{system_id}/patches | List System Insights System Patches -[**systeminsights_list_system_programs**](SystemInsightsApi.md#systeminsights_list_system_programs) | **GET** /systeminsights/{system_id}/programs | List System Insights System Programs -[**systeminsights_list_system_safari_extensions**](SystemInsightsApi.md#systeminsights_list_system_safari_extensions) | **GET** /systeminsights/{system_id}/safari_extensions | List System Insights System Safari Extensions -[**systeminsights_list_system_system_controls**](SystemInsightsApi.md#systeminsights_list_system_system_controls) | **GET** /systeminsights/{system_id}/system_controls | List System Insights System System Controls -[**systeminsights_list_system_system_info**](SystemInsightsApi.md#systeminsights_list_system_system_info) | **GET** /systeminsights/{system_id}/system_info | List System Insights System System Info -[**systeminsights_list_system_uptime**](SystemInsightsApi.md#systeminsights_list_system_uptime) | **GET** /systeminsights/{system_id}/uptime | List System Insights System Uptime -[**systeminsights_list_system_users**](SystemInsightsApi.md#systeminsights_list_system_users) | **GET** /systeminsights/{system_id}/users | List System Insights System Users +[**systeminsights_list_tpm_info**](SystemInsightsApi.md#systeminsights_list_tpm_info) | **GET** /systeminsights/tpm_info | List System Insights TPM Info [**systeminsights_list_uptime**](SystemInsightsApi.md#systeminsights_list_uptime) | **GET** /systeminsights/uptime | List System Insights Uptime [**systeminsights_list_usb_devices**](SystemInsightsApi.md#systeminsights_list_usb_devices) | **GET** /systeminsights/usb_devices | List System Insights USB Devices [**systeminsights_list_user_groups**](SystemInsightsApi.md#systeminsights_list_user_groups) | **GET** /systeminsights/user_groups | List System Insights User Groups +[**systeminsights_list_user_ssh_keys**](SystemInsightsApi.md#systeminsights_list_user_ssh_keys) | **GET** /systeminsights/user_ssh_keys | List System Insights User SSH Keys +[**systeminsights_list_userassist**](SystemInsightsApi.md#systeminsights_list_userassist) | **GET** /systeminsights/userassist | List System Insights User Assist [**systeminsights_list_users**](SystemInsightsApi.md#systeminsights_list_users) | **GET** /systeminsights/users | List System Insights Users -[**systeminsights_list_windows_crashes**](SystemInsightsApi.md#systeminsights_list_windows_crashes) | **GET** /systeminsights/windows_crashes | List System Insights Windows Crashes +[**systeminsights_list_wifi_networks**](SystemInsightsApi.md#systeminsights_list_wifi_networks) | **GET** /systeminsights/wifi_networks | List System Insights WiFi Networks +[**systeminsights_list_wifi_status**](SystemInsightsApi.md#systeminsights_list_wifi_status) | **GET** /systeminsights/wifi_status | List System Insights WiFi Status +[**systeminsights_list_windows_security_center**](SystemInsightsApi.md#systeminsights_list_windows_security_center) | **GET** /systeminsights/windows_security_center | List System Insights Windows Security Center +[**systeminsights_list_windows_security_products**](SystemInsightsApi.md#systeminsights_list_windows_security_products) | **GET** /systeminsights/windows_security_products | List System Insights Windows Security Products +# **systeminsights_list_alf** +> list[SystemInsightsAlf] systeminsights_list_alf(x_org_id=x_org_id, filter=filter, skip=skip, sort=sort, limit=limit) + +List System Insights ALF + +Valid filter fields are `system_id` and `global_state`. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +limit = 10 # int | (optional) (default to 10) + +try: + # List System Insights ALF + api_response = api_instance.systeminsights_list_alf(x_org_id=x_org_id, filter=filter, skip=skip, sort=sort, limit=limit) + pprint(api_response) +except ApiException as e: + print("Exception when calling SystemInsightsApi->systeminsights_list_alf: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **limit** | **int**| | [optional] [default to 10] + +### Return type + +[**list[SystemInsightsAlf]**](SystemInsightsAlf.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **systeminsights_list_alf_exceptions** +> list[SystemInsightsAlfExceptions] systeminsights_list_alf_exceptions(x_org_id=x_org_id, filter=filter, skip=skip, sort=sort, limit=limit) + +List System Insights ALF Exceptions + +Valid filter fields are `system_id` and `state`. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +limit = 10 # int | (optional) (default to 10) + +try: + # List System Insights ALF Exceptions + api_response = api_instance.systeminsights_list_alf_exceptions(x_org_id=x_org_id, filter=filter, skip=skip, sort=sort, limit=limit) + pprint(api_response) +except ApiException as e: + print("Exception when calling SystemInsightsApi->systeminsights_list_alf_exceptions: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **limit** | **int**| | [optional] [default to 10] + +### Return type + +[**list[SystemInsightsAlfExceptions]**](SystemInsightsAlfExceptions.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **systeminsights_list_alf_explicit_auths** +> list[SystemInsightsAlfExplicitAuths] systeminsights_list_alf_explicit_auths(x_org_id=x_org_id, filter=filter, skip=skip, sort=sort, limit=limit) + +List System Insights ALF Explicit Authentications + +Valid filter fields are `system_id` and `process`. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +limit = 10 # int | (optional) (default to 10) + +try: + # List System Insights ALF Explicit Authentications + api_response = api_instance.systeminsights_list_alf_explicit_auths(x_org_id=x_org_id, filter=filter, skip=skip, sort=sort, limit=limit) + pprint(api_response) +except ApiException as e: + print("Exception when calling SystemInsightsApi->systeminsights_list_alf_explicit_auths: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **limit** | **int**| | [optional] [default to 10] + +### Return type + +[**list[SystemInsightsAlfExplicitAuths]**](SystemInsightsAlfExplicitAuths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **systeminsights_list_appcompat_shims** +> list[SystemInsightsAppcompatShims] systeminsights_list_appcompat_shims(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) + +List System Insights Application Compatibility Shims + +Valid filter fields are `system_id` and `enabled`. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) + +try: + # List System Insights Application Compatibility Shims + api_response = api_instance.systeminsights_list_appcompat_shims(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) + pprint(api_response) +except ApiException as e: + print("Exception when calling SystemInsightsApi->systeminsights_list_appcompat_shims: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] + +### Return type + +[**list[SystemInsightsAppcompatShims]**](SystemInsightsAppcompatShims.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **systeminsights_list_apps** -> list[SystemInsightsApps] systeminsights_list_apps(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[SystemInsightsApps] systeminsights_list_apps(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) List System Insights Apps -Valid filter fields are `system_id` and `bundle_name`. +Lists all apps for macOS devices. For Windows devices, use [List System Insights Programs](#operation/systeminsights_list_programs). Valid filter fields are `system_id` and `bundle_name`. ### Example ```python @@ -79,16 +336,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) try: # List System Insights Apps - api_response = api_instance.systeminsights_list_apps(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.systeminsights_list_apps(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) pprint(api_response) except ApiException as e: print("Exception when calling SystemInsightsApi->systeminsights_list_apps: %s\n" % e) @@ -98,12 +354,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type @@ -115,13 +370,187 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **systeminsights_list_authorized_keys** +> list[SystemInsightsAuthorizedKeys] systeminsights_list_authorized_keys(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) + +List System Insights Authorized Keys + +Valid filter fields are `system_id` and `uid`. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) + +try: + # List System Insights Authorized Keys + api_response = api_instance.systeminsights_list_authorized_keys(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) + pprint(api_response) +except ApiException as e: + print("Exception when calling SystemInsightsApi->systeminsights_list_authorized_keys: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] + +### Return type + +[**list[SystemInsightsAuthorizedKeys]**](SystemInsightsAuthorizedKeys.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **systeminsights_list_azure_instance_metadata** +> list[SystemInsightsAzureInstanceMetadata] systeminsights_list_azure_instance_metadata(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) + +List System Insights Azure Instance Metadata + +Valid filter fields are `system_id`. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = jcapiv2.SystemInsightsApi() +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) + +try: + # List System Insights Azure Instance Metadata + api_response = api_instance.systeminsights_list_azure_instance_metadata(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) + pprint(api_response) +except ApiException as e: + print("Exception when calling SystemInsightsApi->systeminsights_list_azure_instance_metadata: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] + +### Return type + +[**list[SystemInsightsAzureInstanceMetadata]**](SystemInsightsAzureInstanceMetadata.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **systeminsights_list_azure_instance_tags** +> list[SystemInsightsAzureInstanceTags] systeminsights_list_azure_instance_tags(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) + +List System Insights Azure Instance Tags + +Valid filter fields are `system_id`. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = jcapiv2.SystemInsightsApi() +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) + +try: + # List System Insights Azure Instance Tags + api_response = api_instance.systeminsights_list_azure_instance_tags(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) + pprint(api_response) +except ApiException as e: + print("Exception when calling SystemInsightsApi->systeminsights_list_azure_instance_tags: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] + +### Return type + +[**list[SystemInsightsAzureInstanceTags]**](SystemInsightsAzureInstanceTags.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **systeminsights_list_battery** -> list[SystemInsightsBattery] systeminsights_list_battery(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[SystemInsightsBattery] systeminsights_list_battery(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) List System Insights Battery @@ -143,16 +572,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) try: # List System Insights Battery - api_response = api_instance.systeminsights_list_battery(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.systeminsights_list_battery(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) pprint(api_response) except ApiException as e: print("Exception when calling SystemInsightsApi->systeminsights_list_battery: %s\n" % e) @@ -162,12 +590,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type @@ -179,13 +606,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **systeminsights_list_bitlocker_info** -> list[SystemInsightsBitlockerInfo] systeminsights_list_bitlocker_info(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +> list[SystemInsightsBitlockerInfo] systeminsights_list_bitlocker_info(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) List System Insights Bitlocker Info @@ -207,16 +634,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: # List System Insights Bitlocker Info - api_response = api_instance.systeminsights_list_bitlocker_info(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + api_response = api_instance.systeminsights_list_bitlocker_info(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: print("Exception when calling SystemInsightsApi->systeminsights_list_bitlocker_info: %s\n" % e) @@ -226,12 +652,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type @@ -243,13 +668,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **systeminsights_list_browser_plugins** -> list[SystemInsightsBrowserPlugins] systeminsights_list_browser_plugins(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +> list[SystemInsightsBrowserPlugins] systeminsights_list_browser_plugins(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) List System Insights Browser Plugins @@ -271,16 +696,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: # List System Insights Browser Plugins - api_response = api_instance.systeminsights_list_browser_plugins(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + api_response = api_instance.systeminsights_list_browser_plugins(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: print("Exception when calling SystemInsightsApi->systeminsights_list_browser_plugins: %s\n" % e) @@ -290,12 +714,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type @@ -307,13 +730,131 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **systeminsights_list_certificates** +> list[SystemInsightsCertificates] systeminsights_list_certificates(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) + +List System Insights Certificates + +Valid filter fields are `system_id` and `common_name`. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` Note: You can only filter by `system_id` and `common_name` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) + +try: + # List System Insights Certificates + api_response = api_instance.systeminsights_list_certificates(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) + pprint(api_response) +except ApiException as e: + print("Exception when calling SystemInsightsApi->systeminsights_list_certificates: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` Note: You can only filter by `system_id` and `common_name` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] + +### Return type + +[**list[SystemInsightsCertificates]**](SystemInsightsCertificates.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **systeminsights_list_chassis_info** +> list[SystemInsightsChassisInfo] systeminsights_list_chassis_info(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) + +List System Insights Chassis Info + +Valid filter fields are `system_id`. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = jcapiv2.SystemInsightsApi() +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) + +try: + # List System Insights Chassis Info + api_response = api_instance.systeminsights_list_chassis_info(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) + pprint(api_response) +except ApiException as e: + print("Exception when calling SystemInsightsApi->systeminsights_list_chassis_info: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] + +### Return type + +[**list[SystemInsightsChassisInfo]**](SystemInsightsChassisInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **systeminsights_list_chrome_extensions** -> list[SystemInsightsChromeExtensions] systeminsights_list_chrome_extensions(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +> list[SystemInsightsChromeExtensions] systeminsights_list_chrome_extensions(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) List System Insights Chrome Extensions @@ -335,35 +876,95 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) limit = 10 # int | (optional) (default to 10) + +try: + # List System Insights Chrome Extensions + api_response = api_instance.systeminsights_list_chrome_extensions(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) + pprint(api_response) +except ApiException as e: + print("Exception when calling SystemInsightsApi->systeminsights_list_chrome_extensions: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] + +### Return type + +[**list[SystemInsightsChromeExtensions]**](SystemInsightsChromeExtensions.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **systeminsights_list_connectivity** +> list[SystemInsightsConnectivity] systeminsights_list_connectivity(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) + +List System Insights Connectivity + +The only valid filter field is `system_id`. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Chrome Extensions - api_response = api_instance.systeminsights_list_chrome_extensions(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Connectivity + api_response = api_instance.systeminsights_list_connectivity(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_chrome_extensions: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_connectivity: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsChromeExtensions]**](SystemInsightsChromeExtensions.md) +[**list[SystemInsightsConnectivity]**](SystemInsightsConnectivity.md) ### Authorization @@ -371,13 +972,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **systeminsights_list_crashes** -> list[SystemInsightsCrashes] systeminsights_list_crashes(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[SystemInsightsCrashes] systeminsights_list_crashes(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) List System Insights Crashes @@ -399,16 +1000,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) try: # List System Insights Crashes - api_response = api_instance.systeminsights_list_crashes(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.systeminsights_list_crashes(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) pprint(api_response) except ApiException as e: print("Exception when calling SystemInsightsApi->systeminsights_list_crashes: %s\n" % e) @@ -418,12 +1018,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type @@ -435,17 +1034,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_disk_encryption** -> list[SystemInsightsDiskEncryption] systeminsights_list_disk_encryption(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_cups_destinations** +> list[SystemInsightsCupsDestinations] systeminsights_list_cups_destinations(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights Disk Encryption +List System Insights CUPS Destinations -Valid filter fields are `system_id` and `encryption_status`. +Valid filter fields are `system_id` and `name`. ### Example ```python @@ -463,35 +1062,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Disk Encryption - api_response = api_instance.systeminsights_list_disk_encryption(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights CUPS Destinations + api_response = api_instance.systeminsights_list_cups_destinations(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_disk_encryption: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_cups_destinations: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsDiskEncryption]**](SystemInsightsDiskEncryption.md) +[**list[SystemInsightsCupsDestinations]**](SystemInsightsCupsDestinations.md) ### Authorization @@ -499,17 +1096,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_disk_info** -> list[SystemInsightsDiskInfo] systeminsights_list_disk_info(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_disk_encryption** +> list[SystemInsightsDiskEncryption] systeminsights_list_disk_encryption(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights Disk Info +List System Insights Disk Encryption -Valid filter fields are `system_id` and `disk_index`. +Valid filter fields are `system_id` and `encryption_status`. ### Example ```python @@ -527,35 +1124,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Disk Info - api_response = api_instance.systeminsights_list_disk_info(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Disk Encryption + api_response = api_instance.systeminsights_list_disk_encryption(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_disk_info: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_disk_encryption: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsDiskInfo]**](SystemInsightsDiskInfo.md) +[**list[SystemInsightsDiskEncryption]**](SystemInsightsDiskEncryption.md) ### Authorization @@ -563,17 +1158,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_etc_hosts** -> list[SystemInsightsEtcHosts] systeminsights_list_etc_hosts(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_disk_info** +> list[SystemInsightsDiskInfo] systeminsights_list_disk_info(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights Etc Hosts +List System Insights Disk Info -Valid filter fields are `system_id` and `address`. +Valid filter fields are `system_id` and `disk_index`. ### Example ```python @@ -591,35 +1186,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Etc Hosts - api_response = api_instance.systeminsights_list_etc_hosts(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Disk Info + api_response = api_instance.systeminsights_list_disk_info(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_etc_hosts: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_disk_info: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsEtcHosts]**](SystemInsightsEtcHosts.md) +[**list[SystemInsightsDiskInfo]**](SystemInsightsDiskInfo.md) ### Authorization @@ -627,17 +1220,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_firefox_addons** -> list[SystemInsightsFirefoxAddons] systeminsights_list_firefox_addons(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_dns_resolvers** +> list[SystemInsightsDnsResolvers] systeminsights_list_dns_resolvers(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights Firefox Addons +List System Insights DNS Resolvers -Valid filter fields are `system_id` and `name`. +Valid filter fields are `system_id` and `type`. ### Example ```python @@ -655,35 +1248,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Firefox Addons - api_response = api_instance.systeminsights_list_firefox_addons(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights DNS Resolvers + api_response = api_instance.systeminsights_list_dns_resolvers(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_firefox_addons: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_dns_resolvers: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsFirefoxAddons]**](SystemInsightsFirefoxAddons.md) +[**list[SystemInsightsDnsResolvers]**](SystemInsightsDnsResolvers.md) ### Authorization @@ -691,17 +1282,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_groups** -> list[SystemInsightsGroups] systeminsights_list_groups(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_etc_hosts** +> list[SystemInsightsEtcHosts] systeminsights_list_etc_hosts(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights Groups +List System Insights Etc Hosts -Valid filter fields are `system_id` and `groupname`. +Valid filter fields are `system_id` and `address`. ### Example ```python @@ -719,35 +1310,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Groups - api_response = api_instance.systeminsights_list_groups(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Etc Hosts + api_response = api_instance.systeminsights_list_etc_hosts(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_groups: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_etc_hosts: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsGroups]**](SystemInsightsGroups.md) +[**list[SystemInsightsEtcHosts]**](SystemInsightsEtcHosts.md) ### Authorization @@ -755,15 +1344,15 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_ie_extensions** -> list[SystemInsightsIeExtensions] systeminsights_list_ie_extensions(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +# **systeminsights_list_firefox_addons** +> list[SystemInsightsFirefoxAddons] systeminsights_list_firefox_addons(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights IE Extensions +List System Insights Firefox Addons Valid filter fields are `system_id` and `name`. @@ -783,35 +1372,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights IE Extensions - api_response = api_instance.systeminsights_list_ie_extensions(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + # List System Insights Firefox Addons + api_response = api_instance.systeminsights_list_firefox_addons(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_ie_extensions: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_firefox_addons: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsIeExtensions]**](SystemInsightsIeExtensions.md) +[**list[SystemInsightsFirefoxAddons]**](SystemInsightsFirefoxAddons.md) ### Authorization @@ -819,17 +1406,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_interface_addresses** -> list[SystemInsightsInterfaceAddresses] systeminsights_list_interface_addresses(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_groups** +> list[SystemInsightsGroups] systeminsights_list_groups(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights Interface Addresses +List System Insights Groups -Valid filter fields are `system_id` and `address`. +Valid filter fields are `system_id` and `groupname`. ### Example ```python @@ -847,35 +1434,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Interface Addresses - api_response = api_instance.systeminsights_list_interface_addresses(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Groups + api_response = api_instance.systeminsights_list_groups(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_interface_addresses: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_groups: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsInterfaceAddresses]**](SystemInsightsInterfaceAddresses.md) +[**list[SystemInsightsGroups]**](SystemInsightsGroups.md) ### Authorization @@ -883,17 +1468,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_kernel_info** -> list[SystemInsightsKernelInfo] systeminsights_list_kernel_info(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_ie_extensions** +> list[SystemInsightsIeExtensions] systeminsights_list_ie_extensions(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) -List System Insights Kernel Info +List System Insights IE Extensions -Valid filter fields are `system_id` and `version`. +Valid filter fields are `system_id` and `name`. ### Example ```python @@ -911,35 +1496,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Kernel Info - api_response = api_instance.systeminsights_list_kernel_info(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights IE Extensions + api_response = api_instance.systeminsights_list_ie_extensions(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_kernel_info: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_ie_extensions: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsKernelInfo]**](SystemInsightsKernelInfo.md) +[**list[SystemInsightsIeExtensions]**](SystemInsightsIeExtensions.md) ### Authorization @@ -947,17 +1530,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_launchd** -> list[SystemInsightsLaunchd] systeminsights_list_launchd(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +# **systeminsights_list_interface_addresses** +> list[SystemInsightsInterfaceAddresses] systeminsights_list_interface_addresses(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights Launchd +List System Insights Interface Addresses -Valid filter fields are `system_id` and `name`. +Valid filter fields are `system_id` and `address`. ### Example ```python @@ -975,35 +1558,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Launchd - api_response = api_instance.systeminsights_list_launchd(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + # List System Insights Interface Addresses + api_response = api_instance.systeminsights_list_interface_addresses(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_launchd: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_interface_addresses: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsLaunchd]**](SystemInsightsLaunchd.md) +[**list[SystemInsightsInterfaceAddresses]**](SystemInsightsInterfaceAddresses.md) ### Authorization @@ -1011,17 +1592,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_logged_in_users** -> list[SystemInsightsLoggedInUsers] systeminsights_list_logged_in_users(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +# **systeminsights_list_interface_details** +> list[SystemInsightsInterfaceDetails] systeminsights_list_interface_details(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights Logged-In Users +List System Insights Interface Details -Valid filter fields are `system_id` and `user`. +Valid filter fields are `system_id` and `interface`. ### Example ```python @@ -1039,35 +1620,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Logged-In Users - api_response = api_instance.systeminsights_list_logged_in_users(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + # List System Insights Interface Details + api_response = api_instance.systeminsights_list_interface_details(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_logged_in_users: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_interface_details: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsLoggedInUsers]**](SystemInsightsLoggedInUsers.md) +[**list[SystemInsightsInterfaceDetails]**](SystemInsightsInterfaceDetails.md) ### Authorization @@ -1075,17 +1654,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_logical_drives** -> list[SystemInsightsLogicalDrvies] systeminsights_list_logical_drives(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_kernel_info** +> list[SystemInsightsKernelInfo] systeminsights_list_kernel_info(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights Logical Drives +List System Insights Kernel Info -Valid filter fields are `system_id` and `device_id`. +Valid filter fields are `system_id` and `version`. ### Example ```python @@ -1103,35 +1682,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Logical Drives - api_response = api_instance.systeminsights_list_logical_drives(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Kernel Info + api_response = api_instance.systeminsights_list_kernel_info(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_logical_drives: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_kernel_info: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsLogicalDrvies]**](SystemInsightsLogicalDrvies.md) +[**list[SystemInsightsKernelInfo]**](SystemInsightsKernelInfo.md) ### Authorization @@ -1139,17 +1716,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_mounts** -> list[SystemInsightsMounts] systeminsights_list_mounts(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_launchd** +> list[SystemInsightsLaunchd] systeminsights_list_launchd(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) -List System Insights Mounts +List System Insights Launchd -Valid filter fields are `system_id` and `path`. +Valid filter fields are `system_id` and `name`. ### Example ```python @@ -1167,35 +1744,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Mounts - api_response = api_instance.systeminsights_list_mounts(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Launchd + api_response = api_instance.systeminsights_list_launchd(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_mounts: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_launchd: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsMounts]**](SystemInsightsMounts.md) +[**list[SystemInsightsLaunchd]**](SystemInsightsLaunchd.md) ### Authorization @@ -1203,17 +1778,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_os_version** -> list[SystemInsightsOsVersion] systeminsights_list_os_version(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_linux_packages** +> list[SystemInsightsLinuxPackages] systeminsights_list_linux_packages(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights OS Version +List System Insights Linux Packages -Valid filter fields are `system_id` and `version`. +Lists all programs for Linux devices. For macOS devices, use [List System Insights System Apps](#operation/systeminsights_list_apps). For windows devices, use [List System Insights System Apps](#operation/systeminsights_list_programs). Valid filter fields are `name` and `package_format`. ### Example ```python @@ -1231,35 +1806,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights OS Version - api_response = api_instance.systeminsights_list_os_version(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Linux Packages + api_response = api_instance.systeminsights_list_linux_packages(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_os_version: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_linux_packages: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsOsVersion]**](SystemInsightsOsVersion.md) +[**list[SystemInsightsLinuxPackages]**](SystemInsightsLinuxPackages.md) ### Authorization @@ -1267,17 +1840,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_patches** -> list[SystemInsightsPatches] systeminsights_list_patches(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_logged_in_users** +> list[SystemInsightsLoggedInUsers] systeminsights_list_logged_in_users(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) -List System Insights Patches +List System Insights Logged-In Users -Valid filter fields are `system_id` and `hotfix_id`. +Valid filter fields are `system_id` and `user`. ### Example ```python @@ -1295,35 +1868,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Patches - api_response = api_instance.systeminsights_list_patches(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Logged-In Users + api_response = api_instance.systeminsights_list_logged_in_users(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_patches: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_logged_in_users: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsPatches]**](SystemInsightsPatches.md) +[**list[SystemInsightsLoggedInUsers]**](SystemInsightsLoggedInUsers.md) ### Authorization @@ -1331,17 +1902,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_programs** -> list[SystemInsightsPrograms] systeminsights_list_programs(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_logical_drives** +> list[SystemInsightsLogicalDrives] systeminsights_list_logical_drives(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights Programs +List System Insights Logical Drives -Valid filter fields are `system_id` and `name`. +Valid filter fields are `system_id` and `device_id`. ### Example ```python @@ -1359,35 +1930,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Programs - api_response = api_instance.systeminsights_list_programs(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Logical Drives + api_response = api_instance.systeminsights_list_logical_drives(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_programs: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_logical_drives: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsPrograms]**](SystemInsightsPrograms.md) +[**list[SystemInsightsLogicalDrives]**](SystemInsightsLogicalDrives.md) ### Authorization @@ -1395,17 +1964,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_safari_extensions** -> list[SystemInsightsSafariExtensions] systeminsights_list_safari_extensions(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_managed_policies** +> list[SystemInsightsManagedPolicies] systeminsights_list_managed_policies(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) -List System Insights Safari Extensions +List System Insights Managed Policies -Valid filter fields are `system_id` and `name`. +Valid filter fields are `system_id` and `domain`. ### Example ```python @@ -1423,35 +1992,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Safari Extensions - api_response = api_instance.systeminsights_list_safari_extensions(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Managed Policies + api_response = api_instance.systeminsights_list_managed_policies(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_safari_extensions: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_managed_policies: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsSafariExtensions]**](SystemInsightsSafariExtensions.md) +[**list[SystemInsightsManagedPolicies]**](SystemInsightsManagedPolicies.md) ### Authorization @@ -1459,17 +2026,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_apps** -> list[SystemInsightsApps] systeminsights_list_system_apps(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_mounts** +> list[SystemInsightsMounts] systeminsights_list_mounts(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights System Apps +List System Insights Mounts -Valid filter fields are `bundle_name`. +Valid filter fields are `system_id` and `path`. ### Example ```python @@ -1487,37 +2054,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Apps - api_response = api_instance.systeminsights_list_system_apps(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Mounts + api_response = api_instance.systeminsights_list_mounts(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_apps: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_mounts: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsApps]**](SystemInsightsApps.md) +[**list[SystemInsightsMounts]**](SystemInsightsMounts.md) ### Authorization @@ -1525,17 +2088,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_bitlocker_info** -> list[SystemInsightsBitlockerInfo] systeminsights_list_system_bitlocker_info(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_os_version** +> list[SystemInsightsOsVersion] systeminsights_list_os_version(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights System Bitlocker Info +List System Insights OS Version -Valid filter fields are `protection_status`. +Valid filter fields are `system_id` and `version`. ### Example ```python @@ -1553,37 +2116,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Bitlocker Info - api_response = api_instance.systeminsights_list_system_bitlocker_info(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights OS Version + api_response = api_instance.systeminsights_list_os_version(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_bitlocker_info: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_os_version: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsBitlockerInfo]**](SystemInsightsBitlockerInfo.md) +[**list[SystemInsightsOsVersion]**](SystemInsightsOsVersion.md) ### Authorization @@ -1591,17 +2150,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_browser_plugins** -> list[SystemInsightsBrowserPlugins] systeminsights_list_system_browser_plugins(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_patches** +> list[SystemInsightsPatches] systeminsights_list_patches(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights System Browser Plugins +List System Insights Patches -Valid filter fields are `name`. +Valid filter fields are `system_id` and `hotfix_id`. ### Example ```python @@ -1619,37 +2178,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Browser Plugins - api_response = api_instance.systeminsights_list_system_browser_plugins(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Patches + api_response = api_instance.systeminsights_list_patches(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_browser_plugins: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_patches: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsBrowserPlugins]**](SystemInsightsBrowserPlugins.md) +[**list[SystemInsightsPatches]**](SystemInsightsPatches.md) ### Authorization @@ -1657,17 +2212,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_chrome_extensions** -> list[SystemInsightsChromeExtensions] systeminsights_list_system_chrome_extensions(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_programs** +> list[SystemInsightsPrograms] systeminsights_list_programs(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights System Chrome Extensions +List System Insights Programs -Valid filter fields are `name`. +Lists all programs for Windows devices. For macOS devices, use [List System Insights Apps](#operation/systeminsights_list_apps). Valid filter fields are `system_id` and `name`. ### Example ```python @@ -1685,37 +2240,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Chrome Extensions - api_response = api_instance.systeminsights_list_system_chrome_extensions(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Programs + api_response = api_instance.systeminsights_list_programs(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_chrome_extensions: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_programs: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsChromeExtensions]**](SystemInsightsChromeExtensions.md) +[**list[SystemInsightsPrograms]**](SystemInsightsPrograms.md) ### Authorization @@ -1723,15 +2274,15 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_controls** -> list[SystemInsightsSystemControls] systeminsights_list_system_controls(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_python_packages** +> list[SystemInsightsPythonPackages] systeminsights_list_python_packages(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights System Control +List System Insights Python Packages Valid filter fields are `system_id` and `name`. @@ -1751,35 +2302,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Control - api_response = api_instance.systeminsights_list_system_controls(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Python Packages + api_response = api_instance.systeminsights_list_python_packages(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_controls: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_python_packages: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsSystemControls]**](SystemInsightsSystemControls.md) +[**list[SystemInsightsPythonPackages]**](SystemInsightsPythonPackages.md) ### Authorization @@ -1787,17 +2336,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_disk_encryption** -> list[SystemInsightsDiskEncryption] systeminsights_list_system_disk_encryption(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_safari_extensions** +> list[SystemInsightsSafariExtensions] systeminsights_list_safari_extensions(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights System Disk Encryption +List System Insights Safari Extensions -Valid filter fields are `encryption_status`. +Valid filter fields are `system_id` and `name`. ### Example ```python @@ -1815,37 +2364,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Disk Encryption - api_response = api_instance.systeminsights_list_system_disk_encryption(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Safari Extensions + api_response = api_instance.systeminsights_list_safari_extensions(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_disk_encryption: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_safari_extensions: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsDiskEncryption]**](SystemInsightsDiskEncryption.md) +[**list[SystemInsightsSafariExtensions]**](SystemInsightsSafariExtensions.md) ### Authorization @@ -1853,17 +2398,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_disk_info** -> list[SystemInsightsBitlockerInfo] systeminsights_list_system_disk_info(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_scheduled_tasks** +> list[SystemInsightsScheduledTasks] systeminsights_list_scheduled_tasks(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights System Disk Info +List System Insights Scheduled Tasks -Valid filter fields are `disk_index`. +Valid filter fields are `system_id` and `enabled`. ### Example ```python @@ -1881,37 +2426,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Disk Info - api_response = api_instance.systeminsights_list_system_disk_info(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Scheduled Tasks + api_response = api_instance.systeminsights_list_scheduled_tasks(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_disk_info: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_scheduled_tasks: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsBitlockerInfo]**](SystemInsightsBitlockerInfo.md) +[**list[SystemInsightsScheduledTasks]**](SystemInsightsScheduledTasks.md) ### Authorization @@ -1919,17 +2460,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_etc_hosts** -> list[SystemInsightsBitlockerInfo] systeminsights_list_system_etc_hosts(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_secureboot** +> list[SystemInsightsSecureboot] systeminsights_list_secureboot(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights System Etc Hosts +List System Insights Secure Boot -Valid filter fields are `address`. +Valid filter fields are `system_id`. ### Example ```python @@ -1939,63 +2480,53 @@ import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint -# Configure API key authorization: x-api-key -configuration = jcapiv2.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - # create an instance of the API class -api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) +api_instance = jcapiv2.SystemInsightsApi() skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Etc Hosts - api_response = api_instance.systeminsights_list_system_etc_hosts(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Secure Boot + api_response = api_instance.systeminsights_list_secureboot(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_etc_hosts: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_secureboot: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsBitlockerInfo]**](SystemInsightsBitlockerInfo.md) +[**list[SystemInsightsSecureboot]**](SystemInsightsSecureboot.md) ### Authorization -[x-api-key](../README.md#x-api-key) +No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_firefox_addons** -> list[SystemInsightsFirefoxAddons] systeminsights_list_system_firefox_addons(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_services** +> list[SystemInsightsServices] systeminsights_list_services(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights System Firefox Addons +List System Insights Services -Valid filter fields are `name`. +Valid filter fields are `system_id` and `name`. ### Example ```python @@ -2013,37 +2544,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Firefox Addons - api_response = api_instance.systeminsights_list_system_firefox_addons(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Services + api_response = api_instance.systeminsights_list_services(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_firefox_addons: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_services: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsFirefoxAddons]**](SystemInsightsFirefoxAddons.md) +[**list[SystemInsightsServices]**](SystemInsightsServices.md) ### Authorization @@ -2051,17 +2578,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_groups** -> list[SystemInsightsGroups] systeminsights_list_system_groups(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_shadow** +> list[SystemInsightsShadow] systeminsights_list_shadow(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) -List System Insights System Groups +LIst System Insights Shadow -Valid filter fields are `groupname`. +Valid filter fields are `system_id` and `username`. ### Example ```python @@ -2079,37 +2606,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Groups - api_response = api_instance.systeminsights_list_system_groups(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # LIst System Insights Shadow + api_response = api_instance.systeminsights_list_shadow(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_groups: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_shadow: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsGroups]**](SystemInsightsGroups.md) +[**list[SystemInsightsShadow]**](SystemInsightsShadow.md) ### Authorization @@ -2117,17 +2640,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_info** -> list[SystemInsightsSystemInfo] systeminsights_list_system_info(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_shared_folders** +> list[SystemInsightsSharedFolders] systeminsights_list_shared_folders(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) -List System Insights System Info +List System Insights Shared Folders -Valid filter fields are `system_id` and `cpu_subtype`. +Valid filter fields are `system_id` and `name`. ### Example ```python @@ -2145,35 +2668,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Info - api_response = api_instance.systeminsights_list_system_info(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Shared Folders + api_response = api_instance.systeminsights_list_shared_folders(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_info: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_shared_folders: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsSystemInfo]**](SystemInsightsSystemInfo.md) +[**list[SystemInsightsSharedFolders]**](SystemInsightsSharedFolders.md) ### Authorization @@ -2181,17 +2702,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_interface_addresses** -> list[SystemInsightsInterfaceAddresses] systeminsights_list_system_interface_addresses(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_shared_resources** +> list[SystemInsightsSharedResources] systeminsights_list_shared_resources(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) -List System Insights System Interface Addresses +List System Insights Shared Resources -Valid filter fields are `address`. +Valid filter fields are `system_id` and `type`. ### Example ```python @@ -2201,63 +2722,53 @@ import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint -# Configure API key authorization: x-api-key -configuration = jcapiv2.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - # create an instance of the API class -api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) +api_instance = jcapiv2.SystemInsightsApi() +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Interface Addresses - api_response = api_instance.systeminsights_list_system_interface_addresses(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Shared Resources + api_response = api_instance.systeminsights_list_shared_resources(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_interface_addresses: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_shared_resources: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsInterfaceAddresses]**](SystemInsightsInterfaceAddresses.md) +[**list[SystemInsightsSharedResources]**](SystemInsightsSharedResources.md) ### Authorization -[x-api-key](../README.md#x-api-key) +No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_kernel_info** -> list[SystemInsightsKernelInfo] systeminsights_list_system_kernel_info(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_sharing_preferences** +> list[SystemInsightsSharingPreferences] systeminsights_list_sharing_preferences(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) -List System Insights System Kernel Info +List System Insights Sharing Preferences -Valid filter fields are `version`. +Only valid filed field is `system_id`. ### Example ```python @@ -2275,37 +2786,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Kernel Info - api_response = api_instance.systeminsights_list_system_kernel_info(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Sharing Preferences + api_response = api_instance.systeminsights_list_sharing_preferences(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_kernel_info: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_sharing_preferences: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsKernelInfo]**](SystemInsightsKernelInfo.md) +[**list[SystemInsightsSharingPreferences]**](SystemInsightsSharingPreferences.md) ### Authorization @@ -2313,17 +2820,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_logical_drives** -> list[SystemInsightsLogicalDrvies] systeminsights_list_system_logical_drives(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_sip_config** +> list[SystemInsightsSipConfig] systeminsights_list_sip_config(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) -List System Insights System Logical Drives +List System Insights SIP Config -Valid filter fields are `device_id`. +Valid filter fields are `system_id` and `enabled`. ### Example ```python @@ -2341,37 +2848,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Logical Drives - api_response = api_instance.systeminsights_list_system_logical_drives(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights SIP Config + api_response = api_instance.systeminsights_list_sip_config(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_logical_drives: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_sip_config: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsLogicalDrvies]**](SystemInsightsLogicalDrvies.md) +[**list[SystemInsightsSipConfig]**](SystemInsightsSipConfig.md) ### Authorization @@ -2379,17 +2882,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_mounts** -> list[SystemInsightsMounts] systeminsights_list_system_mounts(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_startup_items** +> list[SystemInsightsStartupItems] systeminsights_list_startup_items(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights System Mounts +List System Insights Startup Items -Valid filter fields are `path`. +Valid filter fields are `system_id` and `name`. ### Example ```python @@ -2407,37 +2910,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Mounts - api_response = api_instance.systeminsights_list_system_mounts(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Startup Items + api_response = api_instance.systeminsights_list_startup_items(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_mounts: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_startup_items: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsMounts]**](SystemInsightsMounts.md) +[**list[SystemInsightsStartupItems]**](SystemInsightsStartupItems.md) ### Authorization @@ -2445,17 +2944,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_os_version** -> list[SystemInsightsOsVersion] systeminsights_list_system_os_version(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_system_controls** +> list[SystemInsightsSystemControls] systeminsights_list_system_controls(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights System OS Version +List System Insights System Control -Valid filter fields are `version`. +Valid filter fields are `system_id` and `name`. ### Example ```python @@ -2473,37 +2972,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` Note: You can only filter by `system_id` and `name` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System OS Version - api_response = api_instance.systeminsights_list_system_os_version(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights System Control + api_response = api_instance.systeminsights_list_system_controls(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_os_version: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_system_controls: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` Note: You can only filter by `system_id` and `name` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsOsVersion]**](SystemInsightsOsVersion.md) +[**list[SystemInsightsSystemControls]**](SystemInsightsSystemControls.md) ### Authorization @@ -2511,17 +3006,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_patches** -> list[SystemInsightsPatches] systeminsights_list_system_patches(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_system_info** +> list[SystemInsightsSystemInfo] systeminsights_list_system_info(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights System Patches +List System Insights System Info -Valid filter fields are `hotfix_id `. +Valid filter fields are `system_id` and `cpu_subtype`. ### Example ```python @@ -2539,37 +3034,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Patches - api_response = api_instance.systeminsights_list_system_patches(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights System Info + api_response = api_instance.systeminsights_list_system_info(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_patches: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_system_info: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsPatches]**](SystemInsightsPatches.md) +[**list[SystemInsightsSystemInfo]**](SystemInsightsSystemInfo.md) ### Authorization @@ -2577,17 +3068,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_programs** -> list[SystemInsightsPrograms] systeminsights_list_system_programs(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_tpm_info** +> list[SystemInsightsTpmInfo] systeminsights_list_tpm_info(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights System Programs +List System Insights TPM Info -Valid filter fields are `name`. +Valid filter fields are `system_id`. ### Example ```python @@ -2597,63 +3088,53 @@ import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint -# Configure API key authorization: x-api-key -configuration = jcapiv2.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - # create an instance of the API class -api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) +api_instance = jcapiv2.SystemInsightsApi() skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Programs - api_response = api_instance.systeminsights_list_system_programs(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights TPM Info + api_response = api_instance.systeminsights_list_tpm_info(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_programs: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_tpm_info: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsPrograms]**](SystemInsightsPrograms.md) +[**list[SystemInsightsTpmInfo]**](SystemInsightsTpmInfo.md) ### Authorization -[x-api-key](../README.md#x-api-key) +No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: text/html [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_safari_extensions** -> list[SystemInsightsSafariExtensions] systeminsights_list_system_safari_extensions(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_uptime** +> list[SystemInsightsUptime] systeminsights_list_uptime(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights System Safari Extensions +List System Insights Uptime -Valid filter fields are `name`. +Valid filter fields are `system_id` and `days`. ### Example ```python @@ -2671,37 +3152,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, gte, in. e.g: Filter for single value: `filter=field:gte:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Safari Extensions - api_response = api_instance.systeminsights_list_system_safari_extensions(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Uptime + api_response = api_instance.systeminsights_list_uptime(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_safari_extensions: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_uptime: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, gte, in. e.g: Filter for single value: `filter=field:gte:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsSafariExtensions]**](SystemInsightsSafariExtensions.md) +[**list[SystemInsightsUptime]**](SystemInsightsUptime.md) ### Authorization @@ -2709,17 +3186,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_system_controls** -> list[SystemInsightsSystemControls] systeminsights_list_system_system_controls(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_usb_devices** +> list[SystemInsightsUsbDevices] systeminsights_list_usb_devices(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) -List System Insights System System Controls +List System Insights USB Devices -Valid filter fields are `name`. +Valid filter fields are `system_id` and `model`. ### Example ```python @@ -2737,37 +3214,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System System Controls - api_response = api_instance.systeminsights_list_system_system_controls(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights USB Devices + api_response = api_instance.systeminsights_list_usb_devices(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_system_controls: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_usb_devices: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsSystemControls]**](SystemInsightsSystemControls.md) +[**list[SystemInsightsUsbDevices]**](SystemInsightsUsbDevices.md) ### Authorization @@ -2775,17 +3248,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_system_info** -> list[SystemInsightsSystemInfo] systeminsights_list_system_system_info(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_user_groups** +> list[SystemInsightsUserGroups] systeminsights_list_user_groups(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) -List System Insights System System Info +List System Insights User Groups -Valid filter fields are `cpu_subtype`. +Only valid filter field is `system_id`. ### Example ```python @@ -2803,37 +3276,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System System Info - api_response = api_instance.systeminsights_list_system_system_info(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights User Groups + api_response = api_instance.systeminsights_list_user_groups(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_system_info: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_user_groups: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsSystemInfo]**](SystemInsightsSystemInfo.md) +[**list[SystemInsightsUserGroups]**](SystemInsightsUserGroups.md) ### Authorization @@ -2841,17 +3310,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_uptime** -> list[SystemInsightsUptime] systeminsights_list_system_uptime(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_user_ssh_keys** +> list[SystemInsightsUserSshKeys] systeminsights_list_user_ssh_keys(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) -List System Insights System Uptime +List System Insights User SSH Keys -Valid filter fields are `days`. +Valid filter fields are `system_id` and `uid`. ### Example ```python @@ -2869,37 +3338,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Uptime - api_response = api_instance.systeminsights_list_system_uptime(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights User SSH Keys + api_response = api_instance.systeminsights_list_user_ssh_keys(x_org_id=x_org_id, skip=skip, sort=sort, filter=filter, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_uptime: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_user_ssh_keys: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsUptime]**](SystemInsightsUptime.md) +[**list[SystemInsightsUserSshKeys]**](SystemInsightsUserSshKeys.md) ### Authorization @@ -2907,17 +3372,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_system_users** -> list[SystemInsightsUsers] systeminsights_list_system_users(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_userassist** +> list[SystemInsightsUserassist] systeminsights_list_userassist(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights System Users +List System Insights User Assist -Valid filter fields are `username`. +Valid filter fields are `system_id`. ### Example ```python @@ -2927,63 +3392,53 @@ import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint -# Configure API key authorization: x-api-key -configuration = jcapiv2.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - # create an instance of the API class -api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -system_id = 'system_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) +api_instance = jcapiv2.SystemInsightsApi() skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights System Users - api_response = api_instance.systeminsights_list_system_users(system_id, content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights User Assist + api_response = api_instance.systeminsights_list_userassist(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_system_users: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_userassist: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **system_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsUsers]**](SystemInsightsUsers.md) +[**list[SystemInsightsUserassist]**](SystemInsightsUserassist.md) ### Authorization -[x-api-key](../README.md#x-api-key) +No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_uptime** -> list[SystemInsightsUptime] systeminsights_list_uptime(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_users** +> list[SystemInsightsUsers] systeminsights_list_users(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights Uptime +List System Insights Users -Valid filter fields are `system_id` and `days`. +Valid filter fields are `system_id` and `username`. ### Example ```python @@ -3001,35 +3456,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Uptime - api_response = api_instance.systeminsights_list_uptime(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Users + api_response = api_instance.systeminsights_list_users(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_uptime: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_users: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsUptime]**](SystemInsightsUptime.md) +[**list[SystemInsightsUsers]**](SystemInsightsUsers.md) ### Authorization @@ -3037,17 +3490,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_usb_devices** -> list[SystemInsightsUsbDevices] systeminsights_list_usb_devices(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +# **systeminsights_list_wifi_networks** +> list[SystemInsightsWifiNetworks] systeminsights_list_wifi_networks(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights USB Devices +List System Insights WiFi Networks -Valid filter fields are `system_id` and `model`. +Valid filter fields are `system_id` and `security_type`. ### Example ```python @@ -3065,35 +3518,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights USB Devices - api_response = api_instance.systeminsights_list_usb_devices(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + # List System Insights WiFi Networks + api_response = api_instance.systeminsights_list_wifi_networks(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_usb_devices: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_wifi_networks: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsUsbDevices]**](SystemInsightsUsbDevices.md) +[**list[SystemInsightsWifiNetworks]**](SystemInsightsWifiNetworks.md) ### Authorization @@ -3101,17 +3552,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_user_groups** -> list[SystemInsightsUserGroups] systeminsights_list_user_groups(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +# **systeminsights_list_wifi_status** +> list[SystemInsightsWifiStatus] systeminsights_list_wifi_status(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights User Groups +List System Insights WiFi Status -Only valid filter field is `system_id`. +Valid filter fields are `system_id` and `security_type`. ### Example ```python @@ -3129,35 +3580,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights User Groups - api_response = api_instance.systeminsights_list_user_groups(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + # List System Insights WiFi Status + api_response = api_instance.systeminsights_list_wifi_status(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_user_groups: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_wifi_status: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsUserGroups]**](SystemInsightsUserGroups.md) +[**list[SystemInsightsWifiStatus]**](SystemInsightsWifiStatus.md) ### Authorization @@ -3165,17 +3614,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_users** -> list[SystemInsightsUsers] systeminsights_list_users(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) +# **systeminsights_list_windows_security_center** +> list[SystemInsightsWindowsSecurityCenter] systeminsights_list_windows_security_center(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights Users +List System Insights Windows Security Center -Valid filter fields are `system_id` and `username`. +Valid filter fields are `system_id`. ### Example ```python @@ -3185,61 +3634,53 @@ import jcapiv2 from jcapiv2.rest import ApiException from pprint import pprint -# Configure API key authorization: x-api-key -configuration = jcapiv2.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - # create an instance of the API class -api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) +api_instance = jcapiv2.SystemInsightsApi() skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Users - api_response = api_instance.systeminsights_list_users(content_type, accept, limit=limit, skip=skip, filter=filter, x_org_id=x_org_id) + # List System Insights Windows Security Center + api_response = api_instance.systeminsights_list_windows_security_center(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_users: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_windows_security_center: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsUsers]**](SystemInsightsUsers.md) +[**list[SystemInsightsWindowsSecurityCenter]**](SystemInsightsWindowsSecurityCenter.md) ### Authorization -[x-api-key](../README.md#x-api-key) +No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **systeminsights_list_windows_crashes** -> list[SystemInsightsWindowsCrashes] systeminsights_list_windows_crashes(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +# **systeminsights_list_windows_security_products** +> list[SystemInsightsWindowsSecurityProducts] systeminsights_list_windows_security_products(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) -List System Insights Windows Crashes +List System Insights Windows Security Products -Valid filter fields are `system_id` and `type`. +Valid filter fields are `system_id` and `state`. ### Example ```python @@ -3257,35 +3698,33 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemInsightsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -limit = 10 # int | (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq (optional) (default to []) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` (optional) +filter = ['filter_example'] # list[str] | Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | (optional) (default to 10) try: - # List System Insights Windows Crashes - api_response = api_instance.systeminsights_list_windows_crashes(content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + # List System Insights Windows Security Products + api_response = api_instance.systeminsights_list_windows_security_products(skip=skip, sort=sort, filter=filter, x_org_id=x_org_id, limit=limit) pprint(api_response) except ApiException as e: - print("Exception when calling SystemInsightsApi->systeminsights_list_windows_crashes: %s\n" % e) + print("Exception when calling SystemInsightsApi->systeminsights_list_windows_security_products: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **limit** | **int**| | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq | [optional] [default to []] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | [optional] + **filter** | [**list[str]**](str.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| | [optional] [default to 10] ### Return type -[**list[SystemInsightsWindowsCrashes]**](SystemInsightsWindowsCrashes.md) +[**list[SystemInsightsWindowsSecurityProducts]**](SystemInsightsWindowsSecurityProducts.md) ### Authorization @@ -3293,7 +3732,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/SystemInsightsAppcompatShims.md b/jcapiv2/docs/SystemInsightsAppcompatShims.md new file mode 100644 index 0000000..db31a80 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsAppcompatShims.md @@ -0,0 +1,16 @@ +# SystemInsightsAppcompatShims + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collection_time** | **str** | | [optional] +**description** | **str** | | [optional] +**executable** | **str** | | [optional] +**install_time** | **float** | | [optional] +**path** | **str** | | [optional] +**sdb_id** | **str** | | [optional] +**system_id** | **str** | | [optional] +**type** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsApps.md b/jcapiv2/docs/SystemInsightsApps.md index 93d4259..1825451 100644 --- a/jcapiv2/docs/SystemInsightsApps.md +++ b/jcapiv2/docs/SystemInsightsApps.md @@ -27,4 +27,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsAuthorizedKeys.md b/jcapiv2/docs/SystemInsightsAuthorizedKeys.md new file mode 100644 index 0000000..2401ef7 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsAuthorizedKeys.md @@ -0,0 +1,14 @@ +# SystemInsightsAuthorizedKeys + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**algorithm** | **str** | | [optional] +**collection_time** | **str** | | [optional] +**key** | **str** | | [optional] +**key_file** | **str** | | [optional] +**system_id** | **str** | | [optional] +**uid** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsAzureInstanceMetadata.md b/jcapiv2/docs/SystemInsightsAzureInstanceMetadata.md new file mode 100644 index 0000000..2148574 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsAzureInstanceMetadata.md @@ -0,0 +1,26 @@ +# SystemInsightsAzureInstanceMetadata + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collection_time** | **str** | | [optional] +**location** | **str** | | [optional] +**name** | **str** | | [optional] +**offer** | **str** | | [optional] +**os_type** | **str** | | [optional] +**placement_group_id** | **str** | | [optional] +**platform_fault_domain** | **str** | | [optional] +**platform_update_domain** | **str** | | [optional] +**publisher** | **str** | | [optional] +**resource_group_name** | **str** | | [optional] +**sku** | **str** | | [optional] +**subscription_id** | **str** | | [optional] +**system_id** | **str** | | [optional] +**version** | **str** | | [optional] +**vm_id** | **str** | | [optional] +**vm_scale_set_name** | **str** | | [optional] +**vm_size** | **str** | | [optional] +**zone** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsAzureInstanceTags.md b/jcapiv2/docs/SystemInsightsAzureInstanceTags.md new file mode 100644 index 0000000..450eb71 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsAzureInstanceTags.md @@ -0,0 +1,13 @@ +# SystemInsightsAzureInstanceTags + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collection_time** | **str** | | [optional] +**key** | **str** | | [optional] +**system_id** | **str** | | [optional] +**value** | **str** | | [optional] +**vm_id** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsBattery.md b/jcapiv2/docs/SystemInsightsBattery.md index 8553250..1c42f89 100644 --- a/jcapiv2/docs/SystemInsightsBattery.md +++ b/jcapiv2/docs/SystemInsightsBattery.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**amgerage** | **int** | | [optional] +**amperage** | **int** | | [optional] **charged** | **int** | | [optional] **charging** | **int** | | [optional] **collection_time** | **str** | | [optional] @@ -26,4 +26,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsBitlockerInfo.md b/jcapiv2/docs/SystemInsightsBitlockerInfo.md index 9bb7659..7d93bdd 100644 --- a/jcapiv2/docs/SystemInsightsBitlockerInfo.md +++ b/jcapiv2/docs/SystemInsightsBitlockerInfo.md @@ -14,4 +14,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsBrowserPlugins.md b/jcapiv2/docs/SystemInsightsBrowserPlugins.md index 5f9c804..d64a9b2 100644 --- a/jcapiv2/docs/SystemInsightsBrowserPlugins.md +++ b/jcapiv2/docs/SystemInsightsBrowserPlugins.md @@ -18,4 +18,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsCertificates.md b/jcapiv2/docs/SystemInsightsCertificates.md new file mode 100644 index 0000000..21ff9c9 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsCertificates.md @@ -0,0 +1,30 @@ +# SystemInsightsCertificates + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**authority_key_id** | **str** | | [optional] +**ca** | **int** | | [optional] +**common_name** | **str** | | [optional] +**issuer** | **str** | | [optional] +**key_algorithm** | **str** | | [optional] +**key_strength** | **str** | | [optional] +**key_usage** | **str** | | [optional] +**not_valid_after** | **str** | | [optional] +**not_valid_before** | **str** | | [optional] +**path** | **str** | | [optional] +**self_signed** | **int** | | [optional] +**serial** | **str** | | [optional] +**sha1** | **str** | | [optional] +**sid** | **str** | | [optional] +**signing_algorithm** | **str** | | [optional] +**store** | **str** | | [optional] +**store_id** | **str** | | [optional] +**store_location** | **str** | | [optional] +**subject** | **str** | | [optional] +**subject_key_id** | **str** | | [optional] +**system_id** | **str** | | [optional] +**username** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsChassisInfo.md b/jcapiv2/docs/SystemInsightsChassisInfo.md new file mode 100644 index 0000000..800683a --- /dev/null +++ b/jcapiv2/docs/SystemInsightsChassisInfo.md @@ -0,0 +1,23 @@ +# SystemInsightsChassisInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**audible_alarm** | **str** | | [optional] +**breach_description** | **str** | | [optional] +**chassis_types** | **str** | | [optional] +**collection_time** | **str** | | [optional] +**description** | **str** | | [optional] +**lock** | **str** | | [optional] +**manufacturer** | **str** | | [optional] +**model** | **str** | | [optional] +**security_breach** | **str** | | [optional] +**serial** | **str** | | [optional] +**sku** | **str** | | [optional] +**smbios_tag** | **str** | | [optional] +**status** | **str** | | [optional] +**system_id** | **str** | | [optional] +**visible_alarm** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsChromeExtensions.md b/jcapiv2/docs/SystemInsightsChromeExtensions.md index 96eea55..0d88f46 100644 --- a/jcapiv2/docs/SystemInsightsChromeExtensions.md +++ b/jcapiv2/docs/SystemInsightsChromeExtensions.md @@ -19,4 +19,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsConnectivity.md b/jcapiv2/docs/SystemInsightsConnectivity.md new file mode 100644 index 0000000..103ded3 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsConnectivity.md @@ -0,0 +1,19 @@ +# SystemInsightsConnectivity + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collection_time** | **str** | | [optional] +**disconnected** | **int** | | [optional] +**ipv4_internet** | **int** | | [optional] +**ipv4_local_network** | **int** | | [optional] +**ipv4_no_traffic** | **int** | | [optional] +**ipv4_subnet** | **int** | | [optional] +**ipv6_internet** | **int** | | [optional] +**ipv6_local_network** | **int** | | [optional] +**ipv6_no_traffic** | **int** | | [optional] +**ipv6_subnet** | **int** | | [optional] +**system_id** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsCrashes.md b/jcapiv2/docs/SystemInsightsCrashes.md index 83fba9b..fcc6d43 100644 --- a/jcapiv2/docs/SystemInsightsCrashes.md +++ b/jcapiv2/docs/SystemInsightsCrashes.md @@ -3,6 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**collection_time** | **str** | | [optional] **crash_path** | **str** | | [optional] **crashed_thread** | **str** | | [optional] **_datetime** | **str** | | [optional] @@ -16,10 +17,10 @@ Name | Type | Description | Notes **registers** | **str** | | [optional] **responsible** | **str** | | [optional] **stack_trace** | **str** | | [optional] +**system_id** | **str** | | [optional] **type** | **str** | | [optional] **uid** | **int** | | [optional] **version** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsCupsDestinations.md b/jcapiv2/docs/SystemInsightsCupsDestinations.md new file mode 100644 index 0000000..d3a5da4 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsCupsDestinations.md @@ -0,0 +1,12 @@ +# SystemInsightsCupsDestinations + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**option_name** | **str** | | [optional] +**option_value** | **str** | | [optional] +**system_id** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsDiskEncryption.md b/jcapiv2/docs/SystemInsightsDiskEncryption.md index 716d8ad..8a18a3e 100644 --- a/jcapiv2/docs/SystemInsightsDiskEncryption.md +++ b/jcapiv2/docs/SystemInsightsDiskEncryption.md @@ -15,4 +15,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsDiskInfo.md b/jcapiv2/docs/SystemInsightsDiskInfo.md index b099eee..3093fe4 100644 --- a/jcapiv2/docs/SystemInsightsDiskInfo.md +++ b/jcapiv2/docs/SystemInsightsDiskInfo.md @@ -19,4 +19,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsDnsResolvers.md b/jcapiv2/docs/SystemInsightsDnsResolvers.md new file mode 100644 index 0000000..ea65512 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsDnsResolvers.md @@ -0,0 +1,15 @@ +# SystemInsightsDnsResolvers + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **str** | | [optional] +**collection_time** | **str** | | [optional] +**id** | **float** | | [optional] +**netmask** | **str** | | [optional] +**options** | **str** | | [optional] +**system_id** | **str** | | [optional] +**type** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsEtcHosts.md b/jcapiv2/docs/SystemInsightsEtcHosts.md index 5a51d8d..93b10d5 100644 --- a/jcapiv2/docs/SystemInsightsEtcHosts.md +++ b/jcapiv2/docs/SystemInsightsEtcHosts.md @@ -10,4 +10,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsFirefoxAddons.md b/jcapiv2/docs/SystemInsightsFirefoxAddons.md index 76d818f..ef3daac 100644 --- a/jcapiv2/docs/SystemInsightsFirefoxAddons.md +++ b/jcapiv2/docs/SystemInsightsFirefoxAddons.md @@ -22,4 +22,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsGroups.md b/jcapiv2/docs/SystemInsightsGroups.md index b001aa7..90a0693 100644 --- a/jcapiv2/docs/SystemInsightsGroups.md +++ b/jcapiv2/docs/SystemInsightsGroups.md @@ -13,4 +13,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsIeExtensions.md b/jcapiv2/docs/SystemInsightsIeExtensions.md index ca7b097..97f61ce 100644 --- a/jcapiv2/docs/SystemInsightsIeExtensions.md +++ b/jcapiv2/docs/SystemInsightsIeExtensions.md @@ -12,4 +12,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsInterfaceAddresses.md b/jcapiv2/docs/SystemInsightsInterfaceAddresses.md index b6f07b9..0d9d948 100644 --- a/jcapiv2/docs/SystemInsightsInterfaceAddresses.md +++ b/jcapiv2/docs/SystemInsightsInterfaceAddresses.md @@ -15,4 +15,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsInterfaceDetails.md b/jcapiv2/docs/SystemInsightsInterfaceDetails.md new file mode 100644 index 0000000..a04b1a5 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsInterfaceDetails.md @@ -0,0 +1,44 @@ +# SystemInsightsInterfaceDetails + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collisions** | **str** | | [optional] +**connection_id** | **str** | | [optional] +**connection_status** | **str** | | [optional] +**description** | **str** | | [optional] +**dhcp_enabled** | **int** | | [optional] +**dhcp_lease_expires** | **str** | | [optional] +**dhcp_lease_obtained** | **str** | | [optional] +**dhcp_server** | **str** | | [optional] +**dns_domain** | **str** | | [optional] +**dns_domain_suffix_search_order** | **str** | | [optional] +**dns_host_name** | **str** | | [optional] +**dns_server_search_order** | **str** | | [optional] +**enabled** | **int** | | [optional] +**flags** | **int** | | [optional] +**friendly_name** | **str** | | [optional] +**ibytes** | **str** | | [optional] +**idrops** | **str** | | [optional] +**ierrors** | **str** | | [optional] +**interface** | **str** | | [optional] +**ipackets** | **str** | | [optional] +**last_change** | **str** | | [optional] +**link_speed** | **str** | | [optional] +**mac** | **str** | | [optional] +**manufacturer** | **str** | | [optional] +**metric** | **int** | | [optional] +**mtu** | **int** | | [optional] +**obytes** | **str** | | [optional] +**odrops** | **str** | | [optional] +**oerrors** | **str** | | [optional] +**opackets** | **str** | | [optional] +**pci_slot** | **str** | | [optional] +**physical_adapter** | **int** | | [optional] +**service** | **str** | | [optional] +**speed** | **int** | | [optional] +**system_id** | **str** | | [optional] +**type** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsKernelInfo.md b/jcapiv2/docs/SystemInsightsKernelInfo.md index 98097cc..d24e567 100644 --- a/jcapiv2/docs/SystemInsightsKernelInfo.md +++ b/jcapiv2/docs/SystemInsightsKernelInfo.md @@ -12,4 +12,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsLaunchd.md b/jcapiv2/docs/SystemInsightsLaunchd.md index 0341052..7c0b0a5 100644 --- a/jcapiv2/docs/SystemInsightsLaunchd.md +++ b/jcapiv2/docs/SystemInsightsLaunchd.md @@ -29,4 +29,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsLinuxPackages.md b/jcapiv2/docs/SystemInsightsLinuxPackages.md new file mode 100644 index 0000000..69bcdbe --- /dev/null +++ b/jcapiv2/docs/SystemInsightsLinuxPackages.md @@ -0,0 +1,20 @@ +# SystemInsightsLinuxPackages + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arch** | **str** | | [optional] +**install_time** | **int** | | [optional] +**maintainer_or_vendor** | **str** | | [optional] +**mount_namespace_id** | **str** | | [optional] +**name** | **str** | | [optional] +**package_format** | **str** | | [optional] +**package_group_or_section** | **str** | | [optional] +**pid_with_namespace** | **int** | | [optional] +**release_or_revision** | **str** | | [optional] +**size** | **str** | | [optional] +**system_id** | **str** | | [optional] +**version** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsLoggedInUsers.md b/jcapiv2/docs/SystemInsightsLoggedInUsers.md index 7a50f14..0785632 100644 --- a/jcapiv2/docs/SystemInsightsLoggedInUsers.md +++ b/jcapiv2/docs/SystemInsightsLoggedInUsers.md @@ -14,4 +14,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsLogicalDrvies.md b/jcapiv2/docs/SystemInsightsLogicalDrives.md similarity index 95% rename from jcapiv2/docs/SystemInsightsLogicalDrvies.md rename to jcapiv2/docs/SystemInsightsLogicalDrives.md index 982fe6c..3f18333 100644 --- a/jcapiv2/docs/SystemInsightsLogicalDrvies.md +++ b/jcapiv2/docs/SystemInsightsLogicalDrives.md @@ -1,4 +1,4 @@ -# SystemInsightsLogicalDrvies +# SystemInsightsLogicalDrives ## Properties Name | Type | Description | Notes @@ -14,4 +14,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsManagedPolicies.md b/jcapiv2/docs/SystemInsightsManagedPolicies.md new file mode 100644 index 0000000..19fe251 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsManagedPolicies.md @@ -0,0 +1,16 @@ +# SystemInsightsManagedPolicies + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collection_time** | **str** | | [optional] +**domain** | **str** | | [optional] +**manual** | **int** | | [optional] +**name** | **str** | | [optional] +**system_id** | **str** | | [optional] +**username** | **str** | | [optional] +**uuid** | **str** | | [optional] +**value** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsMounts.md b/jcapiv2/docs/SystemInsightsMounts.md index 7be2387..f709cae 100644 --- a/jcapiv2/docs/SystemInsightsMounts.md +++ b/jcapiv2/docs/SystemInsightsMounts.md @@ -19,4 +19,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsOsVersion.md b/jcapiv2/docs/SystemInsightsOsVersion.md index b1188fc..92726ad 100644 --- a/jcapiv2/docs/SystemInsightsOsVersion.md +++ b/jcapiv2/docs/SystemInsightsOsVersion.md @@ -18,4 +18,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsPatches.md b/jcapiv2/docs/SystemInsightsPatches.md index 138a595..9c5b5c6 100644 --- a/jcapiv2/docs/SystemInsightsPatches.md +++ b/jcapiv2/docs/SystemInsightsPatches.md @@ -16,4 +16,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsPrograms.md b/jcapiv2/docs/SystemInsightsPrograms.md index a6d549d..335310c 100644 --- a/jcapiv2/docs/SystemInsightsPrograms.md +++ b/jcapiv2/docs/SystemInsightsPrograms.md @@ -17,4 +17,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsPythonPackages.md b/jcapiv2/docs/SystemInsightsPythonPackages.md new file mode 100644 index 0000000..99b7912 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsPythonPackages.md @@ -0,0 +1,16 @@ +# SystemInsightsPythonPackages + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auther** | **str** | | [optional] +**directory** | **str** | | [optional] +**license** | **str** | | [optional] +**name** | **str** | | [optional] +**path** | **str** | | [optional] +**summary** | **str** | | [optional] +**system_id** | **str** | | [optional] +**version** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsSafariExtensions.md b/jcapiv2/docs/SystemInsightsSafariExtensions.md index 65b4099..df9957d 100644 --- a/jcapiv2/docs/SystemInsightsSafariExtensions.md +++ b/jcapiv2/docs/SystemInsightsSafariExtensions.md @@ -18,4 +18,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsScheduledTasks.md b/jcapiv2/docs/SystemInsightsScheduledTasks.md new file mode 100644 index 0000000..c9bc013 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsScheduledTasks.md @@ -0,0 +1,19 @@ +# SystemInsightsScheduledTasks + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **str** | | [optional] +**enabled** | **int** | | [optional] +**hidden** | **int** | | [optional] +**last_run_code** | **str** | | [optional] +**last_run_message** | **str** | | [optional] +**last_run_time** | **str** | | [optional] +**name** | **str** | | [optional] +**next_run_time** | **str** | | [optional] +**path** | **str** | | [optional] +**state** | **str** | | [optional] +**system_id** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsSecureboot.md b/jcapiv2/docs/SystemInsightsSecureboot.md new file mode 100644 index 0000000..6aa8d33 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsSecureboot.md @@ -0,0 +1,12 @@ +# SystemInsightsSecureboot + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collection_time** | **str** | | [optional] +**secure_boot** | **float** | | [optional] +**setup_mode** | **float** | | [optional] +**system_id** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsServices.md b/jcapiv2/docs/SystemInsightsServices.md new file mode 100644 index 0000000..0698c4c --- /dev/null +++ b/jcapiv2/docs/SystemInsightsServices.md @@ -0,0 +1,21 @@ +# SystemInsightsServices + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**display_name** | **str** | | [optional] +**module_path** | **str** | | [optional] +**name** | **str** | | [optional] +**path** | **str** | | [optional] +**pid** | **int** | | [optional] +**service_exit_code** | **int** | | [optional] +**service_type** | **str** | | [optional] +**start_type** | **str** | | [optional] +**status** | **str** | | [optional] +**system_id** | **str** | | [optional] +**user_account** | **str** | | [optional] +**win32_exit_code** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsShadow.md b/jcapiv2/docs/SystemInsightsShadow.md new file mode 100644 index 0000000..1048a33 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsShadow.md @@ -0,0 +1,20 @@ +# SystemInsightsShadow + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collection_time** | **str** | | [optional] +**expire** | **str** | | [optional] +**flag** | **str** | | [optional] +**hash_alg** | **str** | | [optional] +**inactive** | **str** | | [optional] +**last_change** | **str** | | [optional] +**max** | **str** | | [optional] +**min** | **str** | | [optional] +**password_status** | **str** | | [optional] +**system_id** | **str** | | [optional] +**username** | **str** | | [optional] +**warning** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsSharedFolders.md b/jcapiv2/docs/SystemInsightsSharedFolders.md new file mode 100644 index 0000000..68860a1 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsSharedFolders.md @@ -0,0 +1,12 @@ +# SystemInsightsSharedFolders + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collection_time** | **str** | | [optional] +**name** | **str** | | [optional] +**path** | **str** | | [optional] +**system_id** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsSharedResources.md b/jcapiv2/docs/SystemInsightsSharedResources.md new file mode 100644 index 0000000..4b6b32e --- /dev/null +++ b/jcapiv2/docs/SystemInsightsSharedResources.md @@ -0,0 +1,18 @@ +# SystemInsightsSharedResources + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allow_maximum** | **int** | | [optional] +**collection_time** | **str** | | [optional] +**description** | **str** | | [optional] +**install_date** | **str** | | [optional] +**maximum_allowed** | **int** | | [optional] +**name** | **str** | | [optional] +**path** | **str** | | [optional] +**status** | **str** | | [optional] +**system_id** | **str** | | [optional] +**type** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsSharingPreferences.md b/jcapiv2/docs/SystemInsightsSharingPreferences.md new file mode 100644 index 0000000..295d48d --- /dev/null +++ b/jcapiv2/docs/SystemInsightsSharingPreferences.md @@ -0,0 +1,20 @@ +# SystemInsightsSharingPreferences + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bluetooth_sharing** | **int** | | [optional] +**collection_time** | **str** | | [optional] +**content_caching** | **int** | | [optional] +**disc_sharing** | **int** | | [optional] +**file_sharing** | **int** | | [optional] +**internet_sharing** | **int** | | [optional] +**printer_sharing** | **int** | | [optional] +**remote_apple_events** | **int** | | [optional] +**remote_login** | **int** | | [optional] +**remote_management** | **int** | | [optional] +**screen_sharing** | **int** | | [optional] +**system_id** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsSipConfig.md b/jcapiv2/docs/SystemInsightsSipConfig.md new file mode 100644 index 0000000..83d759f --- /dev/null +++ b/jcapiv2/docs/SystemInsightsSipConfig.md @@ -0,0 +1,13 @@ +# SystemInsightsSipConfig + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collection_time** | **str** | | [optional] +**config_flag** | **str** | | [optional] +**enabled** | **int** | | [optional] +**enabled_nvram** | **int** | | [optional] +**system_id** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/JobDetails.md b/jcapiv2/docs/SystemInsightsStartupItems.md similarity index 56% rename from jcapiv2/docs/JobDetails.md rename to jcapiv2/docs/SystemInsightsStartupItems.md index ed4ec6a..8f48238 100644 --- a/jcapiv2/docs/JobDetails.md +++ b/jcapiv2/docs/SystemInsightsStartupItems.md @@ -1,17 +1,16 @@ -# JobDetails +# SystemInsightsStartupItems ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**admin_id** | **str** | | [optional] -**id** | **str** | | [optional] -**meta** | **object** | | [optional] +**args** | **str** | | [optional] **name** | **str** | | [optional] -**persisted_fields** | **list[str]** | | [optional] +**path** | **str** | | [optional] +**source** | **str** | | [optional] **status** | **str** | | [optional] -**updated_at** | **str** | | [optional] -**work_units_count** | **int** | | [optional] +**system_id** | **str** | | [optional] +**type** | **str** | | [optional] +**username** | **str** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsSystemControls.md b/jcapiv2/docs/SystemInsightsSystemControls.md index 85f137f..9da694d 100644 --- a/jcapiv2/docs/SystemInsightsSystemControls.md +++ b/jcapiv2/docs/SystemInsightsSystemControls.md @@ -15,4 +15,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsSystemInfo.md b/jcapiv2/docs/SystemInsightsSystemInfo.md index 690ca88..f2b0f07 100644 --- a/jcapiv2/docs/SystemInsightsSystemInfo.md +++ b/jcapiv2/docs/SystemInsightsSystemInfo.md @@ -23,4 +23,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsTpmInfo.md b/jcapiv2/docs/SystemInsightsTpmInfo.md new file mode 100644 index 0000000..2687440 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsTpmInfo.md @@ -0,0 +1,19 @@ +# SystemInsightsTpmInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**activated** | **float** | | [optional] +**collection_time** | **str** | | [optional] +**enabled** | **float** | | [optional] +**manufacturer_id** | **float** | | [optional] +**manufacturer_name** | **str** | | [optional] +**manufacturer_version** | **str** | | [optional] +**owned** | **float** | | [optional] +**physical_presence_version** | **str** | | [optional] +**product_name** | **str** | | [optional] +**spec_version** | **str** | | [optional] +**system_id** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsUptime.md b/jcapiv2/docs/SystemInsightsUptime.md index 7338213..15de3d1 100644 --- a/jcapiv2/docs/SystemInsightsUptime.md +++ b/jcapiv2/docs/SystemInsightsUptime.md @@ -13,4 +13,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsUsbDevices.md b/jcapiv2/docs/SystemInsightsUsbDevices.md index e32a71c..4849403 100644 --- a/jcapiv2/docs/SystemInsightsUsbDevices.md +++ b/jcapiv2/docs/SystemInsightsUsbDevices.md @@ -20,4 +20,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsUserGroups.md b/jcapiv2/docs/SystemInsightsUserGroups.md index 305e62e..7a2c310 100644 --- a/jcapiv2/docs/SystemInsightsUserGroups.md +++ b/jcapiv2/docs/SystemInsightsUserGroups.md @@ -10,4 +10,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsUserSshKeys.md b/jcapiv2/docs/SystemInsightsUserSshKeys.md new file mode 100644 index 0000000..8917287 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsUserSshKeys.md @@ -0,0 +1,13 @@ +# SystemInsightsUserSshKeys + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collection_time** | **str** | | [optional] +**encrypted** | **int** | | [optional] +**path** | **str** | | [optional] +**system_id** | **str** | | [optional] +**uid** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsUserassist.md b/jcapiv2/docs/SystemInsightsUserassist.md new file mode 100644 index 0000000..eab76dd --- /dev/null +++ b/jcapiv2/docs/SystemInsightsUserassist.md @@ -0,0 +1,14 @@ +# SystemInsightsUserassist + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collection_time** | **str** | | [optional] +**count** | **float** | | [optional] +**last_execution_time** | **float** | | [optional] +**path** | **str** | | [optional] +**sid** | **str** | | [optional] +**system_id** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsUsers.md b/jcapiv2/docs/SystemInsightsUsers.md index c0c695f..84d61a1 100644 --- a/jcapiv2/docs/SystemInsightsUsers.md +++ b/jcapiv2/docs/SystemInsightsUsers.md @@ -3,12 +3,18 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**ad_managed** | **bool** | Indicates this account belongs to a AD-managed user | [optional] +**admin** | **bool** | Indicates this account has local administrator privileges | [optional] **collection_time** | **str** | | [optional] **description** | **str** | | [optional] **directory** | **str** | | [optional] **gid** | **str** | | [optional] **gid_signed** | **str** | | [optional] +**last_login** | **str** | A Unix timestamp showing the last time this user logged in | [optional] +**managed** | **bool** | Indicates this account belongs to a JumpCloud-managed user | [optional] +**real_user** | **bool** | Indicates this account represents an interactive user account vs. a system or daemon account | [optional] **shell** | **str** | | [optional] +**suspended** | **bool** | Indicates this account is suspended or locked out | [optional] **system_id** | **str** | | [optional] **type** | **str** | | [optional] **uid** | **str** | | [optional] @@ -18,4 +24,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsWifiNetworks.md b/jcapiv2/docs/SystemInsightsWifiNetworks.md new file mode 100644 index 0000000..8547b4e --- /dev/null +++ b/jcapiv2/docs/SystemInsightsWifiNetworks.md @@ -0,0 +1,22 @@ +# SystemInsightsWifiNetworks + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auto_login** | **float** | | [optional] +**captive_portal** | **float** | | [optional] +**collection_time** | **str** | | [optional] +**disabled** | **float** | | [optional] +**last_connected** | **float** | | [optional] +**network_name** | **str** | | [optional] +**passpoint** | **float** | | [optional] +**possibly_hidden** | **float** | | [optional] +**roaming** | **float** | | [optional] +**roaming_profile** | **str** | | [optional] +**security_type** | **str** | | [optional] +**ssid** | **str** | | [optional] +**system_id** | **str** | | [optional] +**temporarily_disabled** | **float** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsWifiStatus.md b/jcapiv2/docs/SystemInsightsWifiStatus.md new file mode 100644 index 0000000..c4c7a69 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsWifiStatus.md @@ -0,0 +1,23 @@ +# SystemInsightsWifiStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bssid** | **str** | | [optional] +**channel** | **float** | | [optional] +**channel_band** | **float** | | [optional] +**channel_width** | **float** | | [optional] +**collection_time** | **str** | | [optional] +**country_code** | **str** | | [optional] +**interface** | **str** | | [optional] +**mode** | **str** | | [optional] +**network_name** | **str** | | [optional] +**noise** | **float** | | [optional] +**rssi** | **float** | | [optional] +**security_type** | **str** | | [optional] +**ssid** | **str** | | [optional] +**system_id** | **str** | | [optional] +**transmit_rate** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsWindowsCrashes.md b/jcapiv2/docs/SystemInsightsWindowsCrashes.md deleted file mode 100644 index e76defa..0000000 --- a/jcapiv2/docs/SystemInsightsWindowsCrashes.md +++ /dev/null @@ -1,30 +0,0 @@ -# SystemInsightsWindowsCrashes - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**build_number** | **int** | | [optional] -**command_line** | **str** | | [optional] -**crash_path** | **str** | | [optional] -**current_directory** | **str** | | [optional] -**_datetime** | **str** | | [optional] -**exception_address** | **str** | | [optional] -**exception_code** | **str** | | [optional] -**exception_message** | **str** | | [optional] -**machine_name** | **str** | | [optional] -**major_version** | **int** | | [optional] -**minor_version** | **int** | | [optional] -**module** | **str** | | [optional] -**path** | **str** | | [optional] -**pid** | **str** | | [optional] -**process_uptime** | **str** | | [optional] -**registers** | **str** | | [optional] -**stack_trace** | **str** | | [optional] -**tid** | **str** | | [optional] -**type** | **str** | | [optional] -**username** | **str** | | [optional] -**version** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv2/docs/SystemInsightsWindowsSecurityCenter.md b/jcapiv2/docs/SystemInsightsWindowsSecurityCenter.md new file mode 100644 index 0000000..666122a --- /dev/null +++ b/jcapiv2/docs/SystemInsightsWindowsSecurityCenter.md @@ -0,0 +1,17 @@ +# SystemInsightsWindowsSecurityCenter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**antispyware** | **str** | | [optional] +**antivirus** | **str** | | [optional] +**autoupdate** | **str** | | [optional] +**collection_time** | **str** | | [optional] +**firewall** | **str** | | [optional] +**internet_settings** | **str** | | [optional] +**system_id** | **str** | | [optional] +**user_account_control** | **str** | | [optional] +**windows_security_center_service** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsWindowsSecurityProducts.md b/jcapiv2/docs/SystemInsightsWindowsSecurityProducts.md new file mode 100644 index 0000000..42641ce --- /dev/null +++ b/jcapiv2/docs/SystemInsightsWindowsSecurityProducts.md @@ -0,0 +1,16 @@ +# SystemInsightsWindowsSecurityProducts + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collection_time** | **str** | | [optional] +**name** | **str** | | [optional] +**remediation_path** | **str** | | [optional] +**signatures_up_to_date** | **float** | | [optional] +**state** | **str** | | [optional] +**state_timestamp** | **str** | | [optional] +**system_id** | **str** | | [optional] +**type** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Systemfdekey.md b/jcapiv2/docs/Systemfdekey.md index 5e01b62..4e507a1 100644 --- a/jcapiv2/docs/Systemfdekey.md +++ b/jcapiv2/docs/Systemfdekey.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemsApi.md b/jcapiv2/docs/SystemsApi.md index d769817..418ba29 100644 --- a/jcapiv2/docs/SystemsApi.md +++ b/jcapiv2/docs/SystemsApi.md @@ -9,13 +9,14 @@ Method | HTTP request | Description [**graph_system_member_of**](SystemsApi.md#graph_system_member_of) | **GET** /systems/{system_id}/memberof | List the parent Groups of a System [**graph_system_traverse_command**](SystemsApi.md#graph_system_traverse_command) | **GET** /systems/{system_id}/commands | List the Commands bound to a System [**graph_system_traverse_policy**](SystemsApi.md#graph_system_traverse_policy) | **GET** /systems/{system_id}/policies | List the Policies bound to a System +[**graph_system_traverse_policy_group**](SystemsApi.md#graph_system_traverse_policy_group) | **GET** /systems/{system_id}/policygroups | List the Policy Groups bound to a System [**graph_system_traverse_user**](SystemsApi.md#graph_system_traverse_user) | **GET** /systems/{system_id}/users | List the Users bound to a System [**graph_system_traverse_user_group**](SystemsApi.md#graph_system_traverse_user_group) | **GET** /systems/{system_id}/usergroups | List the User Groups bound to a System [**systems_get_fde_key**](SystemsApi.md#systems_get_fde_key) | **GET** /systems/{system_id}/fdekey | Get System FDE Key - +[**systems_list_software_apps_with_statuses**](SystemsApi.md#systems_list_software_apps_with_statuses) | **GET** /systems/{system_id}/softwareappstatuses | List the associated Software Application Statuses of a System # **graph_system_associations_list** -> list[GraphConnection] graph_system_associations_list(system_id, content_type, accept, targets, limit=limit, skip=skip, _date=_date, authorization=authorization, x_org_id=x_org_id) +> list[GraphConnection] graph_system_associations_list(system_id, targets, limit=limit, skip=skip, _date=_date, authorization=authorization, x_org_id=x_org_id) List the associations of a System @@ -38,18 +39,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemsApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | ObjectID of the System. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -targets = ['targets_example'] # list[str] | +targets = ['targets_example'] # list[str] | Targets which a \"system\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) _date = '_date_example' # str | Current date header for the System Context API (optional) authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of a System - api_response = api_instance.graph_system_associations_list(system_id, content_type, accept, targets, limit=limit, skip=skip, _date=_date, authorization=authorization, x_org_id=x_org_id) + api_response = api_instance.graph_system_associations_list(system_id, targets, limit=limit, skip=skip, _date=_date, authorization=authorization, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemsApi->graph_system_associations_list: %s\n" % e) @@ -60,14 +59,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| ObjectID of the System. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **targets** | [**list[str]**](str.md)| | + **targets** | [**list[str]**](str.md)| Targets which a \"system\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] **_date** | **str**| Current date header for the System Context API | [optional] **authorization** | **str**| Authorization header for the System Context API | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -79,17 +76,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_associations_post** -> graph_system_associations_post(system_id, content_type, accept, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) +> graph_system_associations_post(system_id, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) Manage associations of a System -This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` +This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` ### Example ```python @@ -108,16 +105,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemsApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | ObjectID of the System. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.SystemGraphManagementReq() # SystemGraphManagementReq | (optional) +body = jcapiv2.GraphOperationSystem() # GraphOperationSystem | (optional) _date = '_date_example' # str | Current date header for the System Context API (optional) authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage associations of a System - api_instance.graph_system_associations_post(system_id, content_type, accept, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) + api_instance.graph_system_associations_post(system_id, body=body, _date=_date, authorization=authorization, x_org_id=x_org_id) except ApiException as e: print("Exception when calling SystemsApi->graph_system_associations_post: %s\n" % e) ``` @@ -127,12 +122,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| ObjectID of the System. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**SystemGraphManagementReq**](SystemGraphManagementReq.md)| | [optional] + **body** | [**GraphOperationSystem**](GraphOperationSystem.md)| | [optional] **_date** | **str**| Current date header for the System Context API | [optional] **authorization** | **str**| Authorization header for the System Context API | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -145,12 +138,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_member_of** -> list[GraphObjectWithPaths] graph_system_member_of(system_id, content_type, accept, filter=filter, limit=limit, skip=skip, _date=_date, authorization=authorization, sort=sort, x_org_id=x_org_id) +> list[GraphObjectWithPaths] graph_system_member_of(system_id, filter=filter, limit=limit, skip=skip, _date=_date, authorization=authorization, sort=sort, x_org_id=x_org_id) List the parent Groups of a System @@ -173,19 +166,17 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemsApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | ObjectID of the System. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) _date = '_date_example' # str | Current date header for the System Context API (optional) authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the parent Groups of a System - api_response = api_instance.graph_system_member_of(system_id, content_type, accept, filter=filter, limit=limit, skip=skip, _date=_date, authorization=authorization, sort=sort, x_org_id=x_org_id) + api_response = api_instance.graph_system_member_of(system_id, filter=filter, limit=limit, skip=skip, _date=_date, authorization=authorization, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling SystemsApi->graph_system_member_of: %s\n" % e) @@ -196,15 +187,13 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| ObjectID of the System. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] **_date** | **str**| Current date header for the System Context API | [optional] **authorization** | **str**| Authorization header for the System Context API | [optional] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -216,13 +205,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_traverse_command** -> list[GraphObjectWithPaths] graph_system_traverse_command(system_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_system_traverse_command(system_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Commands bound to a System @@ -245,16 +234,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemsApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | ObjectID of the System. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Commands bound to a System - api_response = api_instance.graph_system_traverse_command(system_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_system_traverse_command(system_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling SystemsApi->graph_system_traverse_command: %s\n" % e) @@ -265,12 +252,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| ObjectID of the System. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -282,13 +267,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_traverse_policy** -> list[GraphObjectWithPaths] graph_system_traverse_policy(system_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_system_traverse_policy(system_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Policies bound to a System @@ -311,16 +296,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemsApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | ObjectID of the System. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Policies bound to a System - api_response = api_instance.graph_system_traverse_policy(system_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_system_traverse_policy(system_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling SystemsApi->graph_system_traverse_policy: %s\n" % e) @@ -331,12 +314,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| ObjectID of the System. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -348,13 +329,79 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_system_traverse_policy_group** +> list[GraphObjectWithPaths] graph_system_traverse_policy_group(system_id, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) + +List the Policy Groups bound to a System + +This endpoint will return all Policy Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SystemsApi(jcapiv2.ApiClient(configuration)) +system_id = 'system_id_example' # str | ObjectID of the System. +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +_date = '_date_example' # str | Current date header for the System Context API (optional) +authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) + +try: + # List the Policy Groups bound to a System + api_response = api_instance.graph_system_traverse_policy_group(system_id, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) + pprint(api_response) +except ApiException as e: + print("Exception when calling SystemsApi->graph_system_traverse_policy_group: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **system_id** | **str**| ObjectID of the System. | + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **_date** | **str**| Current date header for the System Context API | [optional] + **authorization** | **str**| Authorization header for the System Context API | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_traverse_user** -> list[GraphObjectWithPaths] graph_system_traverse_user(system_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) +> list[GraphObjectWithPaths] graph_system_traverse_user(system_id, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) List the Users bound to a System @@ -377,18 +424,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemsApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | ObjectID of the System. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) _date = '_date_example' # str | Current date header for the System Context API (optional) authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Users bound to a System - api_response = api_instance.graph_system_traverse_user(system_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) + api_response = api_instance.graph_system_traverse_user(system_id, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling SystemsApi->graph_system_traverse_user: %s\n" % e) @@ -399,14 +444,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| ObjectID of the System. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] **_date** | **str**| Current date header for the System Context API | [optional] **authorization** | **str**| Authorization header for the System Context API | [optional] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -418,13 +461,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_system_traverse_user_group** -> list[GraphObjectWithPaths] graph_system_traverse_user_group(system_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) +> list[GraphObjectWithPaths] graph_system_traverse_user_group(system_id, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) List the User Groups bound to a System @@ -447,18 +490,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemsApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | ObjectID of the System. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) _date = '_date_example' # str | Current date header for the System Context API (optional) authorization = 'authorization_example' # str | Authorization header for the System Context API (optional) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the User Groups bound to a System - api_response = api_instance.graph_system_traverse_user_group(system_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) + api_response = api_instance.graph_system_traverse_user_group(system_id, limit=limit, x_org_id=x_org_id, skip=skip, _date=_date, authorization=authorization, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling SystemsApi->graph_system_traverse_user_group: %s\n" % e) @@ -469,14 +510,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| ObjectID of the System. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] **_date** | **str**| Current date header for the System Context API | [optional] **authorization** | **str**| Authorization header for the System Context API | [optional] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -488,7 +527,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -517,7 +556,7 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.SystemsApi(jcapiv2.ApiClient(configuration)) system_id = 'system_id_example' # str | -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Get System FDE Key @@ -532,7 +571,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **system_id** | **str**| | - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -544,7 +583,71 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **systems_list_software_apps_with_statuses** +> list[SoftwareAppWithStatus] systems_list_software_apps_with_statuses(system_id, x_org_id=x_org_id, filter=filter, limit=limit, skip=skip, sort=sort) + +List the associated Software Application Statuses of a System + +This endpoint returns all the statuses of the associated Software Applications from the provided JumpCloud system ID. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{system_id}/softwareappstatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.SystemsApi(jcapiv2.ApiClient(configuration)) +system_id = 'system_id_example' # str | ObjectID of the System. +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) + +try: + # List the associated Software Application Statuses of a System + api_response = api_instance.systems_list_software_apps_with_statuses(system_id, x_org_id=x_org_id, filter=filter, limit=limit, skip=skip, sort=sort) + pprint(api_response) +except ApiException as e: + print("Exception when calling SystemsApi->systems_list_software_apps_with_statuses: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **system_id** | **str**| ObjectID of the System. | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + +### Return type + +[**list[SoftwareAppWithStatus]**](SoftwareAppWithStatus.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/Systemuser.md b/jcapiv2/docs/Systemuser.md deleted file mode 100644 index 076fa98..0000000 --- a/jcapiv2/docs/Systemuser.md +++ /dev/null @@ -1,50 +0,0 @@ -# Systemuser - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | | [optional] -**account_locked** | **bool** | | [optional] -**activated** | **bool** | | [optional] -**allow_public_key** | **bool** | | [optional] -**associated_tag_count** | **int** | | [optional] -**attributes** | **list[object]** | | [optional] -**company** | **str** | | [optional] -**cost_center** | **str** | | [optional] -**created** | **str** | | [optional] -**department** | **str** | | [optional] -**description** | **str** | | [optional] -**displayname** | **str** | | [optional] -**email** | **str** | | [optional] -**employee_identifier** | **str** | Must be unique per user. | [optional] -**employee_type** | **str** | | [optional] -**enable_managed_uid** | **bool** | | [optional] -**enable_user_portal_multifactor** | **bool** | | [optional] -**external_dn** | **str** | | [optional] -**external_source_type** | **str** | | [optional] -**externally_managed** | **bool** | | [optional] -**firstname** | **str** | | [optional] -**job_title** | **str** | | [optional] -**lastname** | **str** | | [optional] -**ldap_binding_user** | **bool** | | [optional] -**location** | **str** | | [optional] -**mfa** | [**Mfa**](Mfa.md) | | [optional] -**middlename** | **str** | | [optional] -**password_expiration_date** | **str** | | [optional] -**password_expired** | **bool** | | [optional] -**password_never_expires** | **bool** | | [optional] -**passwordless_sudo** | **bool** | | [optional] -**public_key** | **str** | | [optional] -**samba_service_user** | **bool** | | [optional] -**ssh_keys** | [**list[Sshkeylist]**](Sshkeylist.md) | | [optional] -**sudo** | **bool** | | [optional] -**suspended** | **bool** | | [optional] -**tags** | **list[str]** | | [optional] -**totp_enabled** | **bool** | | [optional] -**unix_guid** | **int** | | [optional] -**unix_uid** | **int** | | [optional] -**username** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv2/docs/Systemuserputpost.md b/jcapiv2/docs/Systemuserputpost.md deleted file mode 100644 index 820254b..0000000 --- a/jcapiv2/docs/Systemuserputpost.md +++ /dev/null @@ -1,47 +0,0 @@ -# Systemuserputpost - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**account_locked** | **bool** | | [optional] -**activated** | **bool** | | [optional] -**addresses** | [**list[SystemuserputpostAddresses]**](SystemuserputpostAddresses.md) | | [optional] -**allow_public_key** | **bool** | | [optional] -**attributes** | **list[object]** | | [optional] -**company** | **str** | | [optional] -**cost_center** | **str** | | [optional] -**department** | **str** | | [optional] -**description** | **str** | | [optional] -**displayname** | **str** | | [optional] -**email** | **str** | | -**employee_identifier** | **str** | Must be unique per user. | [optional] -**employee_type** | **str** | | [optional] -**enable_managed_uid** | **bool** | | [optional] -**enable_user_portal_multifactor** | **bool** | | [optional] -**external_dn** | **str** | | [optional] -**external_source_type** | **str** | | [optional] -**externally_managed** | **bool** | | [optional] -**firstname** | **str** | | [optional] -**job_title** | **str** | | [optional] -**lastname** | **str** | | [optional] -**ldap_binding_user** | **bool** | | [optional] -**location** | **str** | | [optional] -**mfa** | [**Mfa**](Mfa.md) | | [optional] -**middlename** | **str** | | [optional] -**password** | **str** | | [optional] -**password_never_expires** | **bool** | | [optional] -**passwordless_sudo** | **bool** | | [optional] -**phone_numbers** | [**list[SystemuserputpostPhoneNumbers]**](SystemuserputpostPhoneNumbers.md) | | [optional] -**public_key** | **str** | | [optional] -**relationships** | **list[object]** | | [optional] -**samba_service_user** | **bool** | | [optional] -**sudo** | **bool** | | [optional] -**suspended** | **bool** | | [optional] -**tags** | **list[str]** | | [optional] -**unix_guid** | **int** | | [optional] -**unix_uid** | **int** | | [optional] -**username** | **str** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv2/docs/TicketingIntegrationAlert.md b/jcapiv2/docs/TicketingIntegrationAlert.md new file mode 100644 index 0000000..7d1deaf --- /dev/null +++ b/jcapiv2/docs/TicketingIntegrationAlert.md @@ -0,0 +1,12 @@ +# TicketingIntegrationAlert + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **str** | | [optional] +**description** | **str** | | [optional] +**id** | **int** | | [optional] +**name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/TicketingIntegrationAlertsResp.md b/jcapiv2/docs/TicketingIntegrationAlertsResp.md new file mode 100644 index 0000000..15f3e5c --- /dev/null +++ b/jcapiv2/docs/TicketingIntegrationAlertsResp.md @@ -0,0 +1,9 @@ +# TicketingIntegrationAlertsResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**records** | [**list[TicketingIntegrationAlert]**](TicketingIntegrationAlert.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/User.md b/jcapiv2/docs/User.md new file mode 100644 index 0000000..e26eb3c --- /dev/null +++ b/jcapiv2/docs/User.md @@ -0,0 +1,21 @@ +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**addresses** | [**list[Address]**](Address.md) | | [optional] +**alternate_email** | **str** | | [optional] +**company** | **str** | | [optional] +**cost_center** | **str** | | [optional] +**department** | **str** | | [optional] +**email** | **str** | | [optional] +**employee_identifier** | **str** | Must be unique per user. | [optional] +**employee_type** | **str** | | [optional] +**firstname** | **str** | | [optional] +**job_title** | **str** | | [optional] +**lastname** | **str** | | [optional] +**location** | **str** | | [optional] +**phone_numbers** | [**list[PhoneNumber]**](PhoneNumber.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/UserGraphManagementReq.md b/jcapiv2/docs/UserGraphManagementReq.md deleted file mode 100644 index 3a93dc6..0000000 --- a/jcapiv2/docs/UserGraphManagementReq.md +++ /dev/null @@ -1,13 +0,0 @@ -# UserGraphManagementReq - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attributes** | [**SystemGraphManagementReqAttributes**](SystemGraphManagementReqAttributes.md) | | [optional] -**id** | **str** | The ObjectID of graph object being added or removed as an association. | -**op** | **str** | How to modify the graph connection. | -**type** | **str** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv2/docs/UserGroup.md b/jcapiv2/docs/UserGroup.md index c1494c8..55e3022 100644 --- a/jcapiv2/docs/UserGroup.md +++ b/jcapiv2/docs/UserGroup.md @@ -3,11 +3,17 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**attributes** | [**UserGroupAttributes**](UserGroupAttributes.md) | | [optional] +**attributes** | [**GroupAttributesUserGroup**](GroupAttributesUserGroup.md) | | [optional] +**description** | **str** | Description of a User Group | [optional] +**email** | **str** | Email address of a User Group | [optional] **id** | **str** | ObjectId uniquely identifying a User Group. | [optional] +**member_query** | [**FilterQuery**](FilterQuery.md) | | [optional] +**member_query_exemptions** | [**list[GraphObject]**](GraphObject.md) | Array of GraphObjects exempted from the query | [optional] +**member_suggestions_notify** | **bool** | True if notification emails are to be sent for membership suggestions. | [optional] +**membership_automated** | **bool** | True if membership of this group is automatically updated based on the Member Query and Member Query Exemptions, if configured | [optional] **name** | **str** | Display name of a User Group. | [optional] +**suggestion_counts** | [**SuggestionCounts**](SuggestionCounts.md) | | [optional] **type** | **str** | The type of the group. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/UserGroupAssociationsApi.md b/jcapiv2/docs/UserGroupAssociationsApi.md index 4d66ac7..b8221ac 100644 --- a/jcapiv2/docs/UserGroupAssociationsApi.md +++ b/jcapiv2/docs/UserGroupAssociationsApi.md @@ -16,9 +16,8 @@ Method | HTTP request | Description [**graph_user_group_traverse_system**](UserGroupAssociationsApi.md#graph_user_group_traverse_system) | **GET** /usergroups/{group_id}/systems | List the Systems bound to a User Group [**graph_user_group_traverse_system_group**](UserGroupAssociationsApi.md#graph_user_group_traverse_system_group) | **GET** /usergroups/{group_id}/systemgroups | List the System Groups bound to User Groups - # **graph_user_group_associations_list** -> list[GraphConnection] graph_user_group_associations_list(group_id, content_type, accept, targets, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_user_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of a User Group. @@ -41,16 +40,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupAssociationsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -targets = ['targets_example'] # list[str] | +targets = ['targets_example'] # list[str] | Targets which a \"user_group\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of a User Group. - api_response = api_instance.graph_user_group_associations_list(group_id, content_type, accept, targets, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_user_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupAssociationsApi->graph_user_group_associations_list: %s\n" % e) @@ -61,12 +58,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **targets** | [**list[str]**](str.md)| | + **targets** | [**list[str]**](str.md)| Targets which a \"user_group\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -78,17 +73,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_associations_post** -> graph_user_group_associations_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_user_group_associations_post(group_id, body=body, x_org_id=x_org_id) Manage the associations of a User Group -This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` +This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` ### Example ```python @@ -107,14 +102,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupAssociationsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.UserGroupGraphManagementReq() # UserGroupGraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationUserGroup() # GraphOperationUserGroup | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of a User Group - api_instance.graph_user_group_associations_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_user_group_associations_post(group_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling UserGroupAssociationsApi->graph_user_group_associations_post: %s\n" % e) ``` @@ -124,10 +117,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**UserGroupGraphManagementReq**](UserGroupGraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationUserGroup**](GraphOperationUserGroup.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -140,12 +131,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_active_directory** -> list[GraphObjectWithPaths] graph_user_group_traverse_active_directory(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_active_directory(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Active Directories bound to a User Group @@ -168,16 +159,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupAssociationsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Active Directories bound to a User Group - api_response = api_instance.graph_user_group_traverse_active_directory(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_active_directory(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupAssociationsApi->graph_user_group_traverse_active_directory: %s\n" % e) @@ -188,12 +177,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -205,13 +192,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_application** -> list[GraphObjectWithPaths] graph_user_group_traverse_application(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_application(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Applications bound to a User Group @@ -234,16 +221,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupAssociationsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Applications bound to a User Group - api_response = api_instance.graph_user_group_traverse_application(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_application(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupAssociationsApi->graph_user_group_traverse_application: %s\n" % e) @@ -254,12 +239,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -271,13 +254,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_directory** -> list[GraphObjectWithPaths] graph_user_group_traverse_directory(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_directory(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Directories bound to a User Group @@ -300,16 +283,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupAssociationsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Directories bound to a User Group - api_response = api_instance.graph_user_group_traverse_directory(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_directory(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupAssociationsApi->graph_user_group_traverse_directory: %s\n" % e) @@ -320,12 +301,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -337,13 +316,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_g_suite** -> list[GraphObjectWithPaths] graph_user_group_traverse_g_suite(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_g_suite(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the G Suite instances bound to a User Group @@ -366,16 +345,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupAssociationsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the G Suite instances bound to a User Group - api_response = api_instance.graph_user_group_traverse_g_suite(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_g_suite(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupAssociationsApi->graph_user_group_traverse_g_suite: %s\n" % e) @@ -386,12 +363,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -403,13 +378,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_ldap_server** -> list[GraphObjectWithPaths] graph_user_group_traverse_ldap_server(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_ldap_server(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the LDAP Servers bound to a User Group @@ -432,16 +407,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupAssociationsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the LDAP Servers bound to a User Group - api_response = api_instance.graph_user_group_traverse_ldap_server(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_ldap_server(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupAssociationsApi->graph_user_group_traverse_ldap_server: %s\n" % e) @@ -452,12 +425,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -469,13 +440,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_office365** -> list[GraphObjectWithPaths] graph_user_group_traverse_office365(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_office365(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Office 365 instances bound to a User Group @@ -498,16 +469,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupAssociationsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Office 365 instances bound to a User Group - api_response = api_instance.graph_user_group_traverse_office365(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_office365(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupAssociationsApi->graph_user_group_traverse_office365: %s\n" % e) @@ -518,12 +487,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -535,13 +502,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_radius_server** -> list[GraphObjectWithPaths] graph_user_group_traverse_radius_server(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_radius_server(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the RADIUS Servers bound to a User Group @@ -564,16 +531,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupAssociationsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the RADIUS Servers bound to a User Group - api_response = api_instance.graph_user_group_traverse_radius_server(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_radius_server(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupAssociationsApi->graph_user_group_traverse_radius_server: %s\n" % e) @@ -584,12 +549,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -601,13 +564,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_system** -> list[GraphObjectWithPaths] graph_user_group_traverse_system(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_system(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Systems bound to a User Group @@ -630,16 +593,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupAssociationsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Systems bound to a User Group - api_response = api_instance.graph_user_group_traverse_system(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_system(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupAssociationsApi->graph_user_group_traverse_system: %s\n" % e) @@ -650,12 +611,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -667,13 +626,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_system_group** -> list[GraphObjectWithPaths] graph_user_group_traverse_system_group(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_system_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the System Groups bound to User Groups @@ -696,16 +655,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupAssociationsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the System Groups bound to User Groups - api_response = api_instance.graph_user_group_traverse_system_group(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_system_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupAssociationsApi->graph_user_group_traverse_system_group: %s\n" % e) @@ -716,12 +673,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -733,7 +688,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/UserGroupAttributes.md b/jcapiv2/docs/UserGroupAttributes.md deleted file mode 100644 index f45ca93..0000000 --- a/jcapiv2/docs/UserGroupAttributes.md +++ /dev/null @@ -1,11 +0,0 @@ -# UserGroupAttributes - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**posix_groups** | [**list[UserGroupAttributesPosixGroups]**](UserGroupAttributesPosixGroups.md) | | [optional] -**samba_enabled** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv2/docs/UserGroupGraphManagementReq.md b/jcapiv2/docs/UserGroupGraphManagementReq.md deleted file mode 100644 index deccc54..0000000 --- a/jcapiv2/docs/UserGroupGraphManagementReq.md +++ /dev/null @@ -1,12 +0,0 @@ -# UserGroupGraphManagementReq - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | The ObjectID of graph object being added or removed as an association. | -**op** | **str** | How to modify the graph connection. | -**type** | **str** | The graph type | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/jcapiv2/docs/UserGroupMembersMembershipApi.md b/jcapiv2/docs/UserGroupMembersMembershipApi.md index c121067..5657f67 100644 --- a/jcapiv2/docs/UserGroupMembersMembershipApi.md +++ b/jcapiv2/docs/UserGroupMembersMembershipApi.md @@ -4,82 +4,12 @@ All URIs are relative to *https://console.jumpcloud.com/api/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**graph_user_group_member_of**](UserGroupMembersMembershipApi.md#graph_user_group_member_of) | **GET** /usergroups/{group_id}/memberof | List the User Group's parents [**graph_user_group_members_list**](UserGroupMembersMembershipApi.md#graph_user_group_members_list) | **GET** /usergroups/{group_id}/members | List the members of a User Group [**graph_user_group_members_post**](UserGroupMembersMembershipApi.md#graph_user_group_members_post) | **POST** /usergroups/{group_id}/members | Manage the members of a User Group -[**graph_user_group_membership**](UserGroupMembersMembershipApi.md#graph_user_group_membership) | **GET** /usergroups/{group_id}/membership | List the User Group's membership - - -# **graph_user_group_member_of** -> list[GraphObjectWithPaths] graph_user_group_member_of(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) - -List the User Group's parents - -This endpoint returns all User Groups a User Group is a member of. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{group_id}/memberof ``` Not public yet, as the code is not finished, - -### Example -```python -from __future__ import print_function -import time -import jcapiv2 -from jcapiv2.rest import ApiException -from pprint import pprint - -# Configure API key authorization: x-api-key -configuration = jcapiv2.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - -# create an instance of the API class -api_instance = jcapiv2.UserGroupMembersMembershipApi(jcapiv2.ApiClient(configuration)) -group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) -limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) - -try: - # List the User Group's parents - api_response = api_instance.graph_user_group_member_of(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling UserGroupMembersMembershipApi->graph_user_group_member_of: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] - **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] - -### Return type - -[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +[**graph_user_group_membership**](UserGroupMembersMembershipApi.md#graph_user_group_membership) | **GET** /usergroups/{group_id}/membership | List the User Group's membership # **graph_user_group_members_list** -> list[GraphConnection] graph_user_group_members_list(group_id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_user_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) List the members of a User Group @@ -102,15 +32,13 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupMembersMembershipApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the members of a User Group - api_response = api_instance.graph_user_group_members_list(group_id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_user_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupMembersMembershipApi->graph_user_group_members_list: %s\n" % e) @@ -121,11 +49,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -137,17 +63,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_members_post** -> graph_user_group_members_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_user_group_members_post(group_id, body=body, x_org_id=x_org_id) Manage the members of a User Group -This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` +This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` ### Example ```python @@ -166,14 +92,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupMembersMembershipApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.UserGroupMembersReq() # UserGroupMembersReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationUserGroupMember() # GraphOperationUserGroupMember | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the members of a User Group - api_instance.graph_user_group_members_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_user_group_members_post(group_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling UserGroupMembersMembershipApi->graph_user_group_members_post: %s\n" % e) ``` @@ -183,10 +107,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**UserGroupMembersReq**](UserGroupMembersReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationUserGroupMember**](GraphOperationUserGroupMember.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -199,12 +121,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_membership** -> list[GraphObjectWithPaths] graph_user_group_membership(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +> list[GraphObjectWithPaths] graph_user_group_membership(group_id, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) List the User Group's membership @@ -227,17 +149,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupMembersMembershipApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the User Group's membership - api_response = api_instance.graph_user_group_membership(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.graph_user_group_membership(group_id, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupMembersMembershipApi->graph_user_group_membership: %s\n" % e) @@ -248,13 +168,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -266,7 +184,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/UserGroupPost.md b/jcapiv2/docs/UserGroupPost.md index 15442fc..6b5585d 100644 --- a/jcapiv2/docs/UserGroupPost.md +++ b/jcapiv2/docs/UserGroupPost.md @@ -3,9 +3,14 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**attributes** | [**UserGroupAttributes**](UserGroupAttributes.md) | | [optional] +**attributes** | [**GroupAttributesUserGroup**](GroupAttributesUserGroup.md) | | [optional] +**description** | **str** | Description of a User Group | [optional] +**email** | **str** | Email address of a User Group | [optional] +**member_query** | [**FilterQuery**](FilterQuery.md) | | [optional] +**member_query_exemptions** | [**list[GraphObject]**](GraphObject.md) | Array of GraphObjects exempted from the query | [optional] +**member_suggestions_notify** | **bool** | True if notification emails are to be sent for membership suggestions. | [optional] +**membership_automated** | **bool** | True if membership of this group is automatically updated based on the Member Query and Member Query Exemptions, if configured | [optional] **name** | **str** | Display name of a User Group. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/UserGroupPut.md b/jcapiv2/docs/UserGroupPut.md index 894befb..a7ad257 100644 --- a/jcapiv2/docs/UserGroupPut.md +++ b/jcapiv2/docs/UserGroupPut.md @@ -3,9 +3,14 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**attributes** | [**UserGroupAttributes**](UserGroupAttributes.md) | | [optional] +**attributes** | [**GroupAttributesUserGroup**](GroupAttributesUserGroup.md) | | [optional] +**description** | **str** | Description of a User Group | [optional] +**email** | **str** | Email address of a User Group | [optional] +**member_query** | [**FilterQuery**](FilterQuery.md) | | [optional] +**member_query_exemptions** | [**list[GraphObject]**](GraphObject.md) | Array of GraphObjects exempted from the query | [optional] +**member_suggestions_notify** | **bool** | True if notification emails are to be sent for membership suggestions. | [optional] +**membership_automated** | **bool** | True if membership of this group is automatically updated based on the Member Query and Member Query Exemptions, if configured | [optional] **name** | **str** | Display name of a User Group. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/UserGroupsApi.md b/jcapiv2/docs/UserGroupsApi.md index aaede1c..053246b 100644 --- a/jcapiv2/docs/UserGroupsApi.md +++ b/jcapiv2/docs/UserGroupsApi.md @@ -6,10 +6,9 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**graph_user_group_associations_list**](UserGroupsApi.md#graph_user_group_associations_list) | **GET** /usergroups/{group_id}/associations | List the associations of a User Group. [**graph_user_group_associations_post**](UserGroupsApi.md#graph_user_group_associations_post) | **POST** /usergroups/{group_id}/associations | Manage the associations of a User Group -[**graph_user_group_member_of**](UserGroupsApi.md#graph_user_group_member_of) | **GET** /usergroups/{group_id}/memberof | List the User Group's parents [**graph_user_group_members_list**](UserGroupsApi.md#graph_user_group_members_list) | **GET** /usergroups/{group_id}/members | List the members of a User Group [**graph_user_group_members_post**](UserGroupsApi.md#graph_user_group_members_post) | **POST** /usergroups/{group_id}/members | Manage the members of a User Group -[**graph_user_group_membership**](UserGroupsApi.md#graph_user_group_membership) | **GET** /usergroups/{group_id}/membership | List the User Group's membership +[**graph_user_group_membership**](UserGroupsApi.md#graph_user_group_membership) | **GET** /usergroups/{group_id}/membership | List the User Group's membership [**graph_user_group_traverse_active_directory**](UserGroupsApi.md#graph_user_group_traverse_active_directory) | **GET** /usergroups/{group_id}/activedirectories | List the Active Directories bound to a User Group [**graph_user_group_traverse_application**](UserGroupsApi.md#graph_user_group_traverse_application) | **GET** /usergroups/{group_id}/applications | List the Applications bound to a User Group [**graph_user_group_traverse_directory**](UserGroupsApi.md#graph_user_group_traverse_directory) | **GET** /usergroups/{group_id}/directories | List the Directories bound to a User Group @@ -19,16 +18,16 @@ Method | HTTP request | Description [**graph_user_group_traverse_radius_server**](UserGroupsApi.md#graph_user_group_traverse_radius_server) | **GET** /usergroups/{group_id}/radiusservers | List the RADIUS Servers bound to a User Group [**graph_user_group_traverse_system**](UserGroupsApi.md#graph_user_group_traverse_system) | **GET** /usergroups/{group_id}/systems | List the Systems bound to a User Group [**graph_user_group_traverse_system_group**](UserGroupsApi.md#graph_user_group_traverse_system_group) | **GET** /usergroups/{group_id}/systemgroups | List the System Groups bound to User Groups +[**groups_suggestions_get**](UserGroupsApi.md#groups_suggestions_get) | **GET** /usergroups/{group_id}/suggestions | List Suggestions for a User Group +[**groups_suggestions_post**](UserGroupsApi.md#groups_suggestions_post) | **POST** /usergroups/{group_id}/suggestions | List Suggestions for a User Group [**groups_user_delete**](UserGroupsApi.md#groups_user_delete) | **DELETE** /usergroups/{id} | Delete a User Group [**groups_user_get**](UserGroupsApi.md#groups_user_get) | **GET** /usergroups/{id} | View an individual User Group details [**groups_user_list**](UserGroupsApi.md#groups_user_list) | **GET** /usergroups | List all User Groups -[**groups_user_patch**](UserGroupsApi.md#groups_user_patch) | **PATCH** /usergroups/{id} | Partial update a User Group [**groups_user_post**](UserGroupsApi.md#groups_user_post) | **POST** /usergroups | Create a new User Group [**groups_user_put**](UserGroupsApi.md#groups_user_put) | **PUT** /usergroups/{id} | Update a User Group - # **graph_user_group_associations_list** -> list[GraphConnection] graph_user_group_associations_list(group_id, content_type, accept, targets, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_user_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of a User Group. @@ -51,16 +50,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -targets = ['targets_example'] # list[str] | +targets = ['targets_example'] # list[str] | Targets which a \"user_group\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of a User Group. - api_response = api_instance.graph_user_group_associations_list(group_id, content_type, accept, targets, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_user_group_associations_list(group_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupsApi->graph_user_group_associations_list: %s\n" % e) @@ -71,12 +68,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **targets** | [**list[str]**](str.md)| | + **targets** | [**list[str]**](str.md)| Targets which a \"user_group\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -88,17 +83,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_associations_post** -> graph_user_group_associations_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_user_group_associations_post(group_id, body=body, x_org_id=x_org_id) Manage the associations of a User Group -This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` +This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` ### Example ```python @@ -117,14 +112,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.UserGroupGraphManagementReq() # UserGroupGraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationUserGroup() # GraphOperationUserGroup | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of a User Group - api_instance.graph_user_group_associations_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_user_group_associations_post(group_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling UserGroupsApi->graph_user_group_associations_post: %s\n" % e) ``` @@ -134,10 +127,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**UserGroupGraphManagementReq**](UserGroupGraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationUserGroup**](GraphOperationUserGroup.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -150,80 +141,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **graph_user_group_member_of** -> list[GraphObjectWithPaths] graph_user_group_member_of(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) - -List the User Group's parents - -This endpoint returns all User Groups a User Group is a member of. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{group_id}/memberof ``` Not public yet, as the code is not finished, - -### Example -```python -from __future__ import print_function -import time -import jcapiv2 -from jcapiv2.rest import ApiException -from pprint import pprint - -# Configure API key authorization: x-api-key -configuration = jcapiv2.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - -# create an instance of the API class -api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) -group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) -limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) - -try: - # List the User Group's parents - api_response = api_instance.graph_user_group_member_of(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling UserGroupsApi->graph_user_group_member_of: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] - **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] - -### Return type - -[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_members_list** -> list[GraphConnection] graph_user_group_members_list(group_id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_user_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) List the members of a User Group @@ -246,15 +169,13 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the members of a User Group - api_response = api_instance.graph_user_group_members_list(group_id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_user_group_members_list(group_id, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupsApi->graph_user_group_members_list: %s\n" % e) @@ -265,11 +186,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -281,17 +200,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_members_post** -> graph_user_group_members_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_user_group_members_post(group_id, body=body, x_org_id=x_org_id) Manage the members of a User Group -This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` +This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` ### Example ```python @@ -310,14 +229,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.UserGroupMembersReq() # UserGroupMembersReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationUserGroupMember() # GraphOperationUserGroupMember | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the members of a User Group - api_instance.graph_user_group_members_post(group_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_user_group_members_post(group_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling UserGroupsApi->graph_user_group_members_post: %s\n" % e) ``` @@ -327,10 +244,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**UserGroupMembersReq**](UserGroupMembersReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationUserGroupMember**](GraphOperationUserGroupMember.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -343,12 +258,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_membership** -> list[GraphObjectWithPaths] graph_user_group_membership(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +> list[GraphObjectWithPaths] graph_user_group_membership(group_id, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) List the User Group's membership @@ -371,17 +286,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the User Group's membership - api_response = api_instance.graph_user_group_membership(group_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.graph_user_group_membership(group_id, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupsApi->graph_user_group_membership: %s\n" % e) @@ -392,13 +305,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -410,13 +321,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_active_directory** -> list[GraphObjectWithPaths] graph_user_group_traverse_active_directory(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_active_directory(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Active Directories bound to a User Group @@ -439,16 +350,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Active Directories bound to a User Group - api_response = api_instance.graph_user_group_traverse_active_directory(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_active_directory(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupsApi->graph_user_group_traverse_active_directory: %s\n" % e) @@ -459,12 +368,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -476,13 +383,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_application** -> list[GraphObjectWithPaths] graph_user_group_traverse_application(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_application(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Applications bound to a User Group @@ -505,16 +412,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Applications bound to a User Group - api_response = api_instance.graph_user_group_traverse_application(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_application(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupsApi->graph_user_group_traverse_application: %s\n" % e) @@ -525,12 +430,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -542,13 +445,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_directory** -> list[GraphObjectWithPaths] graph_user_group_traverse_directory(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_directory(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Directories bound to a User Group @@ -571,16 +474,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Directories bound to a User Group - api_response = api_instance.graph_user_group_traverse_directory(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_directory(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupsApi->graph_user_group_traverse_directory: %s\n" % e) @@ -591,12 +492,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -608,13 +507,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_g_suite** -> list[GraphObjectWithPaths] graph_user_group_traverse_g_suite(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_g_suite(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the G Suite instances bound to a User Group @@ -637,16 +536,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the G Suite instances bound to a User Group - api_response = api_instance.graph_user_group_traverse_g_suite(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_g_suite(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupsApi->graph_user_group_traverse_g_suite: %s\n" % e) @@ -657,12 +554,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -674,13 +569,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_ldap_server** -> list[GraphObjectWithPaths] graph_user_group_traverse_ldap_server(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_ldap_server(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the LDAP Servers bound to a User Group @@ -703,16 +598,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the LDAP Servers bound to a User Group - api_response = api_instance.graph_user_group_traverse_ldap_server(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_ldap_server(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupsApi->graph_user_group_traverse_ldap_server: %s\n" % e) @@ -723,12 +616,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -740,13 +631,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_office365** -> list[GraphObjectWithPaths] graph_user_group_traverse_office365(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_office365(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Office 365 instances bound to a User Group @@ -769,16 +660,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Office 365 instances bound to a User Group - api_response = api_instance.graph_user_group_traverse_office365(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_office365(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupsApi->graph_user_group_traverse_office365: %s\n" % e) @@ -789,12 +678,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -806,13 +693,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_radius_server** -> list[GraphObjectWithPaths] graph_user_group_traverse_radius_server(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_radius_server(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the RADIUS Servers bound to a User Group @@ -835,16 +722,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the RADIUS Servers bound to a User Group - api_response = api_instance.graph_user_group_traverse_radius_server(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_radius_server(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupsApi->graph_user_group_traverse_radius_server: %s\n" % e) @@ -855,12 +740,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -872,13 +755,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_system** -> list[GraphObjectWithPaths] graph_user_group_traverse_system(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_system(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Systems bound to a User Group @@ -901,16 +784,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Systems bound to a User Group - api_response = api_instance.graph_user_group_traverse_system(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_system(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupsApi->graph_user_group_traverse_system: %s\n" % e) @@ -921,12 +802,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -938,13 +817,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_group_traverse_system_group** -> list[GraphObjectWithPaths] graph_user_group_traverse_system_group(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_group_traverse_system_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the System Groups bound to User Groups @@ -967,16 +846,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) group_id = 'group_id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the System Groups bound to User Groups - api_response = api_instance.graph_user_group_traverse_system_group(group_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_group_traverse_system_group(group_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupsApi->graph_user_group_traverse_system_group: %s\n" % e) @@ -987,12 +864,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **group_id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -1004,17 +879,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **groups_user_delete** -> groups_user_delete(id, content_type, accept, x_org_id=x_org_id) +# **groups_suggestions_get** +> list[MemberSuggestion] groups_suggestions_get(group_id, x_org_id=x_org_id, limit=limit, skip=skip) -Delete a User Group +List Suggestions for a User Group -This endpoint allows you to delete a User Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint returns available suggestions for a given group #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/suggestions \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -1032,30 +907,31 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) -id = 'id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +group_id = 'group_id_example' # str | ID of the group +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) try: - # Delete a User Group - api_instance.groups_user_delete(id, content_type, accept, x_org_id=x_org_id) + # List Suggestions for a User Group + api_response = api_instance.groups_suggestions_get(group_id, x_org_id=x_org_id, limit=limit, skip=skip) + pprint(api_response) except ApiException as e: - print("Exception when calling UserGroupsApi->groups_user_delete: %s\n" % e) + print("Exception when calling UserGroupsApi->groups_suggestions_get: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **group_id** | **str**| ID of the group | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] ### Return type -void (empty response body) +[**list[MemberSuggestion]**](MemberSuggestion.md) ### Authorization @@ -1063,17 +939,17 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **groups_user_get** -> UserGroup groups_user_get(id, content_type, accept, x_org_id=x_org_id) +# **groups_suggestions_post** +> object groups_suggestions_post(body, group_id, x_org_id=x_org_id) -View an individual User Group details +List Suggestions for a User Group -This endpoint returns the details of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint applies the suggestions for the specified user group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/suggestions \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"user_ids\": [\"212345678901234567890123\", \"123456789012345678901234\"] }' ``` ### Example ```python @@ -1091,31 +967,29 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) -id = 'id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GroupIdSuggestionsBody() # GroupIdSuggestionsBody | +group_id = 'group_id_example' # str | ID of the group +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # View an individual User Group details - api_response = api_instance.groups_user_get(id, content_type, accept, x_org_id=x_org_id) + # List Suggestions for a User Group + api_response = api_instance.groups_suggestions_post(body, group_id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: - print("Exception when calling UserGroupsApi->groups_user_get: %s\n" % e) + print("Exception when calling UserGroupsApi->groups_suggestions_post: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GroupIdSuggestionsBody**](GroupIdSuggestionsBody.md)| | + **group_id** | **str**| ID of the group | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -[**UserGroup**](UserGroup.md) +**object** ### Authorization @@ -1128,12 +1002,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **groups_user_list** -> list[UserGroup] groups_user_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +# **groups_user_delete** +> UserGroup groups_user_delete(id, x_org_id=x_org_id) -List all User Groups +Delete a User Group -This endpoint returns all User Groups. Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` +This endpoint allows you to delete a User Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -1151,39 +1025,27 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) -limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +id = 'id_example' # str | ObjectID of the User Group. +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # List all User Groups - api_response = api_instance.groups_user_list(content_type, accept, fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + # Delete a User Group + api_response = api_instance.groups_user_delete(id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: - print("Exception when calling UserGroupsApi->groups_user_list: %s\n" % e) + print("Exception when calling UserGroupsApi->groups_user_delete: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] - **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **id** | **str**| ObjectID of the User Group. | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -[**list[UserGroup]**](UserGroup.md) +[**UserGroup**](UserGroup.md) ### Authorization @@ -1191,17 +1053,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **groups_user_patch** -> UserGroup groups_user_patch(id, content_type, accept, body=body, x_org_id=x_org_id) +# **groups_user_get** +> UserGroup groups_user_get(id, x_org_id=x_org_id) -Partial update a User Group +View an individual User Group details -We have hidden PATCH on the systemgroups and usergroups for now; we don't have that implemented correctly yet, people should use PUT until we do a true PATCH operation. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{id} ``` +This endpoint returns the details of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` ### Example ```python @@ -1220,17 +1082,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.UserGroupPost() # UserGroupPost | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # Partial update a User Group - api_response = api_instance.groups_user_patch(id, content_type, accept, body=body, x_org_id=x_org_id) + # View an individual User Group details + api_response = api_instance.groups_user_get(id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: - print("Exception when calling UserGroupsApi->groups_user_patch: %s\n" % e) + print("Exception when calling UserGroupsApi->groups_user_get: %s\n" % e) ``` ### Parameters @@ -1238,10 +1097,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**UserGroupPost**](UserGroupPost.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -1253,17 +1109,81 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **groups_user_list** +> list[UserGroup] groups_user_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + +List all User Groups + +This endpoint returns all User Groups. Available filter fields: - `name` - `disabled` - `type` - `suggestionCounts.add` - `suggestionCounts.remove` - `suggestionCounts.total` - `attributes.sudo.enabled` - `attributes.sudo.withoutPassword` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List all User Groups + api_response = api_instance.groups_user_list(fields=fields, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling UserGroupsApi->groups_user_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**list[UserGroup]**](UserGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **groups_user_post** -> UserGroup groups_user_post(content_type, accept, body=body, x_org_id=x_org_id) +> UserGroup groups_user_post(body=body, x_org_id=x_org_id) Create a new User Group -This endpoint allows you to create a new User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` +This endpoint allows you to create a new User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` ### Example ```python @@ -1281,14 +1201,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv2.UserGroupPost() # UserGroupPost | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Create a new User Group - api_response = api_instance.groups_user_post(content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.groups_user_post(body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupsApi->groups_user_post: %s\n" % e) @@ -1298,10 +1216,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**UserGroupPost**](UserGroupPost.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -1319,11 +1235,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **groups_user_put** -> UserGroup groups_user_put(id, content_type, accept, body=body, x_org_id=x_org_id) +> UserGroup groups_user_put(id, body=body, x_org_id=x_org_id) Update a User Group -This endpoint allows you to do a full update of the User Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY' \\ -d '{ \"name\": \"group_update\" }' ``` +This endpoint allows you to do a full update of the User Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"group_update\" }' ``` ### Example ```python @@ -1342,14 +1258,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UserGroupsApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | ObjectID of the User Group. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv2.UserGroupPut() # UserGroupPut | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Update a User Group - api_response = api_instance.groups_user_put(id, content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.groups_user_put(id, body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling UserGroupsApi->groups_user_put: %s\n" % e) @@ -1360,10 +1274,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| ObjectID of the User Group. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**UserGroupPut**](UserGroupPut.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type diff --git a/jcapiv2/docs/UsersApi.md b/jcapiv2/docs/UsersApi.md index b772b88..bcb74f8 100644 --- a/jcapiv2/docs/UsersApi.md +++ b/jcapiv2/docs/UsersApi.md @@ -7,6 +7,7 @@ Method | HTTP request | Description [**graph_user_associations_list**](UsersApi.md#graph_user_associations_list) | **GET** /users/{user_id}/associations | List the associations of a User [**graph_user_associations_post**](UsersApi.md#graph_user_associations_post) | **POST** /users/{user_id}/associations | Manage the associations of a User [**graph_user_member_of**](UsersApi.md#graph_user_member_of) | **GET** /users/{user_id}/memberof | List the parent Groups of a User +[**graph_user_traverse_active_directory**](UsersApi.md#graph_user_traverse_active_directory) | **GET** /users/{user_id}/activedirectories | List the Active Directory instances bound to a User [**graph_user_traverse_application**](UsersApi.md#graph_user_traverse_application) | **GET** /users/{user_id}/applications | List the Applications bound to a User [**graph_user_traverse_directory**](UsersApi.md#graph_user_traverse_directory) | **GET** /users/{user_id}/directories | List the Directories bound to a User [**graph_user_traverse_g_suite**](UsersApi.md#graph_user_traverse_g_suite) | **GET** /users/{user_id}/gsuites | List the G Suite instances bound to a User @@ -15,11 +16,13 @@ Method | HTTP request | Description [**graph_user_traverse_radius_server**](UsersApi.md#graph_user_traverse_radius_server) | **GET** /users/{user_id}/radiusservers | List the RADIUS Servers bound to a User [**graph_user_traverse_system**](UsersApi.md#graph_user_traverse_system) | **GET** /users/{user_id}/systems | List the Systems bound to a User [**graph_user_traverse_system_group**](UsersApi.md#graph_user_traverse_system_group) | **GET** /users/{user_id}/systemgroups | List the System Groups bound to a User -[**users_send_emails**](UsersApi.md#users_send_emails) | **POST** /users/{user_id}/emails | Send User Emails - +[**push_endpoints_delete**](UsersApi.md#push_endpoints_delete) | **DELETE** /users/{user_id}/pushendpoints/{push_endpoint_id} | Delete a Push Endpoint associated with a User +[**push_endpoints_get**](UsersApi.md#push_endpoints_get) | **GET** /users/{user_id}/pushendpoints/{push_endpoint_id} | Get a push endpoint associated with a User +[**push_endpoints_list**](UsersApi.md#push_endpoints_list) | **GET** /users/{user_id}/pushendpoints | List Push Endpoints associated with a User +[**push_endpoints_patch**](UsersApi.md#push_endpoints_patch) | **PATCH** /users/{user_id}/pushendpoints/{push_endpoint_id} | Update a push endpoint associated with a User # **graph_user_associations_list** -> list[GraphConnection] graph_user_associations_list(user_id, content_type, accept, targets, limit=limit, skip=skip, x_org_id=x_org_id) +> list[GraphConnection] graph_user_associations_list(user_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) List the associations of a User @@ -42,16 +45,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UsersApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -targets = ['targets_example'] # list[str] | +targets = ['targets_example'] # list[str] | Targets which a \"user\" can be associated to. limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the associations of a User - api_response = api_instance.graph_user_associations_list(user_id, content_type, accept, targets, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.graph_user_associations_list(user_id, targets, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling UsersApi->graph_user_associations_list: %s\n" % e) @@ -62,12 +63,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **targets** | [**list[str]**](str.md)| | + **targets** | [**list[str]**](str.md)| Targets which a \"user\" can be associated to. | **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -79,17 +78,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_associations_post** -> graph_user_associations_post(user_id, content_type, accept, body=body, x_org_id=x_org_id) +> graph_user_associations_post(user_id, body=body, x_org_id=x_org_id) Manage the associations of a User -This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' +This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' ``` ### Example ```python @@ -108,14 +107,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UsersApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.UserGraphManagementReq() # UserGraphManagementReq | (optional) -x_org_id = '' # str | (optional) (default to ) +body = jcapiv2.GraphOperationUser() # GraphOperationUser | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Manage the associations of a User - api_instance.graph_user_associations_post(user_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.graph_user_associations_post(user_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling UsersApi->graph_user_associations_post: %s\n" % e) ``` @@ -125,10 +122,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**UserGraphManagementReq**](UserGraphManagementReq.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **body** | [**GraphOperationUser**](GraphOperationUser.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -141,12 +136,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_member_of** -> list[GraphObjectWithPaths] graph_user_member_of(user_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +> list[GraphObjectWithPaths] graph_user_member_of(user_id, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) List the parent Groups of a User @@ -169,17 +164,15 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UsersApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List the parent Groups of a User - api_response = api_instance.graph_user_member_of(user_id, content_type, accept, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.graph_user_member_of(user_id, filter=filter, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling UsersApi->graph_user_member_of: %s\n" % e) @@ -190,13 +183,11 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -208,13 +199,75 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **graph_user_traverse_active_directory** +> list[GraphObjectWithPaths] graph_user_traverse_active_directory(user_id, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip) + +List the Active Directory instances bound to a User + +This endpoint will return all Active Directory Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Active Directory instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.UsersApi(jcapiv2.ApiClient(configuration)) +user_id = 'user_id_example' # str | ObjectID of the User. +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) +skip = 0 # int | The offset into the records to return. (optional) (default to 0) + +try: + # List the Active Directory instances bound to a User + api_response = api_instance.graph_user_traverse_active_directory(user_id, filter=filter, limit=limit, x_org_id=x_org_id, skip=skip) + pprint(api_response) +except ApiException as e: + print("Exception when calling UsersApi->graph_user_traverse_active_directory: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **str**| ObjectID of the User. | + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + **skip** | **int**| The offset into the records to return. | [optional] [default to 0] + +### Return type + +[**list[GraphObjectWithPaths]**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_traverse_application** -> list[GraphObjectWithPaths] graph_user_traverse_application(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_traverse_application(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Applications bound to a User @@ -237,16 +290,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UsersApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Applications bound to a User - api_response = api_instance.graph_user_traverse_application(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_traverse_application(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UsersApi->graph_user_traverse_application: %s\n" % e) @@ -257,12 +308,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -274,13 +323,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_traverse_directory** -> list[GraphObjectWithPaths] graph_user_traverse_directory(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_traverse_directory(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Directories bound to a User @@ -303,16 +352,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UsersApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Directories bound to a User - api_response = api_instance.graph_user_traverse_directory(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_traverse_directory(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UsersApi->graph_user_traverse_directory: %s\n" % e) @@ -323,12 +370,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -340,13 +385,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_traverse_g_suite** -> list[GraphObjectWithPaths] graph_user_traverse_g_suite(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_traverse_g_suite(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the G Suite instances bound to a User @@ -369,16 +414,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UsersApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the G Suite instances bound to a User - api_response = api_instance.graph_user_traverse_g_suite(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_traverse_g_suite(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UsersApi->graph_user_traverse_g_suite: %s\n" % e) @@ -389,12 +432,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -406,13 +447,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_traverse_ldap_server** -> list[GraphObjectWithPaths] graph_user_traverse_ldap_server(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_traverse_ldap_server(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the LDAP servers bound to a User @@ -435,16 +476,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UsersApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the LDAP servers bound to a User - api_response = api_instance.graph_user_traverse_ldap_server(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_traverse_ldap_server(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UsersApi->graph_user_traverse_ldap_server: %s\n" % e) @@ -455,12 +494,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -472,13 +509,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_traverse_office365** -> list[GraphObjectWithPaths] graph_user_traverse_office365(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_traverse_office365(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Office 365 instances bound to a User @@ -501,16 +538,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UsersApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Office 365 instances bound to a User - api_response = api_instance.graph_user_traverse_office365(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_traverse_office365(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UsersApi->graph_user_traverse_office365: %s\n" % e) @@ -521,12 +556,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -538,13 +571,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_traverse_radius_server** -> list[GraphObjectWithPaths] graph_user_traverse_radius_server(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_traverse_radius_server(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the RADIUS Servers bound to a User @@ -567,16 +600,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UsersApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the RADIUS Servers bound to a User - api_response = api_instance.graph_user_traverse_radius_server(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_traverse_radius_server(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UsersApi->graph_user_traverse_radius_server: %s\n" % e) @@ -587,12 +618,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -604,13 +633,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_traverse_system** -> list[GraphObjectWithPaths] graph_user_traverse_system(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_traverse_system(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the Systems bound to a User @@ -633,16 +662,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UsersApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the Systems bound to a User - api_response = api_instance.graph_user_traverse_system(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_traverse_system(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UsersApi->graph_user_traverse_system: %s\n" % e) @@ -653,12 +680,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -670,13 +695,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **graph_user_traverse_system_group** -> list[GraphObjectWithPaths] graph_user_traverse_system_group(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) +> list[GraphObjectWithPaths] graph_user_traverse_system_group(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) List the System Groups bound to a User @@ -699,16 +724,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UsersApi(jcapiv2.ApiClient(configuration)) user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) try: # List the System Groups bound to a User - api_response = api_instance.graph_user_traverse_system_group(user_id, content_type, accept, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) + api_response = api_instance.graph_user_traverse_system_group(user_id, limit=limit, x_org_id=x_org_id, skip=skip, filter=filter) pprint(api_response) except ApiException as e: print("Exception when calling UsersApi->graph_user_traverse_system_group: %s\n" % e) @@ -719,12 +742,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] ### Return type @@ -736,17 +757,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **users_send_emails** -> users_send_emails(user_id, content_type, accept, body=body, x_org_id=x_org_id) +# **push_endpoints_delete** +> PushEndpointResponse push_endpoints_delete(user_id, push_endpoint_id, x_org_id=x_org_id) -Send User Emails +Delete a Push Endpoint associated with a User -This endpoint allows you to send a specific email to a user without waiting for or triggering a workflow. +This endpoint will delete a push endpoint associated with a user. ### Example ```python @@ -764,32 +785,203 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.UsersApi(jcapiv2.ApiClient(configuration)) -user_id = 'user_id_example' # str | ObjectID of the User. -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -body = jcapiv2.Emailrequest() # Emailrequest | (optional) -x_org_id = '' # str | (optional) (default to ) +user_id = 'user_id_example' # str | +push_endpoint_id = 'push_endpoint_id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: - # Send User Emails - api_instance.users_send_emails(user_id, content_type, accept, body=body, x_org_id=x_org_id) + # Delete a Push Endpoint associated with a User + api_response = api_instance.push_endpoints_delete(user_id, push_endpoint_id, x_org_id=x_org_id) + pprint(api_response) except ApiException as e: - print("Exception when calling UsersApi->users_send_emails: %s\n" % e) + print("Exception when calling UsersApi->push_endpoints_delete: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user_id** | **str**| ObjectID of the User. | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **body** | [**Emailrequest**](Emailrequest.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **user_id** | **str**| | + **push_endpoint_id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -void (empty response body) +[**PushEndpointResponse**](PushEndpointResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **push_endpoints_get** +> PushEndpointResponse push_endpoints_get(user_id, push_endpoint_id, x_org_id=x_org_id) + +Get a push endpoint associated with a User + +This endpoint will retrieve a push endpoint associated with a user. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.UsersApi(jcapiv2.ApiClient(configuration)) +user_id = 'user_id_example' # str | +push_endpoint_id = 'push_endpoint_id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Get a push endpoint associated with a User + api_response = api_instance.push_endpoints_get(user_id, push_endpoint_id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling UsersApi->push_endpoints_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **str**| | + **push_endpoint_id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**PushEndpointResponse**](PushEndpointResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **push_endpoints_list** +> list[PushEndpointResponse] push_endpoints_list(user_id, x_org_id=x_org_id) + +List Push Endpoints associated with a User + +This endpoint returns the list of push endpoints associated with a user. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/pushendpoints \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: ${API_KEY}' ``` + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.UsersApi(jcapiv2.ApiClient(configuration)) +user_id = 'user_id_example' # str | +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # List Push Endpoints associated with a User + api_response = api_instance.push_endpoints_list(user_id, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling UsersApi->push_endpoints_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **str**| | + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**list[PushEndpointResponse]**](PushEndpointResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **push_endpoints_patch** +> PushEndpointResponse push_endpoints_patch(user_id, push_endpoint_id, body=body, x_org_id=x_org_id) + +Update a push endpoint associated with a User + +This endpoint will update a push endpoint associated with a user. + +### Example +```python +from __future__ import print_function +import time +import jcapiv2 +from jcapiv2.rest import ApiException +from pprint import pprint + +# Configure API key authorization: x-api-key +configuration = jcapiv2.Configuration() +configuration.api_key['x-api-key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x-api-key'] = 'Bearer' + +# create an instance of the API class +api_instance = jcapiv2.UsersApi(jcapiv2.ApiClient(configuration)) +user_id = 'user_id_example' # str | +push_endpoint_id = 'push_endpoint_id_example' # str | +body = jcapiv2.PushendpointsPushEndpointIdBody() # PushendpointsPushEndpointIdBody | (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) + +try: + # Update a push endpoint associated with a User + api_response = api_instance.push_endpoints_patch(user_id, push_endpoint_id, body=body, x_org_id=x_org_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling UsersApi->push_endpoints_patch: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **str**| | + **push_endpoint_id** | **str**| | + **body** | [**PushendpointsPushEndpointIdBody**](PushendpointsPushEndpointIdBody.md)| | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] + +### Return type + +[**PushEndpointResponse**](PushEndpointResponse.md) ### Authorization diff --git a/jcapiv2/docs/WorkdayFields.md b/jcapiv2/docs/WorkdayFields.md index 550ec49..ab0cf88 100644 --- a/jcapiv2/docs/WorkdayFields.md +++ b/jcapiv2/docs/WorkdayFields.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/WorkdayImportApi.md b/jcapiv2/docs/WorkdayImportApi.md index b86ba47..59356d8 100644 --- a/jcapiv2/docs/WorkdayImportApi.md +++ b/jcapiv2/docs/WorkdayImportApi.md @@ -6,19 +6,16 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**workdays_authorize**](WorkdayImportApi.md#workdays_authorize) | **POST** /workdays/{workday_id}/auth | Authorize Workday [**workdays_deauthorize**](WorkdayImportApi.md#workdays_deauthorize) | **DELETE** /workdays/{workday_id}/auth | Deauthorize Workday -[**workdays_delete**](WorkdayImportApi.md#workdays_delete) | **DELETE** /workdays/{id} | Delete Workday [**workdays_get**](WorkdayImportApi.md#workdays_get) | **GET** /workdays/{id} | Get Workday [**workdays_import**](WorkdayImportApi.md#workdays_import) | **POST** /workdays/{workday_id}/import | Workday Import [**workdays_importresults**](WorkdayImportApi.md#workdays_importresults) | **GET** /workdays/{id}/import/{job_id}/results | List Import Results [**workdays_list**](WorkdayImportApi.md#workdays_list) | **GET** /workdays | List Workdays [**workdays_post**](WorkdayImportApi.md#workdays_post) | **POST** /workdays | Create new Workday [**workdays_put**](WorkdayImportApi.md#workdays_put) | **PUT** /workdays/{id} | Update Workday -[**workdays_settings**](WorkdayImportApi.md#workdays_settings) | **GET** /workdays/settings | Get Workday Settings (incomplete) [**workdays_workers**](WorkdayImportApi.md#workdays_workers) | **GET** /workdays/{workday_id}/workers | List Workday Workers - # **workdays_authorize** -> workdays_authorize(workday_id, content_type, accept, body=body, x_org_id=x_org_id) +> workdays_authorize(workday_id, body=body, x_org_id=x_org_id) Authorize Workday @@ -41,14 +38,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.WorkdayImportApi(jcapiv2.ApiClient(configuration)) workday_id = 'workday_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv2.AuthInputObject() # AuthInputObject | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Authorize Workday - api_instance.workdays_authorize(workday_id, content_type, accept, body=body, x_org_id=x_org_id) + api_instance.workdays_authorize(workday_id, body=body, x_org_id=x_org_id) except ApiException as e: print("Exception when calling WorkdayImportApi->workdays_authorize: %s\n" % e) ``` @@ -58,10 +53,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **workday_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**AuthInputObject**](AuthInputObject.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -74,12 +67,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **workdays_deauthorize** -> workdays_deauthorize(workday_id, content_type, accept, x_org_id=x_org_id) +> workdays_deauthorize(workday_id, x_org_id=x_org_id) Deauthorize Workday @@ -102,13 +95,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.WorkdayImportApi(jcapiv2.ApiClient(configuration)) workday_id = 'workday_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Deauthorize Workday - api_instance.workdays_deauthorize(workday_id, content_type, accept, x_org_id=x_org_id) + api_instance.workdays_deauthorize(workday_id, x_org_id=x_org_id) except ApiException as e: print("Exception when calling WorkdayImportApi->workdays_deauthorize: %s\n" % e) ``` @@ -118,9 +109,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **workday_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -132,73 +121,13 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **workdays_delete** -> object workdays_delete(id, content_type, accept, x_org_id=x_org_id) - -Delete Workday - -This endpoint allows you to delete an instance of Workday. **This functionality is currently not enable for users.** - -### Example -```python -from __future__ import print_function -import time -import jcapiv2 -from jcapiv2.rest import ApiException -from pprint import pprint - -# Configure API key authorization: x-api-key -configuration = jcapiv2.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - -# create an instance of the API class -api_instance = jcapiv2.WorkdayImportApi(jcapiv2.ApiClient(configuration)) -id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) - -try: - # Delete Workday - api_response = api_instance.workdays_delete(id, content_type, accept, x_org_id=x_org_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling WorkdayImportApi->workdays_delete: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] - -### Return type - -**object** - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **workdays_get** -> WorkdayOutput workdays_get(id, content_type, accept, x_org_id=x_org_id) +> WorkdayOutput workdays_get(id, x_org_id=x_org_id) Get Workday @@ -221,13 +150,11 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.WorkdayImportApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Get Workday - api_response = api_instance.workdays_get(id, content_type, accept, x_org_id=x_org_id) + api_response = api_instance.workdays_get(id, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling WorkdayImportApi->workdays_get: %s\n" % e) @@ -238,9 +165,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -252,13 +177,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **workdays_import** -> JobId workdays_import(workday_id, content_type, accept, body=body, x_org_id=x_org_id) +> JobId workdays_import(workday_id, body=body, x_org_id=x_org_id) Workday Import @@ -281,14 +206,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.WorkdayImportApi(jcapiv2.ApiClient(configuration)) workday_id = 'workday_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = [jcapiv2.BulkUserCreate()] # list[BulkUserCreate] | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Workday Import - api_response = api_instance.workdays_import(workday_id, content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.workdays_import(workday_id, body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling WorkdayImportApi->workdays_import: %s\n" % e) @@ -299,10 +222,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **workday_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**list[BulkUserCreate]**](BulkUserCreate.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -320,7 +241,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **workdays_importresults** -> list[JobWorkresult] workdays_importresults(id, job_id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) +> list[JobWorkresult] workdays_importresults(id, job_id, limit=limit, skip=skip, x_org_id=x_org_id) List Import Results @@ -344,15 +265,13 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' api_instance = jcapiv2.WorkdayImportApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | job_id = 'job_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List Import Results - api_response = api_instance.workdays_importresults(id, job_id, content_type, accept, limit=limit, skip=skip, x_org_id=x_org_id) + api_response = api_instance.workdays_importresults(id, job_id, limit=limit, skip=skip, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling WorkdayImportApi->workdays_importresults: %s\n" % e) @@ -364,11 +283,9 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | **job_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -380,13 +297,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **workdays_list** -> list[WorkdayOutput] workdays_list(content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) +> list[WorkdayOutput] workdays_list(fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) List Workdays @@ -408,18 +325,16 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.WorkdayImportApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -fields = ['[]'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) (default to []) +fields = ['fields_example'] # list[str] | The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. (optional) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -filter = ['[]'] # list[str] | Supported operators are: eq, ne, gt, ge, lt, le, between, search, in (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +filter = ['filter_example'] # list[str] | A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List Workdays - api_response = api_instance.workdays_list(content_type, accept, fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) + api_response = api_instance.workdays_list(fields=fields, limit=limit, skip=skip, sort=sort, filter=filter, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling WorkdayImportApi->workdays_list: %s\n" % e) @@ -429,14 +344,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] [default to []] + **fields** | [**list[str]**](str.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | [optional] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **filter** | [**list[str]**](str.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **filter** | [**list[str]**](str.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -448,17 +361,17 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **workdays_post** -> workdays_post(content_type, accept, body=body, x_org_id=x_org_id) +> WorkdayOutput workdays_post(body=body, x_org_id=x_org_id) Create new Workday -This endpoint allows you to create a new workday instance. You must supply a username and password for `Basic Authentication` that is the same as your WorkDay Integrator System User. Failure to provide these credentials will result in the request being rejected. Currently `O-Auth` isn't a supported authentication protocol for WorkDay, but will be in the future. Currently, only one instance is allowed and it must be `Workday Import`. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Workday2\", \"reportUrl\":\"https://workday.com/ccx/service/customreport2/gms/user/reportname?format=json\", \"auth\": { \"basic\": { \"username\": \"someDeveloper\", \"password\": \"notTheRealPassword\" } } }' ``` +This endpoint allows you to create a new workday instance. You must supply a username and password for `Basic Authentication` that is the same as your WorkDay Integrator System User. Failure to provide these credentials will result in the request being rejected. Currently `O-Auth` isn't a supported authentication protocol for WorkDay, but will be in the future. Currently, only one instance is allowed and it must be `Workday Import`. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Workday2\", \"reportUrl\":\"https://workday.com/ccx/service/customreport2/gms/user/reportname?format=json\", \"auth\": { \"basic\": { \"username\": \"someDeveloper\", \"password\": \"notTheRealPassword\" } } }' ``` ### Example ```python @@ -476,14 +389,13 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.WorkdayImportApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv2.WorkdayInput() # WorkdayInput | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Create new Workday - api_instance.workdays_post(content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.workdays_post(body=body, x_org_id=x_org_id) + pprint(api_response) except ApiException as e: print("Exception when calling WorkdayImportApi->workdays_post: %s\n" % e) ``` @@ -492,14 +404,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**WorkdayInput**](WorkdayInput.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type -void (empty response body) +[**WorkdayOutput**](WorkdayOutput.md) ### Authorization @@ -513,7 +423,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **workdays_put** -> WorkdayOutput workdays_put(id, content_type, accept, body=body, x_org_id=x_org_id) +> WorkdayOutput workdays_put(id, body=body, x_org_id=x_org_id) Update Workday @@ -536,14 +446,12 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.WorkdayImportApi(jcapiv2.ApiClient(configuration)) id = 'id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) body = jcapiv2.WorkdayFields() # WorkdayFields | (optional) -x_org_id = '' # str | (optional) (default to ) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # Update Workday - api_response = api_instance.workdays_put(id, content_type, accept, body=body, x_org_id=x_org_id) + api_response = api_instance.workdays_put(id, body=body, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling WorkdayImportApi->workdays_put: %s\n" % e) @@ -554,10 +462,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **body** | [**WorkdayFields**](WorkdayFields.md)| | [optional] - **x_org_id** | **str**| | [optional] [default to ] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -574,67 +480,8 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **workdays_settings** -> workdays_settings(content_type, accept, state=state, x_org_id=x_org_id) - -Get Workday Settings (incomplete) - -This endpoint allows you to obtain all settings needed for creating a workday instance, specifically the URL to initiate Basic Authentication with WorkDay. **This functionality is currently not enable for users.** - -### Example -```python -from __future__ import print_function -import time -import jcapiv2 -from jcapiv2.rest import ApiException -from pprint import pprint - -# Configure API key authorization: x-api-key -configuration = jcapiv2.Configuration() -configuration.api_key['x-api-key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-api-key'] = 'Bearer' - -# create an instance of the API class -api_instance = jcapiv2.WorkdayImportApi(jcapiv2.ApiClient(configuration)) -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) -state = 'state_example' # str | (optional) -x_org_id = '' # str | (optional) (default to ) - -try: - # Get Workday Settings (incomplete) - api_instance.workdays_settings(content_type, accept, state=state, x_org_id=x_org_id) -except ApiException as e: - print("Exception when calling WorkdayImportApi->workdays_settings: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] - **state** | **str**| | [optional] - **x_org_id** | **str**| | [optional] [default to ] - -### Return type - -void (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **workdays_workers** -> list[WorkdayWorker] workdays_workers(workday_id, content_type, accept, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) +> list[WorkdayWorker] workdays_workers(workday_id, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) List Workday Workers @@ -657,16 +504,14 @@ configuration.api_key['x-api-key'] = 'YOUR_API_KEY' # create an instance of the API class api_instance = jcapiv2.WorkdayImportApi(jcapiv2.ApiClient(configuration)) workday_id = 'workday_id_example' # str | -content_type = 'application/json' # str | (default to application/json) -accept = 'application/json' # str | (default to application/json) limit = 10 # int | The number of records to return at once. Limited to 100. (optional) (default to 10) skip = 0 # int | The offset into the records to return. (optional) (default to 0) -sort = ['[]'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) (default to []) -x_org_id = '' # str | (optional) (default to ) +sort = ['sort_example'] # list[str] | The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. (optional) +x_org_id = 'x_org_id_example' # str | Organization identifier that can be obtained from console settings. (optional) try: # List Workday Workers - api_response = api_instance.workdays_workers(workday_id, content_type, accept, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) + api_response = api_instance.workdays_workers(workday_id, limit=limit, skip=skip, sort=sort, x_org_id=x_org_id) pprint(api_response) except ApiException as e: print("Exception when calling WorkdayImportApi->workdays_workers: %s\n" % e) @@ -677,12 +522,10 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **workday_id** | **str**| | - **content_type** | **str**| | [default to application/json] - **accept** | **str**| | [default to application/json] **limit** | **int**| The number of records to return at once. Limited to 100. | [optional] [default to 10] **skip** | **int**| The offset into the records to return. | [optional] [default to 0] - **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] [default to []] - **x_org_id** | **str**| | [optional] [default to ] + **sort** | [**list[str]**](str.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [optional] + **x_org_id** | **str**| Organization identifier that can be obtained from console settings. | [optional] ### Return type @@ -694,7 +537,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/jcapiv2/docs/WorkdayInput.md b/jcapiv2/docs/WorkdayInput.md index 276c5fd..be193a2 100644 --- a/jcapiv2/docs/WorkdayInput.md +++ b/jcapiv2/docs/WorkdayInput.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/WorkdayOutput.md b/jcapiv2/docs/WorkdayOutput.md index efb4482..8ce028b 100644 --- a/jcapiv2/docs/WorkdayOutput.md +++ b/jcapiv2/docs/WorkdayOutput.md @@ -11,4 +11,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/WorkdayWorker.md b/jcapiv2/docs/WorkdayWorker.md index 592ecf8..3a273b9 100644 --- a/jcapiv2/docs/WorkdayWorker.md +++ b/jcapiv2/docs/WorkdayWorker.md @@ -11,4 +11,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/WorkdayoutputAuth.md b/jcapiv2/docs/WorkdayoutputAuth.md index 237354f..9a6269d 100644 --- a/jcapiv2/docs/WorkdayoutputAuth.md +++ b/jcapiv2/docs/WorkdayoutputAuth.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/jcapiv2/__init__.py b/jcapiv2/jcapiv2/__init__.py index 4ecf2a1..8a7761b 100644 --- a/jcapiv2/jcapiv2/__init__.py +++ b/jcapiv2/jcapiv2/__init__.py @@ -3,38 +3,52 @@ # flake8: noqa """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import # import apis into sdk package from jcapiv2.api.active_directory_api import ActiveDirectoryApi +from jcapiv2.api.administrators_api import AdministratorsApi from jcapiv2.api.apple_mdm_api import AppleMDMApi from jcapiv2.api.applications_api import ApplicationsApi +from jcapiv2.api.authentication_policies_api import AuthenticationPoliciesApi from jcapiv2.api.bulk_job_requests_api import BulkJobRequestsApi +from jcapiv2.api.command_results_api import CommandResultsApi from jcapiv2.api.commands_api import CommandsApi +from jcapiv2.api.custom_emails_api import CustomEmailsApi from jcapiv2.api.directories_api import DirectoriesApi from jcapiv2.api.duo_api import DuoApi from jcapiv2.api.g_suite_api import GSuiteApi +from jcapiv2.api.g_suite_import_api import GSuiteImportApi from jcapiv2.api.graph_api import GraphApi from jcapiv2.api.groups_api import GroupsApi -from jcapiv2.api.knowledge_api import KnowledgeApi +from jcapiv2.api.ip_lists_api import IPListsApi +from jcapiv2.api.image_api import ImageApi from jcapiv2.api.ldap_servers_api import LDAPServersApi +from jcapiv2.api.logos_api import LogosApi +from jcapiv2.api.managed_service_provider_api import ManagedServiceProviderApi from jcapiv2.api.office_365_api import Office365Api +from jcapiv2.api.office_365_import_api import Office365ImportApi from jcapiv2.api.organizations_api import OrganizationsApi from jcapiv2.api.policies_api import PoliciesApi +from jcapiv2.api.policy_group_associations_api import PolicyGroupAssociationsApi +from jcapiv2.api.policy_group_members__membership_api import PolicyGroupMembersMembershipApi +from jcapiv2.api.policy_groups_api import PolicyGroupsApi from jcapiv2.api.policytemplates_api import PolicytemplatesApi from jcapiv2.api.providers_api import ProvidersApi from jcapiv2.api.radius_servers_api import RADIUSServersApi +from jcapiv2.api.scim_import_api import SCIMImportApi from jcapiv2.api.samba_domains_api import SambaDomainsApi +from jcapiv2.api.software_apps_api import SoftwareAppsApi +from jcapiv2.api.subscriptions_api import SubscriptionsApi from jcapiv2.api.system_group_associations_api import SystemGroupAssociationsApi from jcapiv2.api.system_group_members__membership_api import SystemGroupMembersMembershipApi from jcapiv2.api.system_groups_api import SystemGroupsApi @@ -45,73 +59,225 @@ from jcapiv2.api.user_groups_api import UserGroupsApi from jcapiv2.api.users_api import UsersApi from jcapiv2.api.workday_import_api import WorkdayImportApi -from jcapiv2.api.default_api import DefaultApi from jcapiv2.api.fde_api import FdeApi - # import ApiClient from jcapiv2.api_client import ApiClient from jcapiv2.configuration import Configuration # import models into sdk package +from jcapiv2.models.ade import ADE +from jcapiv2.models.ades import ADES from jcapiv2.models.active_directory_agent_get_output import ActiveDirectoryAgentGetOutput from jcapiv2.models.active_directory_agent_input import ActiveDirectoryAgentInput from jcapiv2.models.active_directory_agent_list_output import ActiveDirectoryAgentListOutput from jcapiv2.models.active_directory_input import ActiveDirectoryInput +from jcapiv2.models.active_directory_output import ActiveDirectoryOutput +from jcapiv2.models.address import Address from jcapiv2.models.administrator import Administrator +from jcapiv2.models.administrator_organization_link import AdministratorOrganizationLink +from jcapiv2.models.administrator_organization_link_req import AdministratorOrganizationLinkReq +from jcapiv2.models.all_of_autotask_ticketing_alert_configuration_list_records_items import AllOfAutotaskTicketingAlertConfigurationListRecordsItems +from jcapiv2.models.all_of_connect_wise_ticketing_alert_configuration_list_records_items import AllOfConnectWiseTicketingAlertConfigurationListRecordsItems +from jcapiv2.models.any_value import AnyValue from jcapiv2.models.apple_mdm import AppleMDM +from jcapiv2.models.apple_mdm_device import AppleMdmDevice +from jcapiv2.models.apple_mdm_device_info import AppleMdmDeviceInfo +from jcapiv2.models.apple_mdm_device_security_info import AppleMdmDeviceSecurityInfo from jcapiv2.models.apple_mdm_patch_input import AppleMdmPatchInput +from jcapiv2.models.apple_mdm_public_key_cert import AppleMdmPublicKeyCert +from jcapiv2.models.apple_mdm_signed_csr_plist import AppleMdmSignedCsrPlist +from jcapiv2.models.application_id_logo_body import ApplicationIdLogoBody from jcapiv2.models.auth_info import AuthInfo from jcapiv2.models.auth_input import AuthInput from jcapiv2.models.auth_input_object import AuthInputObject from jcapiv2.models.authinput_basic import AuthinputBasic from jcapiv2.models.authinput_oauth import AuthinputOauth -from jcapiv2.models.body import Body -from jcapiv2.models.body1 import Body1 -from jcapiv2.models.body2 import Body2 -from jcapiv2.models.body3 import Body3 +from jcapiv2.models.authn_policy import AuthnPolicy +from jcapiv2.models.authn_policy_effect import AuthnPolicyEffect +from jcapiv2.models.authn_policy_input import AuthnPolicyInput +from jcapiv2.models.authn_policy_obligations import AuthnPolicyObligations +from jcapiv2.models.authn_policy_obligations_mfa import AuthnPolicyObligationsMfa +from jcapiv2.models.authn_policy_obligations_user_verification import AuthnPolicyObligationsUserVerification +from jcapiv2.models.authn_policy_resource_target import AuthnPolicyResourceTarget +from jcapiv2.models.authn_policy_targets import AuthnPolicyTargets +from jcapiv2.models.authn_policy_type import AuthnPolicyType +from jcapiv2.models.authn_policy_user_attribute_filter import AuthnPolicyUserAttributeFilter +from jcapiv2.models.authn_policy_user_attribute_target import AuthnPolicyUserAttributeTarget +from jcapiv2.models.authn_policy_user_group_target import AuthnPolicyUserGroupTarget +from jcapiv2.models.authn_policy_user_target import AuthnPolicyUserTarget +from jcapiv2.models.autotask_company import AutotaskCompany +from jcapiv2.models.autotask_company_resp import AutotaskCompanyResp +from jcapiv2.models.autotask_company_type_resp import AutotaskCompanyTypeResp +from jcapiv2.models.autotask_contract import AutotaskContract +from jcapiv2.models.autotask_contract_field import AutotaskContractField +from jcapiv2.models.autotask_contract_field_values import AutotaskContractFieldValues +from jcapiv2.models.autotask_integration import AutotaskIntegration +from jcapiv2.models.autotask_integration_patch_req import AutotaskIntegrationPatchReq +from jcapiv2.models.autotask_integration_req import AutotaskIntegrationReq +from jcapiv2.models.autotask_mapping_request import AutotaskMappingRequest +from jcapiv2.models.autotask_mapping_request_company import AutotaskMappingRequestCompany +from jcapiv2.models.autotask_mapping_request_contract import AutotaskMappingRequestContract +from jcapiv2.models.autotask_mapping_request_data import AutotaskMappingRequestData +from jcapiv2.models.autotask_mapping_request_organization import AutotaskMappingRequestOrganization +from jcapiv2.models.autotask_mapping_request_service import AutotaskMappingRequestService +from jcapiv2.models.autotask_mapping_response import AutotaskMappingResponse +from jcapiv2.models.autotask_mapping_response_company import AutotaskMappingResponseCompany +from jcapiv2.models.autotask_mapping_response_contract import AutotaskMappingResponseContract +from jcapiv2.models.autotask_mapping_response_organization import AutotaskMappingResponseOrganization +from jcapiv2.models.autotask_mapping_response_service import AutotaskMappingResponseService +from jcapiv2.models.autotask_service import AutotaskService +from jcapiv2.models.autotask_settings import AutotaskSettings +from jcapiv2.models.autotask_settings_patch_req import AutotaskSettingsPatchReq +from jcapiv2.models.autotask_ticketing_alert_configuration import AutotaskTicketingAlertConfiguration +from jcapiv2.models.autotask_ticketing_alert_configuration_list import AutotaskTicketingAlertConfigurationList +from jcapiv2.models.autotask_ticketing_alert_configuration_option import AutotaskTicketingAlertConfigurationOption +from jcapiv2.models.autotask_ticketing_alert_configuration_option_values import AutotaskTicketingAlertConfigurationOptionValues +from jcapiv2.models.autotask_ticketing_alert_configuration_options import AutotaskTicketingAlertConfigurationOptions +from jcapiv2.models.autotask_ticketing_alert_configuration_priority import AutotaskTicketingAlertConfigurationPriority +from jcapiv2.models.autotask_ticketing_alert_configuration_request import AutotaskTicketingAlertConfigurationRequest +from jcapiv2.models.autotask_ticketing_alert_configuration_resource import AutotaskTicketingAlertConfigurationResource +from jcapiv2.models.billing_integration_company_type import BillingIntegrationCompanyType +from jcapiv2.models.bulk_scheduled_statechange_create import BulkScheduledStatechangeCreate from jcapiv2.models.bulk_user_create import BulkUserCreate from jcapiv2.models.bulk_user_update import BulkUserUpdate +from jcapiv2.models.command_result_list import CommandResultList +from jcapiv2.models.command_result_list_results import CommandResultListResults +from jcapiv2.models.connect_wise_mapping_request import ConnectWiseMappingRequest +from jcapiv2.models.connect_wise_mapping_request_company import ConnectWiseMappingRequestCompany +from jcapiv2.models.connect_wise_mapping_request_data import ConnectWiseMappingRequestData +from jcapiv2.models.connect_wise_mapping_request_organization import ConnectWiseMappingRequestOrganization +from jcapiv2.models.connect_wise_mapping_response import ConnectWiseMappingResponse +from jcapiv2.models.connect_wise_mapping_response_addition import ConnectWiseMappingResponseAddition +from jcapiv2.models.connect_wise_settings import ConnectWiseSettings +from jcapiv2.models.connect_wise_settings_patch_req import ConnectWiseSettingsPatchReq +from jcapiv2.models.connect_wise_ticketing_alert_configuration import ConnectWiseTicketingAlertConfiguration +from jcapiv2.models.connect_wise_ticketing_alert_configuration_list import ConnectWiseTicketingAlertConfigurationList +from jcapiv2.models.connect_wise_ticketing_alert_configuration_option import ConnectWiseTicketingAlertConfigurationOption +from jcapiv2.models.connect_wise_ticketing_alert_configuration_options import ConnectWiseTicketingAlertConfigurationOptions +from jcapiv2.models.connect_wise_ticketing_alert_configuration_request import ConnectWiseTicketingAlertConfigurationRequest +from jcapiv2.models.connectwise_addition import ConnectwiseAddition +from jcapiv2.models.connectwise_agreement import ConnectwiseAgreement +from jcapiv2.models.connectwise_company import ConnectwiseCompany +from jcapiv2.models.connectwise_company_resp import ConnectwiseCompanyResp +from jcapiv2.models.connectwise_company_type_resp import ConnectwiseCompanyTypeResp +from jcapiv2.models.connectwise_integration import ConnectwiseIntegration +from jcapiv2.models.connectwise_integration_patch_req import ConnectwiseIntegrationPatchReq +from jcapiv2.models.connectwise_integration_req import ConnectwiseIntegrationReq +from jcapiv2.models.custom_email import CustomEmail +from jcapiv2.models.custom_email_template import CustomEmailTemplate +from jcapiv2.models.custom_email_template_field import CustomEmailTemplateField +from jcapiv2.models.custom_email_type import CustomEmailType +from jcapiv2.models.dep import DEP +from jcapiv2.models.dep_setup_assistant_option import DEPSetupAssistantOption +from jcapiv2.models.dep_welcome_screen import DEPWelcomeScreen +from jcapiv2.models.device_id_erase_body import DeviceIdEraseBody +from jcapiv2.models.device_id_lock_body import DeviceIdLockBody +from jcapiv2.models.device_id_restart_body import DeviceIdRestartBody from jcapiv2.models.directory import Directory from jcapiv2.models.duo_account import DuoAccount from jcapiv2.models.duo_application import DuoApplication from jcapiv2.models.duo_application_req import DuoApplicationReq from jcapiv2.models.duo_application_update_req import DuoApplicationUpdateReq -from jcapiv2.models.duo_registration_application import DuoRegistrationApplication -from jcapiv2.models.duo_registration_application_req import DuoRegistrationApplicationReq -from jcapiv2.models.emailrequest import Emailrequest -from jcapiv2.models.enrollment_profile import EnrollmentProfile from jcapiv2.models.error import Error -from jcapiv2.models.errorresponse import Errorresponse +from jcapiv2.models.error_details import ErrorDetails +from jcapiv2.models.feature import Feature +from jcapiv2.models.filter import Filter +from jcapiv2.models.filter_query import FilterQuery from jcapiv2.models.g_suite_builtin_translation import GSuiteBuiltinTranslation +from jcapiv2.models.g_suite_direction_translation import GSuiteDirectionTranslation from jcapiv2.models.g_suite_translation_rule import GSuiteTranslationRule from jcapiv2.models.g_suite_translation_rule_request import GSuiteTranslationRuleRequest +from jcapiv2.models.graph_attribute_ldap_groups import GraphAttributeLdapGroups +from jcapiv2.models.graph_attribute_posix_groups import GraphAttributePosixGroups +from jcapiv2.models.graph_attribute_posix_groups_posix_groups import GraphAttributePosixGroupsPosixGroups +from jcapiv2.models.graph_attribute_radius import GraphAttributeRadius +from jcapiv2.models.graph_attribute_radius_radius import GraphAttributeRadiusRadius +from jcapiv2.models.graph_attribute_radius_radius_reply import GraphAttributeRadiusRadiusReply +from jcapiv2.models.graph_attribute_samba_enabled import GraphAttributeSambaEnabled +from jcapiv2.models.graph_attribute_sudo import GraphAttributeSudo +from jcapiv2.models.graph_attribute_sudo_sudo import GraphAttributeSudoSudo +from jcapiv2.models.graph_attributes import GraphAttributes from jcapiv2.models.graph_connection import GraphConnection -from jcapiv2.models.graph_management_req import GraphManagementReq from jcapiv2.models.graph_object import GraphObject from jcapiv2.models.graph_object_with_paths import GraphObjectWithPaths +from jcapiv2.models.graph_operation import GraphOperation +from jcapiv2.models.graph_operation_active_directory import GraphOperationActiveDirectory +from jcapiv2.models.graph_operation_application import GraphOperationApplication +from jcapiv2.models.graph_operation_command import GraphOperationCommand +from jcapiv2.models.graph_operation_g_suite import GraphOperationGSuite +from jcapiv2.models.graph_operation_ldap_server import GraphOperationLdapServer +from jcapiv2.models.graph_operation_office365 import GraphOperationOffice365 +from jcapiv2.models.graph_operation_policy import GraphOperationPolicy +from jcapiv2.models.graph_operation_policy_group import GraphOperationPolicyGroup +from jcapiv2.models.graph_operation_policy_group_member import GraphOperationPolicyGroupMember +from jcapiv2.models.graph_operation_radius_server import GraphOperationRadiusServer +from jcapiv2.models.graph_operation_software_app import GraphOperationSoftwareApp +from jcapiv2.models.graph_operation_system import GraphOperationSystem +from jcapiv2.models.graph_operation_system_group import GraphOperationSystemGroup +from jcapiv2.models.graph_operation_system_group_member import GraphOperationSystemGroupMember +from jcapiv2.models.graph_operation_user import GraphOperationUser +from jcapiv2.models.graph_operation_user_group import GraphOperationUserGroup +from jcapiv2.models.graph_operation_user_group_member import GraphOperationUserGroupMember from jcapiv2.models.graph_type import GraphType from jcapiv2.models.group import Group +from jcapiv2.models.group_attributes_user_group import GroupAttributesUserGroup +from jcapiv2.models.group_id_suggestions_body import GroupIdSuggestionsBody from jcapiv2.models.group_type import GroupType from jcapiv2.models.gsuite_output import GsuiteOutput from jcapiv2.models.gsuite_patch_input import GsuitePatchInput +from jcapiv2.models.ip_list import IPList +from jcapiv2.models.ip_list_request import IPListRequest +from jcapiv2.models.import_user import ImportUser +from jcapiv2.models.import_user_address import ImportUserAddress +from jcapiv2.models.import_user_phone_number import ImportUserPhoneNumber +from jcapiv2.models.import_users_response import ImportUsersResponse from jcapiv2.models.inline_response200 import InlineResponse200 from jcapiv2.models.inline_response2001 import InlineResponse2001 +from jcapiv2.models.inline_response20010 import InlineResponse20010 +from jcapiv2.models.inline_response20011 import InlineResponse20011 +from jcapiv2.models.inline_response20011_users import InlineResponse20011Users +from jcapiv2.models.inline_response20012 import InlineResponse20012 +from jcapiv2.models.inline_response20013 import InlineResponse20013 +from jcapiv2.models.inline_response2002 import InlineResponse2002 +from jcapiv2.models.inline_response2002_users import InlineResponse2002Users +from jcapiv2.models.inline_response2003 import InlineResponse2003 +from jcapiv2.models.inline_response2004 import InlineResponse2004 +from jcapiv2.models.inline_response2005 import InlineResponse2005 +from jcapiv2.models.inline_response2006 import InlineResponse2006 +from jcapiv2.models.inline_response2007 import InlineResponse2007 +from jcapiv2.models.inline_response2008 import InlineResponse2008 +from jcapiv2.models.inline_response2009 import InlineResponse2009 from jcapiv2.models.inline_response201 import InlineResponse201 from jcapiv2.models.inline_response400 import InlineResponse400 -from jcapiv2.models.jc_enrollment_profile import JcEnrollmentProfile -from jcapiv2.models.job_details import JobDetails +from jcapiv2.models.integration import Integration +from jcapiv2.models.integration_sync_error import IntegrationSyncError +from jcapiv2.models.integration_sync_error_resp import IntegrationSyncErrorResp +from jcapiv2.models.integration_type import IntegrationType +from jcapiv2.models.integrations_response import IntegrationsResponse from jcapiv2.models.job_id import JobId from jcapiv2.models.job_workresult import JobWorkresult +from jcapiv2.models.ldap_group import LdapGroup from jcapiv2.models.ldap_server_action import LdapServerAction from jcapiv2.models.ldap_server_input import LdapServerInput -from jcapiv2.models.mfa import Mfa +from jcapiv2.models.ldap_server_output import LdapServerOutput +from jcapiv2.models.ldapservers_id_body import LdapserversIdBody +from jcapiv2.models.member_suggestion import MemberSuggestion +from jcapiv2.models.member_suggestions_post_result import MemberSuggestionsPostResult from jcapiv2.models.mobileconfig import Mobileconfig -from jcapiv2.models.oauth_code_input import OauthCodeInput +from jcapiv2.models.os_restriction import OSRestriction +from jcapiv2.models.os_restriction_apple_restrictions import OSRestrictionAppleRestrictions from jcapiv2.models.office365_builtin_translation import Office365BuiltinTranslation +from jcapiv2.models.office365_direction_translation import Office365DirectionTranslation +from jcapiv2.models.office365_output import Office365Output +from jcapiv2.models.office365_patch_input import Office365PatchInput from jcapiv2.models.office365_translation_rule import Office365TranslationRule from jcapiv2.models.office365_translation_rule_request import Office365TranslationRuleRequest -from jcapiv2.models.org_crypto_settings import OrgCryptoSettings -from jcapiv2.models.orgcryptosettings_ssh_keys import OrgcryptosettingsSshKeys +from jcapiv2.models.organization import Organization +from jcapiv2.models.organization_case import OrganizationCase +from jcapiv2.models.organization_cases_response import OrganizationCasesResponse +from jcapiv2.models.phone_number import PhoneNumber from jcapiv2.models.policy import Policy +from jcapiv2.models.policy_group import PolicyGroup +from jcapiv2.models.policy_group_data import PolicyGroupData from jcapiv2.models.policy_request import PolicyRequest from jcapiv2.models.policy_request_template import PolicyRequestTemplate from jcapiv2.models.policy_result import PolicyResult @@ -124,66 +290,112 @@ from jcapiv2.models.policy_with_details import PolicyWithDetails from jcapiv2.models.provider import Provider from jcapiv2.models.provider_admin_req import ProviderAdminReq -from jcapiv2.models.provider_contact import ProviderContact -from jcapiv2.models.salesforce_knowledge_list_output import SalesforceKnowledgeListOutput -from jcapiv2.models.salesforceknowledgelistoutput_inner import SalesforceknowledgelistoutputInner +from jcapiv2.models.provider_invoice import ProviderInvoice +from jcapiv2.models.provider_invoice_response import ProviderInvoiceResponse +from jcapiv2.models.push_endpoint_response import PushEndpointResponse +from jcapiv2.models.push_endpoint_response_device import PushEndpointResponseDevice +from jcapiv2.models.pushendpoints_push_endpoint_id_body import PushendpointsPushEndpointIdBody +from jcapiv2.models.pwm_all_users import PwmAllUsers +from jcapiv2.models.pwm_all_users_groups import PwmAllUsersGroups +from jcapiv2.models.pwm_all_users_results import PwmAllUsersResults +from jcapiv2.models.pwm_overview_app_versions import PwmOverviewAppVersions +from jcapiv2.models.pwm_overview_app_versions_results import PwmOverviewAppVersionsResults +from jcapiv2.models.pwm_overview_main import PwmOverviewMain +from jcapiv2.models.pwm_overview_main_devices import PwmOverviewMainDevices +from jcapiv2.models.query import Query +from jcapiv2.models.queued_command_list import QueuedCommandList +from jcapiv2.models.queued_command_list_results import QueuedCommandListResults from jcapiv2.models.samba_domain_input import SambaDomainInput -from jcapiv2.models.sshkeylist import Sshkeylist -from jcapiv2.models.system_graph_management_req import SystemGraphManagementReq -from jcapiv2.models.system_graph_management_req_attributes import SystemGraphManagementReqAttributes -from jcapiv2.models.system_graph_management_req_attributes_sudo import SystemGraphManagementReqAttributesSudo +from jcapiv2.models.samba_domain_output import SambaDomainOutput +from jcapiv2.models.scheduled_userstate_result import ScheduledUserstateResult +from jcapiv2.models.setup_assistant_option import SetupAssistantOption +from jcapiv2.models.shared_folder_access_levels import SharedFolderAccessLevels +from jcapiv2.models.shared_folder_access_levels_results import SharedFolderAccessLevelsResults +from jcapiv2.models.shared_folder_details import SharedFolderDetails +from jcapiv2.models.shared_folder_users import SharedFolderUsers +from jcapiv2.models.shared_folder_users_results import SharedFolderUsersResults +from jcapiv2.models.shared_folders_list import SharedFoldersList +from jcapiv2.models.shared_folders_list_results import SharedFoldersListResults +from jcapiv2.models.software_app import SoftwareApp +from jcapiv2.models.software_app_apple_vpp import SoftwareAppAppleVpp +from jcapiv2.models.software_app_reclaim_licenses import SoftwareAppReclaimLicenses +from jcapiv2.models.software_app_settings import SoftwareAppSettings +from jcapiv2.models.software_app_status import SoftwareAppStatus +from jcapiv2.models.software_app_with_status import SoftwareAppWithStatus +from jcapiv2.models.software_apps_retry_installation_request import SoftwareAppsRetryInstallationRequest +from jcapiv2.models.subscription import Subscription +from jcapiv2.models.suggestion_counts import SuggestionCounts from jcapiv2.models.system_group import SystemGroup from jcapiv2.models.system_group_data import SystemGroupData -from jcapiv2.models.system_group_graph_management_req import SystemGroupGraphManagementReq -from jcapiv2.models.system_group_members_req import SystemGroupMembersReq +from jcapiv2.models.system_insights_alf import SystemInsightsAlf +from jcapiv2.models.system_insights_alf_exceptions import SystemInsightsAlfExceptions +from jcapiv2.models.system_insights_alf_explicit_auths import SystemInsightsAlfExplicitAuths +from jcapiv2.models.system_insights_appcompat_shims import SystemInsightsAppcompatShims from jcapiv2.models.system_insights_apps import SystemInsightsApps +from jcapiv2.models.system_insights_authorized_keys import SystemInsightsAuthorizedKeys +from jcapiv2.models.system_insights_azure_instance_metadata import SystemInsightsAzureInstanceMetadata +from jcapiv2.models.system_insights_azure_instance_tags import SystemInsightsAzureInstanceTags from jcapiv2.models.system_insights_battery import SystemInsightsBattery from jcapiv2.models.system_insights_bitlocker_info import SystemInsightsBitlockerInfo from jcapiv2.models.system_insights_browser_plugins import SystemInsightsBrowserPlugins +from jcapiv2.models.system_insights_certificates import SystemInsightsCertificates +from jcapiv2.models.system_insights_chassis_info import SystemInsightsChassisInfo from jcapiv2.models.system_insights_chrome_extensions import SystemInsightsChromeExtensions +from jcapiv2.models.system_insights_connectivity import SystemInsightsConnectivity from jcapiv2.models.system_insights_crashes import SystemInsightsCrashes +from jcapiv2.models.system_insights_cups_destinations import SystemInsightsCupsDestinations from jcapiv2.models.system_insights_disk_encryption import SystemInsightsDiskEncryption from jcapiv2.models.system_insights_disk_info import SystemInsightsDiskInfo +from jcapiv2.models.system_insights_dns_resolvers import SystemInsightsDnsResolvers from jcapiv2.models.system_insights_etc_hosts import SystemInsightsEtcHosts from jcapiv2.models.system_insights_firefox_addons import SystemInsightsFirefoxAddons from jcapiv2.models.system_insights_groups import SystemInsightsGroups from jcapiv2.models.system_insights_ie_extensions import SystemInsightsIeExtensions from jcapiv2.models.system_insights_interface_addresses import SystemInsightsInterfaceAddresses +from jcapiv2.models.system_insights_interface_details import SystemInsightsInterfaceDetails from jcapiv2.models.system_insights_kernel_info import SystemInsightsKernelInfo from jcapiv2.models.system_insights_launchd import SystemInsightsLaunchd +from jcapiv2.models.system_insights_linux_packages import SystemInsightsLinuxPackages from jcapiv2.models.system_insights_logged_in_users import SystemInsightsLoggedInUsers -from jcapiv2.models.system_insights_logical_drvies import SystemInsightsLogicalDrvies +from jcapiv2.models.system_insights_logical_drives import SystemInsightsLogicalDrives +from jcapiv2.models.system_insights_managed_policies import SystemInsightsManagedPolicies from jcapiv2.models.system_insights_mounts import SystemInsightsMounts from jcapiv2.models.system_insights_os_version import SystemInsightsOsVersion from jcapiv2.models.system_insights_patches import SystemInsightsPatches from jcapiv2.models.system_insights_programs import SystemInsightsPrograms +from jcapiv2.models.system_insights_python_packages import SystemInsightsPythonPackages from jcapiv2.models.system_insights_safari_extensions import SystemInsightsSafariExtensions +from jcapiv2.models.system_insights_scheduled_tasks import SystemInsightsScheduledTasks +from jcapiv2.models.system_insights_secureboot import SystemInsightsSecureboot +from jcapiv2.models.system_insights_services import SystemInsightsServices +from jcapiv2.models.system_insights_shadow import SystemInsightsShadow +from jcapiv2.models.system_insights_shared_folders import SystemInsightsSharedFolders +from jcapiv2.models.system_insights_shared_resources import SystemInsightsSharedResources +from jcapiv2.models.system_insights_sharing_preferences import SystemInsightsSharingPreferences +from jcapiv2.models.system_insights_sip_config import SystemInsightsSipConfig +from jcapiv2.models.system_insights_startup_items import SystemInsightsStartupItems from jcapiv2.models.system_insights_system_controls import SystemInsightsSystemControls from jcapiv2.models.system_insights_system_info import SystemInsightsSystemInfo +from jcapiv2.models.system_insights_tpm_info import SystemInsightsTpmInfo from jcapiv2.models.system_insights_uptime import SystemInsightsUptime from jcapiv2.models.system_insights_usb_devices import SystemInsightsUsbDevices from jcapiv2.models.system_insights_user_groups import SystemInsightsUserGroups +from jcapiv2.models.system_insights_user_ssh_keys import SystemInsightsUserSshKeys +from jcapiv2.models.system_insights_userassist import SystemInsightsUserassist from jcapiv2.models.system_insights_users import SystemInsightsUsers -from jcapiv2.models.system_insights_windows_crashes import SystemInsightsWindowsCrashes +from jcapiv2.models.system_insights_wifi_networks import SystemInsightsWifiNetworks +from jcapiv2.models.system_insights_wifi_status import SystemInsightsWifiStatus +from jcapiv2.models.system_insights_windows_security_center import SystemInsightsWindowsSecurityCenter +from jcapiv2.models.system_insights_windows_security_products import SystemInsightsWindowsSecurityProducts from jcapiv2.models.systemfdekey import Systemfdekey -from jcapiv2.models.systemuser import Systemuser -from jcapiv2.models.systemuserputpost import Systemuserputpost -from jcapiv2.models.systemuserputpost_addresses import SystemuserputpostAddresses -from jcapiv2.models.systemuserputpost_phone_numbers import SystemuserputpostPhoneNumbers -from jcapiv2.models.user_graph_management_req import UserGraphManagementReq +from jcapiv2.models.ticketing_integration_alert import TicketingIntegrationAlert +from jcapiv2.models.ticketing_integration_alerts_resp import TicketingIntegrationAlertsResp +from jcapiv2.models.user import User from jcapiv2.models.user_group import UserGroup -from jcapiv2.models.user_group_attributes import UserGroupAttributes -from jcapiv2.models.user_group_attributes_posix_groups import UserGroupAttributesPosixGroups -from jcapiv2.models.user_group_graph_management_req import UserGroupGraphManagementReq -from jcapiv2.models.user_group_members_req import UserGroupMembersReq from jcapiv2.models.user_group_post import UserGroupPost from jcapiv2.models.user_group_put import UserGroupPut from jcapiv2.models.workday_fields import WorkdayFields from jcapiv2.models.workday_input import WorkdayInput from jcapiv2.models.workday_output import WorkdayOutput -from jcapiv2.models.workday_request import WorkdayRequest from jcapiv2.models.workday_worker import WorkdayWorker from jcapiv2.models.workdayoutput_auth import WorkdayoutputAuth -from jcapiv2.models.active_directory_output import ActiveDirectoryOutput -from jcapiv2.models.ldap_server_output import LdapServerOutput -from jcapiv2.models.samba_domain_output import SambaDomainOutput diff --git a/jcapiv2/jcapiv2/api/__init__.py b/jcapiv2/jcapiv2/api/__init__.py index 6e3abc3..39d1224 100644 --- a/jcapiv2/jcapiv2/api/__init__.py +++ b/jcapiv2/jcapiv2/api/__init__.py @@ -4,24 +4,39 @@ # import apis into api package from jcapiv2.api.active_directory_api import ActiveDirectoryApi +from jcapiv2.api.administrators_api import AdministratorsApi from jcapiv2.api.apple_mdm_api import AppleMDMApi from jcapiv2.api.applications_api import ApplicationsApi +from jcapiv2.api.authentication_policies_api import AuthenticationPoliciesApi from jcapiv2.api.bulk_job_requests_api import BulkJobRequestsApi +from jcapiv2.api.command_results_api import CommandResultsApi from jcapiv2.api.commands_api import CommandsApi +from jcapiv2.api.custom_emails_api import CustomEmailsApi from jcapiv2.api.directories_api import DirectoriesApi from jcapiv2.api.duo_api import DuoApi from jcapiv2.api.g_suite_api import GSuiteApi +from jcapiv2.api.g_suite_import_api import GSuiteImportApi from jcapiv2.api.graph_api import GraphApi from jcapiv2.api.groups_api import GroupsApi -from jcapiv2.api.knowledge_api import KnowledgeApi +from jcapiv2.api.ip_lists_api import IPListsApi +from jcapiv2.api.image_api import ImageApi from jcapiv2.api.ldap_servers_api import LDAPServersApi +from jcapiv2.api.logos_api import LogosApi +from jcapiv2.api.managed_service_provider_api import ManagedServiceProviderApi from jcapiv2.api.office_365_api import Office365Api +from jcapiv2.api.office_365_import_api import Office365ImportApi from jcapiv2.api.organizations_api import OrganizationsApi from jcapiv2.api.policies_api import PoliciesApi +from jcapiv2.api.policy_group_associations_api import PolicyGroupAssociationsApi +from jcapiv2.api.policy_group_members__membership_api import PolicyGroupMembersMembershipApi +from jcapiv2.api.policy_groups_api import PolicyGroupsApi from jcapiv2.api.policytemplates_api import PolicytemplatesApi from jcapiv2.api.providers_api import ProvidersApi from jcapiv2.api.radius_servers_api import RADIUSServersApi +from jcapiv2.api.scim_import_api import SCIMImportApi from jcapiv2.api.samba_domains_api import SambaDomainsApi +from jcapiv2.api.software_apps_api import SoftwareAppsApi +from jcapiv2.api.subscriptions_api import SubscriptionsApi from jcapiv2.api.system_group_associations_api import SystemGroupAssociationsApi from jcapiv2.api.system_group_members__membership_api import SystemGroupMembersMembershipApi from jcapiv2.api.system_groups_api import SystemGroupsApi @@ -32,5 +47,4 @@ from jcapiv2.api.user_groups_api import UserGroupsApi from jcapiv2.api.users_api import UsersApi from jcapiv2.api.workday_import_api import WorkdayImportApi -from jcapiv2.api.default_api import DefaultApi from jcapiv2.api.fde_api import FdeApi diff --git a/jcapiv2/jcapiv2/api/active_directory_api.py b/jcapiv2/jcapiv2/api/active_directory_api.py index 63c4ad5..e92a466 100644 --- a/jcapiv2/jcapiv2/api/active_directory_api.py +++ b/jcapiv2/jcapiv2/api/active_directory_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,51 +32,49 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def activedirectories_agents_delete(self, activedirectory_id, agent_id, content_type, accept, **kwargs): # noqa: E501 + def activedirectories_agents_delete(self, activedirectory_id, agent_id, **kwargs): # noqa: E501 """Delete Active Directory Agent # noqa: E501 + This endpoint deletes an Active Directory agent. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.activedirectories_agents_delete(activedirectory_id, agent_id, content_type, accept, async_req=True) + >>> thread = api.activedirectories_agents_delete(activedirectory_id, agent_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: (required) :param str agent_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.activedirectories_agents_delete_with_http_info(activedirectory_id, agent_id, content_type, accept, **kwargs) # noqa: E501 + return self.activedirectories_agents_delete_with_http_info(activedirectory_id, agent_id, **kwargs) # noqa: E501 else: - (data) = self.activedirectories_agents_delete_with_http_info(activedirectory_id, agent_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.activedirectories_agents_delete_with_http_info(activedirectory_id, agent_id, **kwargs) # noqa: E501 return data - def activedirectories_agents_delete_with_http_info(self, activedirectory_id, agent_id, content_type, accept, **kwargs): # noqa: E501 + def activedirectories_agents_delete_with_http_info(self, activedirectory_id, agent_id, **kwargs): # noqa: E501 """Delete Active Directory Agent # noqa: E501 + This endpoint deletes an Active Directory agent. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.activedirectories_agents_delete_with_http_info(activedirectory_id, agent_id, content_type, accept, async_req=True) + >>> thread = api.activedirectories_agents_delete_with_http_info(activedirectory_id, agent_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: (required) :param str agent_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['activedirectory_id', 'agent_id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['activedirectory_id', 'agent_id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -100,14 +97,6 @@ def activedirectories_agents_delete_with_http_info(self, activedirectory_id, age if ('agent_id' not in params or params['agent_id'] is None): raise ValueError("Missing the required parameter `agent_id` when calling `activedirectories_agents_delete`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `activedirectories_agents_delete`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `activedirectories_agents_delete`") # noqa: E501 collection_formats = {} @@ -122,25 +111,13 @@ def activedirectories_agents_delete_with_http_info(self, activedirectory_id, age header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting - auth_settings = [] # noqa: E501 + auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( '/activedirectories/{activedirectory_id}/agents/{agent_id}', 'DELETE', @@ -158,53 +135,49 @@ def activedirectories_agents_delete_with_http_info(self, activedirectory_id, age _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def activedirectories_agents_get(self, activedirectory_id, agent_id, content_type, accept, **kwargs): # noqa: E501 + def activedirectories_agents_get(self, activedirectory_id, agent_id, **kwargs): # noqa: E501 """Get Active Directory Agent # noqa: E501 - This endpoint returns a specific active directory agent. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns an Active Directory agent. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.activedirectories_agents_get(activedirectory_id, agent_id, content_type, accept, async_req=True) + >>> thread = api.activedirectories_agents_get(activedirectory_id, agent_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: (required) :param str agent_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: ActiveDirectoryAgentListOutput If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.activedirectories_agents_get_with_http_info(activedirectory_id, agent_id, content_type, accept, **kwargs) # noqa: E501 + return self.activedirectories_agents_get_with_http_info(activedirectory_id, agent_id, **kwargs) # noqa: E501 else: - (data) = self.activedirectories_agents_get_with_http_info(activedirectory_id, agent_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.activedirectories_agents_get_with_http_info(activedirectory_id, agent_id, **kwargs) # noqa: E501 return data - def activedirectories_agents_get_with_http_info(self, activedirectory_id, agent_id, content_type, accept, **kwargs): # noqa: E501 + def activedirectories_agents_get_with_http_info(self, activedirectory_id, agent_id, **kwargs): # noqa: E501 """Get Active Directory Agent # noqa: E501 - This endpoint returns a specific active directory agent. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns an Active Directory agent. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.activedirectories_agents_get_with_http_info(activedirectory_id, agent_id, content_type, accept, async_req=True) + >>> thread = api.activedirectories_agents_get_with_http_info(activedirectory_id, agent_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: (required) :param str agent_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: ActiveDirectoryAgentListOutput If the method is called asynchronously, returns the request thread. """ - all_params = ['activedirectory_id', 'agent_id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['activedirectory_id', 'agent_id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -227,14 +200,6 @@ def activedirectories_agents_get_with_http_info(self, activedirectory_id, agent_ if ('agent_id' not in params or params['agent_id'] is None): raise ValueError("Missing the required parameter `agent_id` when calling `activedirectories_agents_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `activedirectories_agents_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `activedirectories_agents_get`") # noqa: E501 collection_formats = {} @@ -249,10 +214,6 @@ def activedirectories_agents_get_with_http_info(self, activedirectory_id, agent_ header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -262,12 +223,8 @@ def activedirectories_agents_get_with_http_info(self, activedirectory_id, agent_ header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting - auth_settings = [] # noqa: E501 + auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( '/activedirectories/{activedirectory_id}/agents/{agent_id}', 'GET', @@ -285,57 +242,53 @@ def activedirectories_agents_get_with_http_info(self, activedirectory_id, agent_ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def activedirectories_agents_list(self, activedirectory_id, content_type, accept, **kwargs): # noqa: E501 + def activedirectories_agents_list(self, activedirectory_id, **kwargs): # noqa: E501 """List Active Directory Agents # noqa: E501 This endpoint allows you to list all your Active Directory Agents for a given Instance. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.activedirectories_agents_list(activedirectory_id, content_type, accept, async_req=True) + >>> thread = api.activedirectories_agents_list(activedirectory_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[ActiveDirectoryAgentListOutput] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.activedirectories_agents_list_with_http_info(activedirectory_id, content_type, accept, **kwargs) # noqa: E501 + return self.activedirectories_agents_list_with_http_info(activedirectory_id, **kwargs) # noqa: E501 else: - (data) = self.activedirectories_agents_list_with_http_info(activedirectory_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.activedirectories_agents_list_with_http_info(activedirectory_id, **kwargs) # noqa: E501 return data - def activedirectories_agents_list_with_http_info(self, activedirectory_id, content_type, accept, **kwargs): # noqa: E501 + def activedirectories_agents_list_with_http_info(self, activedirectory_id, **kwargs): # noqa: E501 """List Active Directory Agents # noqa: E501 This endpoint allows you to list all your Active Directory Agents for a given Instance. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.activedirectories_agents_list_with_http_info(activedirectory_id, content_type, accept, async_req=True) + >>> thread = api.activedirectories_agents_list_with_http_info(activedirectory_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[ActiveDirectoryAgentListOutput] If the method is called asynchronously, returns the request thread. """ - all_params = ['activedirectory_id', 'content_type', 'accept', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['activedirectory_id', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -354,17 +307,7 @@ def activedirectories_agents_list_with_http_info(self, activedirectory_id, conte if ('activedirectory_id' not in params or params['activedirectory_id'] is None): raise ValueError("Missing the required parameter `activedirectory_id` when calling `activedirectories_agents_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `activedirectories_agents_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `activedirectories_agents_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `activedirectories_agents_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -381,10 +324,6 @@ def activedirectories_agents_list_with_http_info(self, activedirectory_id, conte collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -396,10 +335,6 @@ def activedirectories_agents_list_with_http_info(self, activedirectory_id, conte header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -419,53 +354,49 @@ def activedirectories_agents_list_with_http_info(self, activedirectory_id, conte _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def activedirectories_agents_post(self, activedirectory_id, content_type, accept, **kwargs): # noqa: E501 + def activedirectories_agents_post(self, activedirectory_id, **kwargs): # noqa: E501 """Create a new Active Directory Agent # noqa: E501 This endpoint allows you to create a new Active Directory Agent. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.activedirectories_agents_post(activedirectory_id, content_type, accept, async_req=True) + >>> thread = api.activedirectories_agents_post(activedirectory_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: (required) - :param str content_type: (required) - :param str accept: (required) :param ActiveDirectoryAgentInput body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: ActiveDirectoryAgentGetOutput If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.activedirectories_agents_post_with_http_info(activedirectory_id, content_type, accept, **kwargs) # noqa: E501 + return self.activedirectories_agents_post_with_http_info(activedirectory_id, **kwargs) # noqa: E501 else: - (data) = self.activedirectories_agents_post_with_http_info(activedirectory_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.activedirectories_agents_post_with_http_info(activedirectory_id, **kwargs) # noqa: E501 return data - def activedirectories_agents_post_with_http_info(self, activedirectory_id, content_type, accept, **kwargs): # noqa: E501 + def activedirectories_agents_post_with_http_info(self, activedirectory_id, **kwargs): # noqa: E501 """Create a new Active Directory Agent # noqa: E501 This endpoint allows you to create a new Active Directory Agent. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.activedirectories_agents_post_with_http_info(activedirectory_id, content_type, accept, async_req=True) + >>> thread = api.activedirectories_agents_post_with_http_info(activedirectory_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: (required) - :param str content_type: (required) - :param str accept: (required) :param ActiveDirectoryAgentInput body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: ActiveDirectoryAgentGetOutput If the method is called asynchronously, returns the request thread. """ - all_params = ['activedirectory_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['activedirectory_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -484,14 +415,6 @@ def activedirectories_agents_post_with_http_info(self, activedirectory_id, conte if ('activedirectory_id' not in params or params['activedirectory_id'] is None): raise ValueError("Missing the required parameter `activedirectory_id` when calling `activedirectories_agents_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `activedirectories_agents_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `activedirectories_agents_post`") # noqa: E501 collection_formats = {} @@ -504,10 +427,6 @@ def activedirectories_agents_post_with_http_info(self, activedirectory_id, conte header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -542,51 +461,47 @@ def activedirectories_agents_post_with_http_info(self, activedirectory_id, conte _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def activedirectories_delete(self, id, content_type, accept, **kwargs): # noqa: E501 + def activedirectories_delete(self, id, **kwargs): # noqa: E501 """Delete an Active Directory # noqa: E501 - This endpoint allows you to delete an Active Directory Instance. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY' ``` # noqa: E501 + This endpoint allows you to delete an Active Directory Instance. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.activedirectories_delete(id, content_type, accept, async_req=True) + >>> thread = api.activedirectories_delete(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of this Active Directory instance. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: None + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: ActiveDirectoryOutput If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.activedirectories_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.activedirectories_delete_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.activedirectories_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.activedirectories_delete_with_http_info(id, **kwargs) # noqa: E501 return data - def activedirectories_delete_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def activedirectories_delete_with_http_info(self, id, **kwargs): # noqa: E501 """Delete an Active Directory # noqa: E501 - This endpoint allows you to delete an Active Directory Instance. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY' ``` # noqa: E501 + This endpoint allows you to delete an Active Directory Instance. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.activedirectories_delete_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.activedirectories_delete_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of this Active Directory instance. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: None + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: ActiveDirectoryOutput If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -605,14 +520,6 @@ def activedirectories_delete_with_http_info(self, id, content_type, accept, **kw if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `activedirectories_delete`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `activedirectories_delete`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `activedirectories_delete`") # noqa: E501 collection_formats = {} @@ -623,10 +530,6 @@ def activedirectories_delete_with_http_info(self, id, content_type, accept, **kw query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -638,10 +541,6 @@ def activedirectories_delete_with_http_info(self, id, content_type, accept, **kw header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -653,7 +552,7 @@ def activedirectories_delete_with_http_info(self, id, content_type, accept, **kw body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='ActiveDirectoryOutput', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -661,51 +560,47 @@ def activedirectories_delete_with_http_info(self, id, content_type, accept, **kw _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def activedirectories_get(self, id, content_type, accept, **kwargs): # noqa: E501 + def activedirectories_get(self, id, **kwargs): # noqa: E501 """Get an Active Directory # noqa: E501 This endpoint returns a specific Active Directory. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.activedirectories_get(id, content_type, accept, async_req=True) + >>> thread = api.activedirectories_get(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of this Active Directory instance. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: ActiveDirectoryOutput If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.activedirectories_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.activedirectories_get_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.activedirectories_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.activedirectories_get_with_http_info(id, **kwargs) # noqa: E501 return data - def activedirectories_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def activedirectories_get_with_http_info(self, id, **kwargs): # noqa: E501 """Get an Active Directory # noqa: E501 This endpoint returns a specific Active Directory. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.activedirectories_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.activedirectories_get_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of this Active Directory instance. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: ActiveDirectoryOutput If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -724,14 +619,6 @@ def activedirectories_get_with_http_info(self, id, content_type, accept, **kwarg if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `activedirectories_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `activedirectories_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `activedirectories_get`") # noqa: E501 collection_formats = {} @@ -742,10 +629,6 @@ def activedirectories_get_with_http_info(self, id, content_type, accept, **kwarg query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -757,10 +640,6 @@ def activedirectories_get_with_http_info(self, id, content_type, accept, **kwarg header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -780,59 +659,55 @@ def activedirectories_get_with_http_info(self, id, content_type, accept, **kwarg _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def activedirectories_list(self, content_type, accept, **kwargs): # noqa: E501 + def activedirectories_list(self, **kwargs): # noqa: E501 """List Active Directories # noqa: E501 This endpoint allows you to list all your Active Directory Instances. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/ \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.activedirectories_list(content_type, accept, async_req=True) + >>> thread = api.activedirectories_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[ActiveDirectoryOutput] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.activedirectories_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.activedirectories_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.activedirectories_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.activedirectories_list_with_http_info(**kwargs) # noqa: E501 return data - def activedirectories_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def activedirectories_list_with_http_info(self, **kwargs): # noqa: E501 """List Active Directories # noqa: E501 This endpoint allows you to list all your Active Directory Instances. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/ \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.activedirectories_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.activedirectories_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[ActiveDirectoryOutput] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -847,17 +722,7 @@ def activedirectories_list_with_http_info(self, content_type, accept, **kwargs): ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `activedirectories_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `activedirectories_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `activedirectories_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -878,10 +743,6 @@ def activedirectories_list_with_http_info(self, content_type, accept, **kwargs): collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -893,10 +754,6 @@ def activedirectories_list_with_http_info(self, content_type, accept, **kwargs): header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -916,51 +773,47 @@ def activedirectories_list_with_http_info(self, content_type, accept, **kwargs): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def activedirectories_post(self, content_type, accept, **kwargs): # noqa: E501 + def activedirectories_post(self, **kwargs): # noqa: E501 """Create a new Active Directory # noqa: E501 - This endpoint allows you to create a new Active Directory. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/ \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"domain\": \"{DC=AD_domain_name;DC=com}\" } ' ``` # noqa: E501 + This endpoint allows you to create a new Active Directory. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/ \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"domain\": \"{DC=AD_domain_name;DC=com}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.activedirectories_post(content_type, accept, async_req=True) + >>> thread = api.activedirectories_post(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param ActiveDirectoryInput body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: ActiveDirectoryOutput If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.activedirectories_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.activedirectories_post_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.activedirectories_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.activedirectories_post_with_http_info(**kwargs) # noqa: E501 return data - def activedirectories_post_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def activedirectories_post_with_http_info(self, **kwargs): # noqa: E501 """Create a new Active Directory # noqa: E501 - This endpoint allows you to create a new Active Directory. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/ \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"domain\": \"{DC=AD_domain_name;DC=com}\" } ' ``` # noqa: E501 + This endpoint allows you to create a new Active Directory. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/ \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"domain\": \"{DC=AD_domain_name;DC=com}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.activedirectories_post_with_http_info(content_type, accept, async_req=True) + >>> thread = api.activedirectories_post_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param ActiveDirectoryInput body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: ActiveDirectoryOutput If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -975,14 +828,6 @@ def activedirectories_post_with_http_info(self, content_type, accept, **kwargs): ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `activedirectories_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `activedirectories_post`") # noqa: E501 collection_formats = {} @@ -991,10 +836,6 @@ def activedirectories_post_with_http_info(self, content_type, accept, **kwargs): query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1031,57 +872,53 @@ def activedirectories_post_with_http_info(self, content_type, accept, **kwargs): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_active_directory_associations_list(self, activedirectory_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_active_directory_associations_list(self, activedirectory_id, targets, **kwargs): # noqa: E501 """List the associations of an Active Directory instance # noqa: E501 This endpoint returns the direct associations of this Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/associations?targets=user \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_active_directory_associations_list(activedirectory_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_active_directory_associations_list(activedirectory_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"active_directory\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_active_directory_associations_list_with_http_info(activedirectory_id, targets, content_type, accept, **kwargs) # noqa: E501 + return self.graph_active_directory_associations_list_with_http_info(activedirectory_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_active_directory_associations_list_with_http_info(activedirectory_id, targets, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_active_directory_associations_list_with_http_info(activedirectory_id, targets, **kwargs) # noqa: E501 return data - def graph_active_directory_associations_list_with_http_info(self, activedirectory_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_active_directory_associations_list_with_http_info(self, activedirectory_id, targets, **kwargs): # noqa: E501 """List the associations of an Active Directory instance # noqa: E501 This endpoint returns the direct associations of this Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/associations?targets=user \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_active_directory_associations_list_with_http_info(activedirectory_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_active_directory_associations_list_with_http_info(activedirectory_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"active_directory\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['activedirectory_id', 'targets', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['activedirectory_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1104,17 +941,7 @@ def graph_active_directory_associations_list_with_http_info(self, activedirector if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_active_directory_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_active_directory_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_active_directory_associations_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_active_directory_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1131,10 +958,6 @@ def graph_active_directory_associations_list_with_http_info(self, activedirector query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1146,10 +969,6 @@ def graph_active_directory_associations_list_with_http_info(self, activedirector header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1169,53 +988,49 @@ def graph_active_directory_associations_list_with_http_info(self, activedirector _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_active_directory_associations_post(self, activedirectory_id, content_type, accept, **kwargs): # noqa: E501 + def graph_active_directory_associations_post(self, activedirectory_id, **kwargs): # noqa: E501 """Manage the associations of an Active Directory instance # noqa: E501 - This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" } ' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_active_directory_associations_post(activedirectory_id, content_type, accept, async_req=True) + >>> thread = api.graph_active_directory_associations_post(activedirectory_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationActiveDirectory body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_active_directory_associations_post_with_http_info(activedirectory_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_active_directory_associations_post_with_http_info(activedirectory_id, **kwargs) # noqa: E501 else: - (data) = self.graph_active_directory_associations_post_with_http_info(activedirectory_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_active_directory_associations_post_with_http_info(activedirectory_id, **kwargs) # noqa: E501 return data - def graph_active_directory_associations_post_with_http_info(self, activedirectory_id, content_type, accept, **kwargs): # noqa: E501 + def graph_active_directory_associations_post_with_http_info(self, activedirectory_id, **kwargs): # noqa: E501 """Manage the associations of an Active Directory instance # noqa: E501 - This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" } ' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_active_directory_associations_post_with_http_info(activedirectory_id, content_type, accept, async_req=True) + >>> thread = api.graph_active_directory_associations_post_with_http_info(activedirectory_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationActiveDirectory body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['activedirectory_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['activedirectory_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1234,14 +1049,6 @@ def graph_active_directory_associations_post_with_http_info(self, activedirector if ('activedirectory_id' not in params or params['activedirectory_id'] is None): raise ValueError("Missing the required parameter `activedirectory_id` when calling `graph_active_directory_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_active_directory_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_active_directory_associations_post`") # noqa: E501 collection_formats = {} @@ -1252,10 +1059,6 @@ def graph_active_directory_associations_post_with_http_info(self, activedirector query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1265,10 +1068,6 @@ def graph_active_directory_associations_post_with_http_info(self, activedirector body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -1292,57 +1091,165 @@ def graph_active_directory_associations_post_with_http_info(self, activedirector _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_active_directory_traverse_user_group(self, activedirectory_id, content_type, accept, **kwargs): # noqa: E501 + def graph_active_directory_traverse_user(self, activedirectory_id, **kwargs): # noqa: E501 + """List the Users bound to an Active Directory instance # noqa: E501 + + This endpoint will return all Users bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_active_directory_traverse_user(activedirectory_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str activedirectory_id: ObjectID of the Active Directory instance. (required) + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_active_directory_traverse_user_with_http_info(activedirectory_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_active_directory_traverse_user_with_http_info(activedirectory_id, **kwargs) # noqa: E501 + return data + + def graph_active_directory_traverse_user_with_http_info(self, activedirectory_id, **kwargs): # noqa: E501 + """List the Users bound to an Active Directory instance # noqa: E501 + + This endpoint will return all Users bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_active_directory_traverse_user_with_http_info(activedirectory_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str activedirectory_id: ObjectID of the Active Directory instance. (required) + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['activedirectory_id', 'filter', 'limit', 'x_org_id', 'skip'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_active_directory_traverse_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'activedirectory_id' is set + if ('activedirectory_id' not in params or + params['activedirectory_id'] is None): + raise ValueError("Missing the required parameter `activedirectory_id` when calling `graph_active_directory_traverse_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'activedirectory_id' in params: + path_params['activedirectory_id'] = params['activedirectory_id'] # noqa: E501 + + query_params = [] + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/activedirectories/{activedirectory_id}/users', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_active_directory_traverse_user_group(self, activedirectory_id, **kwargs): # noqa: E501 """List the User Groups bound to an Active Directory instance # noqa: E501 This endpoint will return all Users Groups bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_active_directory_traverse_user_group(activedirectory_id, content_type, accept, async_req=True) + >>> thread = api.graph_active_directory_traverse_user_group(activedirectory_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: ObjectID of the Active Directory instance. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_active_directory_traverse_user_group_with_http_info(activedirectory_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_active_directory_traverse_user_group_with_http_info(activedirectory_id, **kwargs) # noqa: E501 else: - (data) = self.graph_active_directory_traverse_user_group_with_http_info(activedirectory_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_active_directory_traverse_user_group_with_http_info(activedirectory_id, **kwargs) # noqa: E501 return data - def graph_active_directory_traverse_user_group_with_http_info(self, activedirectory_id, content_type, accept, **kwargs): # noqa: E501 + def graph_active_directory_traverse_user_group_with_http_info(self, activedirectory_id, **kwargs): # noqa: E501 """List the User Groups bound to an Active Directory instance # noqa: E501 This endpoint will return all Users Groups bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_active_directory_traverse_user_group_with_http_info(activedirectory_id, content_type, accept, async_req=True) + >>> thread = api.graph_active_directory_traverse_user_group_with_http_info(activedirectory_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: ObjectID of the Active Directory instance. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['activedirectory_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['activedirectory_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1361,17 +1268,7 @@ def graph_active_directory_traverse_user_group_with_http_info(self, activedirect if ('activedirectory_id' not in params or params['activedirectory_id'] is None): raise ValueError("Missing the required parameter `activedirectory_id` when calling `graph_active_directory_traverse_user_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_active_directory_traverse_user_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_active_directory_traverse_user_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_active_directory_traverse_user_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1390,10 +1287,6 @@ def graph_active_directory_traverse_user_group_with_http_info(self, activedirect header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1403,10 +1296,6 @@ def graph_active_directory_traverse_user_group_with_http_info(self, activedirect header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 diff --git a/jcapiv2/jcapiv2/api/administrators_api.py b/jcapiv2/jcapiv2/api/administrators_api.py new file mode 100644 index 0000000..c75e1f2 --- /dev/null +++ b/jcapiv2/jcapiv2/api/administrators_api.py @@ -0,0 +1,445 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv2.api_client import ApiClient + + +class AdministratorsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def administrator_organizations_create_by_administrator(self, id, **kwargs): # noqa: E501 + """Allow Adminstrator access to an Organization. # noqa: E501 + + This endpoint allows you to grant Administrator access to an Organization. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_create_by_administrator(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param AdministratorOrganizationLinkReq body: + :return: AdministratorOrganizationLink + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.administrator_organizations_create_by_administrator_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.administrator_organizations_create_by_administrator_with_http_info(id, **kwargs) # noqa: E501 + return data + + def administrator_organizations_create_by_administrator_with_http_info(self, id, **kwargs): # noqa: E501 + """Allow Adminstrator access to an Organization. # noqa: E501 + + This endpoint allows you to grant Administrator access to an Organization. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_create_by_administrator_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param AdministratorOrganizationLinkReq body: + :return: AdministratorOrganizationLink + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method administrator_organizations_create_by_administrator" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `administrator_organizations_create_by_administrator`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/administrators/{id}/organizationlinks', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AdministratorOrganizationLink', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def administrator_organizations_list_by_administrator(self, id, **kwargs): # noqa: E501 + """List the association links between an Administrator and Organizations. # noqa: E501 + + This endpoint returns the association links between an Administrator and Organizations. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_list_by_administrator(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: list[AdministratorOrganizationLink] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.administrator_organizations_list_by_administrator_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.administrator_organizations_list_by_administrator_with_http_info(id, **kwargs) # noqa: E501 + return data + + def administrator_organizations_list_by_administrator_with_http_info(self, id, **kwargs): # noqa: E501 + """List the association links between an Administrator and Organizations. # noqa: E501 + + This endpoint returns the association links between an Administrator and Organizations. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_list_by_administrator_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: list[AdministratorOrganizationLink] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'limit', 'skip'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method administrator_organizations_list_by_administrator" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `administrator_organizations_list_by_administrator`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/administrators/{id}/organizationlinks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[AdministratorOrganizationLink]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def administrator_organizations_list_by_organization(self, id, **kwargs): # noqa: E501 + """List the association links between an Organization and Administrators. # noqa: E501 + + This endpoint returns the association links between an Organization and Administrators. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_list_by_organization(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: list[AdministratorOrganizationLink] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.administrator_organizations_list_by_organization_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.administrator_organizations_list_by_organization_with_http_info(id, **kwargs) # noqa: E501 + return data + + def administrator_organizations_list_by_organization_with_http_info(self, id, **kwargs): # noqa: E501 + """List the association links between an Organization and Administrators. # noqa: E501 + + This endpoint returns the association links between an Organization and Administrators. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_list_by_organization_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: list[AdministratorOrganizationLink] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'limit', 'skip'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method administrator_organizations_list_by_organization" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `administrator_organizations_list_by_organization`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/organizations/{id}/administratorlinks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[AdministratorOrganizationLink]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def administrator_organizations_remove_by_administrator(self, administrator_id, id, **kwargs): # noqa: E501 + """Remove association between an Administrator and an Organization. # noqa: E501 + + This endpoint removes the association link between an Administrator and an Organization. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_remove_by_administrator(administrator_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str administrator_id: (required) + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.administrator_organizations_remove_by_administrator_with_http_info(administrator_id, id, **kwargs) # noqa: E501 + else: + (data) = self.administrator_organizations_remove_by_administrator_with_http_info(administrator_id, id, **kwargs) # noqa: E501 + return data + + def administrator_organizations_remove_by_administrator_with_http_info(self, administrator_id, id, **kwargs): # noqa: E501 + """Remove association between an Administrator and an Organization. # noqa: E501 + + This endpoint removes the association link between an Administrator and an Organization. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_remove_by_administrator_with_http_info(administrator_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str administrator_id: (required) + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['administrator_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method administrator_organizations_remove_by_administrator" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'administrator_id' is set + if ('administrator_id' not in params or + params['administrator_id'] is None): + raise ValueError("Missing the required parameter `administrator_id` when calling `administrator_organizations_remove_by_administrator`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `administrator_organizations_remove_by_administrator`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'administrator_id' in params: + path_params['administrator_id'] = params['administrator_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/administrators/{administrator_id}/organizationlinks/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/apple_mdm_api.py b/jcapiv2/jcapiv2/api/apple_mdm_api.py index 62a46eb..54475d1 100644 --- a/jcapiv2/jcapiv2/api/apple_mdm_api.py +++ b/jcapiv2/jcapiv2/api/apple_mdm_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,51 +32,146 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def applemdms_delete(self, apple_mdm_id, content_type, accept, **kwargs): # noqa: E501 + def applemdms_csrget(self, apple_mdm_id, **kwargs): # noqa: E501 + """Get Apple MDM CSR Plist # noqa: E501 + + Retrieves an Apple MDM signed CSR Plist for an organization. The user must supply the returned plist to Apple for signing, and then provide the certificate provided by Apple back into the PUT API. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/csr \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_csrget(apple_mdm_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AppleMdmSignedCsrPlist + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.applemdms_csrget_with_http_info(apple_mdm_id, **kwargs) # noqa: E501 + else: + (data) = self.applemdms_csrget_with_http_info(apple_mdm_id, **kwargs) # noqa: E501 + return data + + def applemdms_csrget_with_http_info(self, apple_mdm_id, **kwargs): # noqa: E501 + """Get Apple MDM CSR Plist # noqa: E501 + + Retrieves an Apple MDM signed CSR Plist for an organization. The user must supply the returned plist to Apple for signing, and then provide the certificate provided by Apple back into the PUT API. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/csr \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_csrget_with_http_info(apple_mdm_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AppleMdmSignedCsrPlist + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['apple_mdm_id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method applemdms_csrget" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'apple_mdm_id' is set + if ('apple_mdm_id' not in params or + params['apple_mdm_id'] is None): + raise ValueError("Missing the required parameter `apple_mdm_id` when calling `applemdms_csrget`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'apple_mdm_id' in params: + path_params['apple_mdm_id'] = params['apple_mdm_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/octet-stream']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/applemdms/{apple_mdm_id}/csr', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AppleMdmSignedCsrPlist', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def applemdms_delete(self, id, **kwargs): # noqa: E501 """Delete an Apple MDM # noqa: E501 Removes an Apple MDM configuration. Warning: This is a destructive operation and will remove your Apple Push Certificates. We will no longer be able to manage your devices and the only recovery option is to re-register all devices into MDM. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/applemdms/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.applemdms_delete(apple_mdm_id, content_type, accept, async_req=True) + >>> thread = api.applemdms_delete(id, async_req=True) >>> result = thread.get() :param async_req bool - :param str apple_mdm_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: AppleMDM If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.applemdms_delete_with_http_info(apple_mdm_id, content_type, accept, **kwargs) # noqa: E501 + return self.applemdms_delete_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.applemdms_delete_with_http_info(apple_mdm_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.applemdms_delete_with_http_info(id, **kwargs) # noqa: E501 return data - def applemdms_delete_with_http_info(self, apple_mdm_id, content_type, accept, **kwargs): # noqa: E501 + def applemdms_delete_with_http_info(self, id, **kwargs): # noqa: E501 """Delete an Apple MDM # noqa: E501 Removes an Apple MDM configuration. Warning: This is a destructive operation and will remove your Apple Push Certificates. We will no longer be able to manage your devices and the only recovery option is to re-register all devices into MDM. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/applemdms/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.applemdms_delete_with_http_info(apple_mdm_id, content_type, accept, async_req=True) + >>> thread = api.applemdms_delete_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool - :param str apple_mdm_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: AppleMDM If the method is called asynchronously, returns the request thread. """ - all_params = ['apple_mdm_id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -92,34 +186,129 @@ def applemdms_delete_with_http_info(self, apple_mdm_id, content_type, accept, ** ) params[key] = val del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `applemdms_delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/applemdms/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AppleMDM', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def applemdms_deletedevice(self, apple_mdm_id, device_id, **kwargs): # noqa: E501 + """Remove an Apple MDM Device's Enrollment # noqa: E501 + + Remove a single Apple MDM device from MDM enrollment. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id} \\ -H 'accept: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_deletedevice(apple_mdm_id, device_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str device_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AppleMdmDevice + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.applemdms_deletedevice_with_http_info(apple_mdm_id, device_id, **kwargs) # noqa: E501 + else: + (data) = self.applemdms_deletedevice_with_http_info(apple_mdm_id, device_id, **kwargs) # noqa: E501 + return data + + def applemdms_deletedevice_with_http_info(self, apple_mdm_id, device_id, **kwargs): # noqa: E501 + """Remove an Apple MDM Device's Enrollment # noqa: E501 + + Remove a single Apple MDM device from MDM enrollment. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id} \\ -H 'accept: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_deletedevice_with_http_info(apple_mdm_id, device_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str device_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AppleMdmDevice + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['apple_mdm_id', 'device_id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method applemdms_deletedevice" % key + ) + params[key] = val + del params['kwargs'] # verify the required parameter 'apple_mdm_id' is set if ('apple_mdm_id' not in params or params['apple_mdm_id'] is None): - raise ValueError("Missing the required parameter `apple_mdm_id` when calling `applemdms_delete`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `applemdms_delete`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `applemdms_delete`") # noqa: E501 + raise ValueError("Missing the required parameter `apple_mdm_id` when calling `applemdms_deletedevice`") # noqa: E501 + # verify the required parameter 'device_id' is set + if ('device_id' not in params or + params['device_id'] is None): + raise ValueError("Missing the required parameter `device_id` when calling `applemdms_deletedevice`") # noqa: E501 collection_formats = {} path_params = {} if 'apple_mdm_id' in params: path_params['apple_mdm_id'] = params['apple_mdm_id'] # noqa: E501 + if 'device_id' in params: + path_params['device_id'] = params['device_id'] # noqa: E501 query_params = [] header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -129,22 +318,18 @@ def applemdms_delete_with_http_info(self, apple_mdm_id, content_type, accept, ** header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/applemdms/{apple_mdm_id}', 'DELETE', + '/applemdms/{apple_mdm_id}/devices/{device_id}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='AppleMDM', # noqa: E501 + response_type='AppleMdmDevice', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -152,49 +337,47 @@ def applemdms_delete_with_http_info(self, apple_mdm_id, content_type, accept, ** _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def applemdms_list(self, content_type, accept, **kwargs): # noqa: E501 - """List Apple MDMs # noqa: E501 + def applemdms_depkeyget(self, apple_mdm_id, **kwargs): # noqa: E501 + """Get Apple MDM DEP Public Key # noqa: E501 - Get a list of all Apple MDM configurations. An empty topic indicates that a signed certificate from Apple has not been provided to the PUT endpoint yet. Note: currently only one MDM configuration per organization is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + Retrieves an Apple MDM DEP Public Key. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.applemdms_list(content_type, accept, async_req=True) + >>> thread = api.applemdms_depkeyget(apple_mdm_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: list[AppleMDM] + :param str apple_mdm_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AppleMdmPublicKeyCert If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.applemdms_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.applemdms_depkeyget_with_http_info(apple_mdm_id, **kwargs) # noqa: E501 else: - (data) = self.applemdms_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.applemdms_depkeyget_with_http_info(apple_mdm_id, **kwargs) # noqa: E501 return data - def applemdms_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List Apple MDMs # noqa: E501 + def applemdms_depkeyget_with_http_info(self, apple_mdm_id, **kwargs): # noqa: E501 + """Get Apple MDM DEP Public Key # noqa: E501 - Get a list of all Apple MDM configurations. An empty topic indicates that a signed certificate from Apple has not been provided to the PUT endpoint yet. Note: currently only one MDM configuration per organization is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + Retrieves an Apple MDM DEP Public Key. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.applemdms_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.applemdms_depkeyget_with_http_info(apple_mdm_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: list[AppleMDM] + :param str apple_mdm_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AppleMdmPublicKeyCert If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['apple_mdm_id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -205,32 +388,26 @@ def applemdms_list_with_http_info(self, content_type, accept, **kwargs): # noqa if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method applemdms_list" % key + " to method applemdms_depkeyget" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `applemdms_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `applemdms_list`") # noqa: E501 + # verify the required parameter 'apple_mdm_id' is set + if ('apple_mdm_id' not in params or + params['apple_mdm_id'] is None): + raise ValueError("Missing the required parameter `apple_mdm_id` when calling `applemdms_depkeyget`") # noqa: E501 collection_formats = {} path_params = {} + if 'apple_mdm_id' in params: + path_params['apple_mdm_id'] = params['apple_mdm_id'] # noqa: E501 query_params = [] header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -238,24 +415,20 @@ def applemdms_list_with_http_info(self, content_type, accept, **kwargs): # noqa body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + ['application/x-pem-file']) # noqa: E501 # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/applemdms', 'GET', + '/applemdms/{apple_mdm_id}/depkey', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[AppleMDM]', # noqa: E501 + response_type='AppleMdmPublicKeyCert', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -263,51 +436,49 @@ def applemdms_list_with_http_info(self, content_type, accept, **kwargs): # noqa _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def applemdms_post(self, content_type, accept, **kwargs): # noqa: E501 - """Create Apple MDM # noqa: E501 + def applemdms_devices_clear_activation_lock(self, apple_mdm_id, device_id, **kwargs): # noqa: E501 + """Clears the Activation Lock for a Device # noqa: E501 - Creates an Apple MDM Enrollment for an organization. Only one enrollment per organization will be allowed. Note that this is the first step in completly setting up an MDM Enrollment. The user must supply the returned plist to Apple for signing, and then provide the certificate provided by Apple back into the PUT API. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/organizations/{Organization_ID}/mdm \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 + Clears the activation lock on the specified device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/clearActivationLock \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.applemdms_post(content_type, accept, async_req=True) + >>> thread = api.applemdms_devices_clear_activation_lock(apple_mdm_id, device_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param Body body: - :param str x_org_id: - :return: InlineResponse201 + :param str apple_mdm_id: (required) + :param str device_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.applemdms_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.applemdms_devices_clear_activation_lock_with_http_info(apple_mdm_id, device_id, **kwargs) # noqa: E501 else: - (data) = self.applemdms_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.applemdms_devices_clear_activation_lock_with_http_info(apple_mdm_id, device_id, **kwargs) # noqa: E501 return data - def applemdms_post_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """Create Apple MDM # noqa: E501 + def applemdms_devices_clear_activation_lock_with_http_info(self, apple_mdm_id, device_id, **kwargs): # noqa: E501 + """Clears the Activation Lock for a Device # noqa: E501 - Creates an Apple MDM Enrollment for an organization. Only one enrollment per organization will be allowed. Note that this is the first step in completly setting up an MDM Enrollment. The user must supply the returned plist to Apple for signing, and then provide the certificate provided by Apple back into the PUT API. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/organizations/{Organization_ID}/mdm \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 + Clears the activation lock on the specified device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/clearActivationLock \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.applemdms_post_with_http_info(content_type, accept, async_req=True) + >>> thread = api.applemdms_devices_clear_activation_lock_with_http_info(apple_mdm_id, device_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param Body body: - :param str x_org_id: - :return: InlineResponse201 + :param str apple_mdm_id: (required) + :param str device_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['apple_mdm_id', 'device_id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -318,30 +489,30 @@ def applemdms_post_with_http_info(self, content_type, accept, **kwargs): # noqa if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method applemdms_post" % key + " to method applemdms_devices_clear_activation_lock" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `applemdms_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `applemdms_post`") # noqa: E501 + # verify the required parameter 'apple_mdm_id' is set + if ('apple_mdm_id' not in params or + params['apple_mdm_id'] is None): + raise ValueError("Missing the required parameter `apple_mdm_id` when calling `applemdms_devices_clear_activation_lock`") # noqa: E501 + # verify the required parameter 'device_id' is set + if ('device_id' not in params or + params['device_id'] is None): + raise ValueError("Missing the required parameter `device_id` when calling `applemdms_devices_clear_activation_lock`") # noqa: E501 collection_formats = {} path_params = {} + if 'apple_mdm_id' in params: + path_params['apple_mdm_id'] = params['apple_mdm_id'] # noqa: E501 + if 'device_id' in params: + path_params['device_id'] = params['device_id'] # noqa: E501 query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -349,28 +520,22 @@ def applemdms_post_with_http_info(self, content_type, accept, **kwargs): # noqa local_var_files = {} body_params = None - if 'body' in params: - body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/applemdms', 'POST', + '/applemdms/{apple_mdm_id}/devices/{device_id}/clearActivationLock', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse201', # noqa: E501 + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -378,53 +543,49 @@ def applemdms_post_with_http_info(self, content_type, accept, **kwargs): # noqa _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def applemdms_put(self, apple_mdm_id, content_type, accept, **kwargs): # noqa: E501 - """Update an Apple MDM # noqa: E501 + def applemdms_devices_refresh_activation_lock_information(self, apple_mdm_id, device_id, **kwargs): # noqa: E501 + """Refresh activation lock information for a device # noqa: E501 - Updates an Apple MDM configuration. This endpoint is used to supply JumpCloud with a signed certificate from Apple in order to finalize the setup and allow JumpCloud to manage your devices. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/applemdms/{ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"MDM name\", \"appleSignedCert\": \"{CERTIFICATE}\" }' ``` # noqa: E501 + Refreshes the activation lock information for a device #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/refreshActivationLockInformation \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.applemdms_put(apple_mdm_id, content_type, accept, async_req=True) + >>> thread = api.applemdms_devices_refresh_activation_lock_information(apple_mdm_id, device_id, async_req=True) >>> result = thread.get() :param async_req bool :param str apple_mdm_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param AppleMdmPatchInput body: - :param str x_org_id: - :return: AppleMDM + :param str device_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.applemdms_put_with_http_info(apple_mdm_id, content_type, accept, **kwargs) # noqa: E501 + return self.applemdms_devices_refresh_activation_lock_information_with_http_info(apple_mdm_id, device_id, **kwargs) # noqa: E501 else: - (data) = self.applemdms_put_with_http_info(apple_mdm_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.applemdms_devices_refresh_activation_lock_information_with_http_info(apple_mdm_id, device_id, **kwargs) # noqa: E501 return data - def applemdms_put_with_http_info(self, apple_mdm_id, content_type, accept, **kwargs): # noqa: E501 - """Update an Apple MDM # noqa: E501 + def applemdms_devices_refresh_activation_lock_information_with_http_info(self, apple_mdm_id, device_id, **kwargs): # noqa: E501 + """Refresh activation lock information for a device # noqa: E501 - Updates an Apple MDM configuration. This endpoint is used to supply JumpCloud with a signed certificate from Apple in order to finalize the setup and allow JumpCloud to manage your devices. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/applemdms/{ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"MDM name\", \"appleSignedCert\": \"{CERTIFICATE}\" }' ``` # noqa: E501 + Refreshes the activation lock information for a device #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/refreshActivationLockInformation \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.applemdms_put_with_http_info(apple_mdm_id, content_type, accept, async_req=True) + >>> thread = api.applemdms_devices_refresh_activation_lock_information_with_http_info(apple_mdm_id, device_id, async_req=True) >>> result = thread.get() :param async_req bool :param str apple_mdm_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param AppleMdmPatchInput body: - :param str x_org_id: - :return: AppleMDM + :param str device_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['apple_mdm_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['apple_mdm_id', 'device_id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -435,65 +596,53 @@ def applemdms_put_with_http_info(self, apple_mdm_id, content_type, accept, **kwa if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method applemdms_put" % key + " to method applemdms_devices_refresh_activation_lock_information" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'apple_mdm_id' is set if ('apple_mdm_id' not in params or params['apple_mdm_id'] is None): - raise ValueError("Missing the required parameter `apple_mdm_id` when calling `applemdms_put`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `applemdms_put`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `applemdms_put`") # noqa: E501 + raise ValueError("Missing the required parameter `apple_mdm_id` when calling `applemdms_devices_refresh_activation_lock_information`") # noqa: E501 + # verify the required parameter 'device_id' is set + if ('device_id' not in params or + params['device_id'] is None): + raise ValueError("Missing the required parameter `device_id` when calling `applemdms_devices_refresh_activation_lock_information`") # noqa: E501 collection_formats = {} path_params = {} if 'apple_mdm_id' in params: path_params['apple_mdm_id'] = params['apple_mdm_id'] # noqa: E501 + if 'device_id' in params: + path_params['device_id'] = params['device_id'] # noqa: E501 query_params = [] header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} body_params = None - if 'body' in params: - body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/applemdms/{apple_mdm_id}', 'PUT', + '/applemdms/{apple_mdm_id}/devices/{device_id}/refreshActivationLockInformation', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='AppleMDM', # noqa: E501 + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -501,53 +650,51 @@ def applemdms_put_with_http_info(self, apple_mdm_id, content_type, accept, **kwa _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def enrollmentprofiles_get(self, apple_mdm_id, enrollment_profile_id, content_type, accept, **kwargs): # noqa: E501 - """Get an Apple MDM Enrollment Profile # noqa: E501 + def applemdms_deviceserase(self, apple_mdm_id, device_id, **kwargs): # noqa: E501 + """Erase Device # noqa: E501 - Get an enrollment profile Currently only requesting the mobileconfig is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles/{ENROLLMENT_PROFILE_ID} \\ -H 'accept: application/x-apple-aspen-config' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + Erases a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/erase \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.enrollmentprofiles_get(apple_mdm_id, enrollment_profile_id, content_type, accept, async_req=True) + >>> thread = api.applemdms_deviceserase(apple_mdm_id, device_id, async_req=True) >>> result = thread.get() :param async_req bool :param str apple_mdm_id: (required) - :param str enrollment_profile_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: Mobileconfig + :param str device_id: (required) + :param DeviceIdEraseBody body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.enrollmentprofiles_get_with_http_info(apple_mdm_id, enrollment_profile_id, content_type, accept, **kwargs) # noqa: E501 + return self.applemdms_deviceserase_with_http_info(apple_mdm_id, device_id, **kwargs) # noqa: E501 else: - (data) = self.enrollmentprofiles_get_with_http_info(apple_mdm_id, enrollment_profile_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.applemdms_deviceserase_with_http_info(apple_mdm_id, device_id, **kwargs) # noqa: E501 return data - def enrollmentprofiles_get_with_http_info(self, apple_mdm_id, enrollment_profile_id, content_type, accept, **kwargs): # noqa: E501 - """Get an Apple MDM Enrollment Profile # noqa: E501 + def applemdms_deviceserase_with_http_info(self, apple_mdm_id, device_id, **kwargs): # noqa: E501 + """Erase Device # noqa: E501 - Get an enrollment profile Currently only requesting the mobileconfig is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles/{ENROLLMENT_PROFILE_ID} \\ -H 'accept: application/x-apple-aspen-config' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + Erases a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/erase \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.enrollmentprofiles_get_with_http_info(apple_mdm_id, enrollment_profile_id, content_type, accept, async_req=True) + >>> thread = api.applemdms_deviceserase_with_http_info(apple_mdm_id, device_id, async_req=True) >>> result = thread.get() :param async_req bool :param str apple_mdm_id: (required) - :param str enrollment_profile_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: Mobileconfig + :param str device_id: (required) + :param DeviceIdEraseBody body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['apple_mdm_id', 'enrollment_profile_id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['apple_mdm_id', 'device_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -558,52 +705,42 @@ def enrollmentprofiles_get_with_http_info(self, apple_mdm_id, enrollment_profile if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method enrollmentprofiles_get" % key + " to method applemdms_deviceserase" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'apple_mdm_id' is set if ('apple_mdm_id' not in params or params['apple_mdm_id'] is None): - raise ValueError("Missing the required parameter `apple_mdm_id` when calling `enrollmentprofiles_get`") # noqa: E501 - # verify the required parameter 'enrollment_profile_id' is set - if ('enrollment_profile_id' not in params or - params['enrollment_profile_id'] is None): - raise ValueError("Missing the required parameter `enrollment_profile_id` when calling `enrollmentprofiles_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `enrollmentprofiles_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `enrollmentprofiles_get`") # noqa: E501 + raise ValueError("Missing the required parameter `apple_mdm_id` when calling `applemdms_deviceserase`") # noqa: E501 + # verify the required parameter 'device_id' is set + if ('device_id' not in params or + params['device_id'] is None): + raise ValueError("Missing the required parameter `device_id` when calling `applemdms_deviceserase`") # noqa: E501 collection_formats = {} path_params = {} if 'apple_mdm_id' in params: path_params['apple_mdm_id'] = params['apple_mdm_id'] # noqa: E501 - if 'enrollment_profile_id' in params: - path_params['enrollment_profile_id'] = params['enrollment_profile_id'] # noqa: E501 + if 'device_id' in params: + path_params['device_id'] = params['device_id'] # noqa: E501 query_params = [] header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} body_params = None + if 'body' in params: + body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( - ['application/x-apple-aspen-config']) # noqa: E501 + ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 @@ -613,14 +750,14 @@ def enrollmentprofiles_get_with_http_info(self, apple_mdm_id, enrollment_profile auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/applemdms/{apple_mdm_id}/enrollmentprofiles/{enrollment_profile_id}', 'GET', + '/applemdms/{apple_mdm_id}/devices/{device_id}/erase', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Mobileconfig', # noqa: E501 + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -628,51 +765,57 @@ def enrollmentprofiles_get_with_http_info(self, apple_mdm_id, enrollment_profile _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def enrollmentprofiles_list(self, apple_mdm_id, content_type, accept, **kwargs): # noqa: E501 - """List Apple MDM Enrollment Profiles # noqa: E501 + def applemdms_deviceslist(self, apple_mdm_id, **kwargs): # noqa: E501 + """List AppleMDM Devices # noqa: E501 - Get a list of enrollment profiles for an apple mdm. Note: currently only one enrollment profile is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + Lists all Apple MDM devices. The filter and sort queries will allow the following fields: `createdAt` `depRegistered` `enrolled` `id` `osVersion` `serialNumber` `udid` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices \\ -H 'accept: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.enrollmentprofiles_list(apple_mdm_id, content_type, accept, async_req=True) + >>> thread = api.applemdms_deviceslist(apple_mdm_id, async_req=True) >>> result = thread.get() :param async_req bool :param str apple_mdm_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: list[AppleMDM] + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param int x_total_count: + :return: list[AppleMdmDevice] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.enrollmentprofiles_list_with_http_info(apple_mdm_id, content_type, accept, **kwargs) # noqa: E501 + return self.applemdms_deviceslist_with_http_info(apple_mdm_id, **kwargs) # noqa: E501 else: - (data) = self.enrollmentprofiles_list_with_http_info(apple_mdm_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.applemdms_deviceslist_with_http_info(apple_mdm_id, **kwargs) # noqa: E501 return data - def enrollmentprofiles_list_with_http_info(self, apple_mdm_id, content_type, accept, **kwargs): # noqa: E501 - """List Apple MDM Enrollment Profiles # noqa: E501 + def applemdms_deviceslist_with_http_info(self, apple_mdm_id, **kwargs): # noqa: E501 + """List AppleMDM Devices # noqa: E501 - Get a list of enrollment profiles for an apple mdm. Note: currently only one enrollment profile is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + Lists all Apple MDM devices. The filter and sort queries will allow the following fields: `createdAt` `depRegistered` `enrolled` `id` `osVersion` `serialNumber` `udid` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices \\ -H 'accept: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.enrollmentprofiles_list_with_http_info(apple_mdm_id, content_type, accept, async_req=True) + >>> thread = api.applemdms_deviceslist_with_http_info(apple_mdm_id, async_req=True) >>> result = thread.get() :param async_req bool :param str apple_mdm_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: list[AppleMDM] + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param int x_total_count: + :return: list[AppleMdmDevice] If the method is called asynchronously, returns the request thread. """ - all_params = ['apple_mdm_id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['apple_mdm_id', 'limit', 'x_org_id', 'skip', 'filter', 'sort', 'x_total_count'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -683,22 +826,14 @@ def enrollmentprofiles_list_with_http_info(self, apple_mdm_id, content_type, acc if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method enrollmentprofiles_list" % key + " to method applemdms_deviceslist" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'apple_mdm_id' is set if ('apple_mdm_id' not in params or params['apple_mdm_id'] is None): - raise ValueError("Missing the required parameter `apple_mdm_id` when calling `enrollmentprofiles_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `enrollmentprofiles_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `enrollmentprofiles_list`") # noqa: E501 + raise ValueError("Missing the required parameter `apple_mdm_id` when calling `applemdms_deviceslist`") # noqa: E501 collection_formats = {} @@ -707,14 +842,22 @@ def enrollmentprofiles_list_with_http_info(self, apple_mdm_id, content_type, acc path_params['apple_mdm_id'] = params['apple_mdm_id'] # noqa: E501 query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 + if 'x_total_count' in params: + header_params['x-total-count'] = params['x_total_count'] # noqa: E501 form_params = [] local_var_files = {} @@ -724,22 +867,965 @@ def enrollmentprofiles_list_with_http_info(self, apple_mdm_id, content_type, acc header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/applemdms/{apple_mdm_id}/enrollmentprofiles', 'GET', + '/applemdms/{apple_mdm_id}/devices', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[AppleMDM]', # noqa: E501 + response_type='list[AppleMdmDevice]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def applemdms_deviceslock(self, apple_mdm_id, device_id, **kwargs): # noqa: E501 + """Lock Device # noqa: E501 + + Locks a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/lock \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_deviceslock(apple_mdm_id, device_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str device_id: (required) + :param DeviceIdLockBody body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.applemdms_deviceslock_with_http_info(apple_mdm_id, device_id, **kwargs) # noqa: E501 + else: + (data) = self.applemdms_deviceslock_with_http_info(apple_mdm_id, device_id, **kwargs) # noqa: E501 + return data + + def applemdms_deviceslock_with_http_info(self, apple_mdm_id, device_id, **kwargs): # noqa: E501 + """Lock Device # noqa: E501 + + Locks a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/lock \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_deviceslock_with_http_info(apple_mdm_id, device_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str device_id: (required) + :param DeviceIdLockBody body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['apple_mdm_id', 'device_id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method applemdms_deviceslock" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'apple_mdm_id' is set + if ('apple_mdm_id' not in params or + params['apple_mdm_id'] is None): + raise ValueError("Missing the required parameter `apple_mdm_id` when calling `applemdms_deviceslock`") # noqa: E501 + # verify the required parameter 'device_id' is set + if ('device_id' not in params or + params['device_id'] is None): + raise ValueError("Missing the required parameter `device_id` when calling `applemdms_deviceslock`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'apple_mdm_id' in params: + path_params['apple_mdm_id'] = params['apple_mdm_id'] # noqa: E501 + if 'device_id' in params: + path_params['device_id'] = params['device_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/applemdms/{apple_mdm_id}/devices/{device_id}/lock', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def applemdms_devicesrestart(self, apple_mdm_id, device_id, **kwargs): # noqa: E501 + """Restart Device # noqa: E501 + + Restarts a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/restart \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"kextPaths\": [\"Path1\", \"Path2\"]}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_devicesrestart(apple_mdm_id, device_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str device_id: (required) + :param DeviceIdRestartBody body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.applemdms_devicesrestart_with_http_info(apple_mdm_id, device_id, **kwargs) # noqa: E501 + else: + (data) = self.applemdms_devicesrestart_with_http_info(apple_mdm_id, device_id, **kwargs) # noqa: E501 + return data + + def applemdms_devicesrestart_with_http_info(self, apple_mdm_id, device_id, **kwargs): # noqa: E501 + """Restart Device # noqa: E501 + + Restarts a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/restart \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"kextPaths\": [\"Path1\", \"Path2\"]}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_devicesrestart_with_http_info(apple_mdm_id, device_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str device_id: (required) + :param DeviceIdRestartBody body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['apple_mdm_id', 'device_id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method applemdms_devicesrestart" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'apple_mdm_id' is set + if ('apple_mdm_id' not in params or + params['apple_mdm_id'] is None): + raise ValueError("Missing the required parameter `apple_mdm_id` when calling `applemdms_devicesrestart`") # noqa: E501 + # verify the required parameter 'device_id' is set + if ('device_id' not in params or + params['device_id'] is None): + raise ValueError("Missing the required parameter `device_id` when calling `applemdms_devicesrestart`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'apple_mdm_id' in params: + path_params['apple_mdm_id'] = params['apple_mdm_id'] # noqa: E501 + if 'device_id' in params: + path_params['device_id'] = params['device_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/applemdms/{apple_mdm_id}/devices/{device_id}/restart', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def applemdms_devicesshutdown(self, apple_mdm_id, device_id, **kwargs): # noqa: E501 + """Shut Down Device # noqa: E501 + + Shuts down a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/shutdown \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_devicesshutdown(apple_mdm_id, device_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str device_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.applemdms_devicesshutdown_with_http_info(apple_mdm_id, device_id, **kwargs) # noqa: E501 + else: + (data) = self.applemdms_devicesshutdown_with_http_info(apple_mdm_id, device_id, **kwargs) # noqa: E501 + return data + + def applemdms_devicesshutdown_with_http_info(self, apple_mdm_id, device_id, **kwargs): # noqa: E501 + """Shut Down Device # noqa: E501 + + Shuts down a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/shutdown \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_devicesshutdown_with_http_info(apple_mdm_id, device_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str device_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['apple_mdm_id', 'device_id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method applemdms_devicesshutdown" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'apple_mdm_id' is set + if ('apple_mdm_id' not in params or + params['apple_mdm_id'] is None): + raise ValueError("Missing the required parameter `apple_mdm_id` when calling `applemdms_devicesshutdown`") # noqa: E501 + # verify the required parameter 'device_id' is set + if ('device_id' not in params or + params['device_id'] is None): + raise ValueError("Missing the required parameter `device_id` when calling `applemdms_devicesshutdown`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'apple_mdm_id' in params: + path_params['apple_mdm_id'] = params['apple_mdm_id'] # noqa: E501 + if 'device_id' in params: + path_params['device_id'] = params['device_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/applemdms/{apple_mdm_id}/devices/{device_id}/shutdown', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def applemdms_enrollmentprofilesget(self, apple_mdm_id, id, **kwargs): # noqa: E501 + """Get an Apple MDM Enrollment Profile # noqa: E501 + + Get an enrollment profile Currently only requesting the mobileconfig is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles/{ID} \\ -H 'accept: application/x-apple-aspen-config' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_enrollmentprofilesget(apple_mdm_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: Mobileconfig + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.applemdms_enrollmentprofilesget_with_http_info(apple_mdm_id, id, **kwargs) # noqa: E501 + else: + (data) = self.applemdms_enrollmentprofilesget_with_http_info(apple_mdm_id, id, **kwargs) # noqa: E501 + return data + + def applemdms_enrollmentprofilesget_with_http_info(self, apple_mdm_id, id, **kwargs): # noqa: E501 + """Get an Apple MDM Enrollment Profile # noqa: E501 + + Get an enrollment profile Currently only requesting the mobileconfig is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles/{ID} \\ -H 'accept: application/x-apple-aspen-config' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_enrollmentprofilesget_with_http_info(apple_mdm_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: Mobileconfig + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['apple_mdm_id', 'id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method applemdms_enrollmentprofilesget" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'apple_mdm_id' is set + if ('apple_mdm_id' not in params or + params['apple_mdm_id'] is None): + raise ValueError("Missing the required parameter `apple_mdm_id` when calling `applemdms_enrollmentprofilesget`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `applemdms_enrollmentprofilesget`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'apple_mdm_id' in params: + path_params['apple_mdm_id'] = params['apple_mdm_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/x-apple-aspen-config']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/applemdms/{apple_mdm_id}/enrollmentprofiles/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Mobileconfig', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def applemdms_enrollmentprofileslist(self, apple_mdm_id, **kwargs): # noqa: E501 + """List Apple MDM Enrollment Profiles # noqa: E501 + + Get a list of enrollment profiles for an apple mdm. Note: currently only one enrollment profile is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_enrollmentprofileslist(apple_mdm_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[AppleMDM] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.applemdms_enrollmentprofileslist_with_http_info(apple_mdm_id, **kwargs) # noqa: E501 + else: + (data) = self.applemdms_enrollmentprofileslist_with_http_info(apple_mdm_id, **kwargs) # noqa: E501 + return data + + def applemdms_enrollmentprofileslist_with_http_info(self, apple_mdm_id, **kwargs): # noqa: E501 + """List Apple MDM Enrollment Profiles # noqa: E501 + + Get a list of enrollment profiles for an apple mdm. Note: currently only one enrollment profile is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_enrollmentprofileslist_with_http_info(apple_mdm_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[AppleMDM] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['apple_mdm_id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method applemdms_enrollmentprofileslist" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'apple_mdm_id' is set + if ('apple_mdm_id' not in params or + params['apple_mdm_id'] is None): + raise ValueError("Missing the required parameter `apple_mdm_id` when calling `applemdms_enrollmentprofileslist`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'apple_mdm_id' in params: + path_params['apple_mdm_id'] = params['apple_mdm_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/applemdms/{apple_mdm_id}/enrollmentprofiles', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[AppleMDM]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def applemdms_getdevice(self, apple_mdm_id, device_id, **kwargs): # noqa: E501 + """Details of an AppleMDM Device # noqa: E501 + + Gets a single Apple MDM device. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id} \\ -H 'accept: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_getdevice(apple_mdm_id, device_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str device_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AppleMdmDevice + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.applemdms_getdevice_with_http_info(apple_mdm_id, device_id, **kwargs) # noqa: E501 + else: + (data) = self.applemdms_getdevice_with_http_info(apple_mdm_id, device_id, **kwargs) # noqa: E501 + return data + + def applemdms_getdevice_with_http_info(self, apple_mdm_id, device_id, **kwargs): # noqa: E501 + """Details of an AppleMDM Device # noqa: E501 + + Gets a single Apple MDM device. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id} \\ -H 'accept: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_getdevice_with_http_info(apple_mdm_id, device_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str device_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AppleMdmDevice + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['apple_mdm_id', 'device_id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method applemdms_getdevice" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'apple_mdm_id' is set + if ('apple_mdm_id' not in params or + params['apple_mdm_id'] is None): + raise ValueError("Missing the required parameter `apple_mdm_id` when calling `applemdms_getdevice`") # noqa: E501 + # verify the required parameter 'device_id' is set + if ('device_id' not in params or + params['device_id'] is None): + raise ValueError("Missing the required parameter `device_id` when calling `applemdms_getdevice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'apple_mdm_id' in params: + path_params['apple_mdm_id'] = params['apple_mdm_id'] # noqa: E501 + if 'device_id' in params: + path_params['device_id'] = params['device_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/applemdms/{apple_mdm_id}/devices/{device_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AppleMdmDevice', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def applemdms_list(self, **kwargs): # noqa: E501 + """List Apple MDMs # noqa: E501 + + Get a list of all Apple MDM configurations. An empty topic indicates that a signed certificate from Apple has not been provided to the PUT endpoint yet. Note: currently only one MDM configuration per organization is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_list(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[AppleMDM] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.applemdms_list_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.applemdms_list_with_http_info(**kwargs) # noqa: E501 + return data + + def applemdms_list_with_http_info(self, **kwargs): # noqa: E501 + """List Apple MDMs # noqa: E501 + + Get a list of all Apple MDM configurations. An empty topic indicates that a signed certificate from Apple has not been provided to the PUT endpoint yet. Note: currently only one MDM configuration per organization is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[AppleMDM] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method applemdms_list" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/applemdms', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[AppleMDM]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def applemdms_put(self, id, **kwargs): # noqa: E501 + """Update an Apple MDM # noqa: E501 + + Updates an Apple MDM configuration. This endpoint is used to supply JumpCloud with a signed certificate from Apple in order to finalize the setup and allow JumpCloud to manage your devices. It may also be used to update the DEP Settings. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/applemdms/{ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"MDM name\", \"appleSignedCert\": \"{CERTIFICATE}\", \"encryptedDepServerToken\": \"{SERVER_TOKEN}\", \"dep\": { \"welcomeScreen\": { \"title\": \"Welcome\", \"paragraph\": \"In just a few steps, you will be working securely from your Mac.\", \"button\": \"continue\", }, }, }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_put(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param AppleMdmPatchInput body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AppleMDM + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.applemdms_put_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.applemdms_put_with_http_info(id, **kwargs) # noqa: E501 + return data + + def applemdms_put_with_http_info(self, id, **kwargs): # noqa: E501 + """Update an Apple MDM # noqa: E501 + + Updates an Apple MDM configuration. This endpoint is used to supply JumpCloud with a signed certificate from Apple in order to finalize the setup and allow JumpCloud to manage your devices. It may also be used to update the DEP Settings. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/applemdms/{ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"MDM name\", \"appleSignedCert\": \"{CERTIFICATE}\", \"encryptedDepServerToken\": \"{SERVER_TOKEN}\", \"dep\": { \"welcomeScreen\": { \"title\": \"Welcome\", \"paragraph\": \"In just a few steps, you will be working securely from your Mac.\", \"button\": \"continue\", }, }, }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_put_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param AppleMdmPatchInput body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AppleMDM + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method applemdms_put" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `applemdms_put`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/applemdms/{id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AppleMDM', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def applemdms_refreshdepdevices(self, apple_mdm_id, **kwargs): # noqa: E501 + """Refresh DEP Devices # noqa: E501 + + Refreshes the list of devices that a JumpCloud admin has added to their virtual MDM in Apple Business Manager - ABM so that they can be DEP enrolled with JumpCloud. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/refreshdepdevices \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_refreshdepdevices(apple_mdm_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.applemdms_refreshdepdevices_with_http_info(apple_mdm_id, **kwargs) # noqa: E501 + else: + (data) = self.applemdms_refreshdepdevices_with_http_info(apple_mdm_id, **kwargs) # noqa: E501 + return data + + def applemdms_refreshdepdevices_with_http_info(self, apple_mdm_id, **kwargs): # noqa: E501 + """Refresh DEP Devices # noqa: E501 + + Refreshes the list of devices that a JumpCloud admin has added to their virtual MDM in Apple Business Manager - ABM so that they can be DEP enrolled with JumpCloud. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/refreshdepdevices \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applemdms_refreshdepdevices_with_http_info(apple_mdm_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str apple_mdm_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['apple_mdm_id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method applemdms_refreshdepdevices" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'apple_mdm_id' is set + if ('apple_mdm_id' not in params or + params['apple_mdm_id'] is None): + raise ValueError("Missing the required parameter `apple_mdm_id` when calling `applemdms_refreshdepdevices`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'apple_mdm_id' in params: + path_params['apple_mdm_id'] = params['apple_mdm_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/applemdms/{apple_mdm_id}/refreshdepdevices', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/jcapiv2/jcapiv2/api/applications_api.py b/jcapiv2/jcapiv2/api/applications_api.py index 280adce..221ffe4 100644 --- a/jcapiv2/jcapiv2/api/applications_api.py +++ b/jcapiv2/jcapiv2/api/applications_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,57 +32,358 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def graph_application_associations_list(self, application_id, targets, content_type, accept, **kwargs): # noqa: E501 + def applications_delete_logo(self, application_id, **kwargs): # noqa: E501 + """Delete application image # noqa: E501 + + Deletes the specified image from an application # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applications_delete_logo(application_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.applications_delete_logo_with_http_info(application_id, **kwargs) # noqa: E501 + else: + (data) = self.applications_delete_logo_with_http_info(application_id, **kwargs) # noqa: E501 + return data + + def applications_delete_logo_with_http_info(self, application_id, **kwargs): # noqa: E501 + """Delete application image # noqa: E501 + + Deletes the specified image from an application # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applications_delete_logo_with_http_info(application_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['application_id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method applications_delete_logo" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'application_id' is set + if ('application_id' not in params or + params['application_id'] is None): + raise ValueError("Missing the required parameter `application_id` when calling `applications_delete_logo`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'application_id' in params: + path_params['application_id'] = params['application_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{application_id}/logo', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def applications_get(self, application_id, **kwargs): # noqa: E501 + """Get an Application # noqa: E501 + + The endpoint retrieves an Application. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applications_get(application_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: ObjectID of the Application. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: object + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.applications_get_with_http_info(application_id, **kwargs) # noqa: E501 + else: + (data) = self.applications_get_with_http_info(application_id, **kwargs) # noqa: E501 + return data + + def applications_get_with_http_info(self, application_id, **kwargs): # noqa: E501 + """Get an Application # noqa: E501 + + The endpoint retrieves an Application. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applications_get_with_http_info(application_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: ObjectID of the Application. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['application_id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method applications_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'application_id' is set + if ('application_id' not in params or + params['application_id'] is None): + raise ValueError("Missing the required parameter `application_id` when calling `applications_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'application_id' in params: + path_params['application_id'] = params['application_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{application_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='object', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def applications_post_logo(self, application_id, **kwargs): # noqa: E501 + """applications_post_logo # noqa: E501 + + This endpoint sets the logo for an application. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/logo \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applications_post_logo(application_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: (required) + :param str image: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.applications_post_logo_with_http_info(application_id, **kwargs) # noqa: E501 + else: + (data) = self.applications_post_logo_with_http_info(application_id, **kwargs) # noqa: E501 + return data + + def applications_post_logo_with_http_info(self, application_id, **kwargs): # noqa: E501 + """applications_post_logo # noqa: E501 + + This endpoint sets the logo for an application. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/logo \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applications_post_logo_with_http_info(application_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: (required) + :param str image: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['application_id', 'image', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method applications_post_logo" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'application_id' is set + if ('application_id' not in params or + params['application_id'] is None): + raise ValueError("Missing the required parameter `application_id` when calling `applications_post_logo`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'application_id' in params: + path_params['application_id'] = params['application_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + if 'image' in params: + local_var_files['image'] = params['image'] # noqa: E501 + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['multipart/form-data']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{application_id}/logo', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_application_associations_list(self, application_id, targets, **kwargs): # noqa: E501 """List the associations of an Application # noqa: E501 This endpoint will return the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Applications and User Groups. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_application_associations_list(application_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_application_associations_list(application_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str application_id: ObjectID of the Application. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"application\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_application_associations_list_with_http_info(application_id, targets, content_type, accept, **kwargs) # noqa: E501 + return self.graph_application_associations_list_with_http_info(application_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_application_associations_list_with_http_info(application_id, targets, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_application_associations_list_with_http_info(application_id, targets, **kwargs) # noqa: E501 return data - def graph_application_associations_list_with_http_info(self, application_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_application_associations_list_with_http_info(self, application_id, targets, **kwargs): # noqa: E501 """List the associations of an Application # noqa: E501 This endpoint will return the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Applications and User Groups. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_application_associations_list_with_http_info(application_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_application_associations_list_with_http_info(application_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str application_id: ObjectID of the Application. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"application\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['application_id', 'targets', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['application_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -106,17 +406,7 @@ def graph_application_associations_list_with_http_info(self, application_id, tar if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_application_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_application_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_application_associations_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_application_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -133,10 +423,6 @@ def graph_application_associations_list_with_http_info(self, application_id, tar query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -148,10 +434,6 @@ def graph_application_associations_list_with_http_info(self, application_id, tar header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -171,53 +453,49 @@ def graph_application_associations_list_with_http_info(self, application_id, tar _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_application_associations_post(self, application_id, content_type, accept, **kwargs): # noqa: E501 + def graph_application_associations_post(self, application_id, **kwargs): # noqa: E501 """Manage the associations of an Application # noqa: E501 - This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_application_associations_post(application_id, content_type, accept, async_req=True) + >>> thread = api.graph_application_associations_post(application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str application_id: ObjectID of the Application. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationApplication body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_application_associations_post_with_http_info(application_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_application_associations_post_with_http_info(application_id, **kwargs) # noqa: E501 else: - (data) = self.graph_application_associations_post_with_http_info(application_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_application_associations_post_with_http_info(application_id, **kwargs) # noqa: E501 return data - def graph_application_associations_post_with_http_info(self, application_id, content_type, accept, **kwargs): # noqa: E501 + def graph_application_associations_post_with_http_info(self, application_id, **kwargs): # noqa: E501 """Manage the associations of an Application # noqa: E501 - This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_application_associations_post_with_http_info(application_id, content_type, accept, async_req=True) + >>> thread = api.graph_application_associations_post_with_http_info(application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str application_id: ObjectID of the Application. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationApplication body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['application_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['application_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -236,14 +514,6 @@ def graph_application_associations_post_with_http_info(self, application_id, con if ('application_id' not in params or params['application_id'] is None): raise ValueError("Missing the required parameter `application_id` when calling `graph_application_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_application_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_application_associations_post`") # noqa: E501 collection_formats = {} @@ -254,10 +524,6 @@ def graph_application_associations_post_with_http_info(self, application_id, con query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -267,10 +533,6 @@ def graph_application_associations_post_with_http_info(self, application_id, con body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -294,57 +556,53 @@ def graph_application_associations_post_with_http_info(self, application_id, con _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_application_traverse_user(self, application_id, content_type, accept, **kwargs): # noqa: E501 + def graph_application_traverse_user(self, application_id, **kwargs): # noqa: E501 """List the Users bound to an Application # noqa: E501 This endpoint will return all Users bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_application_traverse_user(application_id, content_type, accept, async_req=True) + >>> thread = api.graph_application_traverse_user(application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str application_id: ObjectID of the Application. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_application_traverse_user_with_http_info(application_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_application_traverse_user_with_http_info(application_id, **kwargs) # noqa: E501 else: - (data) = self.graph_application_traverse_user_with_http_info(application_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_application_traverse_user_with_http_info(application_id, **kwargs) # noqa: E501 return data - def graph_application_traverse_user_with_http_info(self, application_id, content_type, accept, **kwargs): # noqa: E501 + def graph_application_traverse_user_with_http_info(self, application_id, **kwargs): # noqa: E501 """List the Users bound to an Application # noqa: E501 This endpoint will return all Users bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_application_traverse_user_with_http_info(application_id, content_type, accept, async_req=True) + >>> thread = api.graph_application_traverse_user_with_http_info(application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str application_id: ObjectID of the Application. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['application_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['application_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -363,17 +621,7 @@ def graph_application_traverse_user_with_http_info(self, application_id, content if ('application_id' not in params or params['application_id'] is None): raise ValueError("Missing the required parameter `application_id` when calling `graph_application_traverse_user`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_application_traverse_user`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_application_traverse_user`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_application_traverse_user`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -392,10 +640,6 @@ def graph_application_traverse_user_with_http_info(self, application_id, content header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -405,10 +649,6 @@ def graph_application_traverse_user_with_http_info(self, application_id, content header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -428,57 +668,53 @@ def graph_application_traverse_user_with_http_info(self, application_id, content _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_application_traverse_user_group(self, application_id, content_type, accept, **kwargs): # noqa: E501 + def graph_application_traverse_user_group(self, application_id, **kwargs): # noqa: E501 """List the User Groups bound to an Application # noqa: E501 This endpoint will return all Users Groups bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_application_traverse_user_group(application_id, content_type, accept, async_req=True) + >>> thread = api.graph_application_traverse_user_group(application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str application_id: ObjectID of the Application. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_application_traverse_user_group_with_http_info(application_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_application_traverse_user_group_with_http_info(application_id, **kwargs) # noqa: E501 else: - (data) = self.graph_application_traverse_user_group_with_http_info(application_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_application_traverse_user_group_with_http_info(application_id, **kwargs) # noqa: E501 return data - def graph_application_traverse_user_group_with_http_info(self, application_id, content_type, accept, **kwargs): # noqa: E501 + def graph_application_traverse_user_group_with_http_info(self, application_id, **kwargs): # noqa: E501 """List the User Groups bound to an Application # noqa: E501 This endpoint will return all Users Groups bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_application_traverse_user_group_with_http_info(application_id, content_type, accept, async_req=True) + >>> thread = api.graph_application_traverse_user_group_with_http_info(application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str application_id: ObjectID of the Application. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['application_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['application_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -497,17 +733,7 @@ def graph_application_traverse_user_group_with_http_info(self, application_id, c if ('application_id' not in params or params['application_id'] is None): raise ValueError("Missing the required parameter `application_id` when calling `graph_application_traverse_user_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_application_traverse_user_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_application_traverse_user_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_application_traverse_user_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -526,10 +752,6 @@ def graph_application_traverse_user_group_with_http_info(self, application_id, c header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -539,10 +761,6 @@ def graph_application_traverse_user_group_with_http_info(self, application_id, c header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -561,3 +779,126 @@ def graph_application_traverse_user_group_with_http_info(self, application_id, c _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + + def import_users(self, application_id, **kwargs): # noqa: E501 + """Get a list of users to import from an Application IdM service provider # noqa: E501 + + Get a list of users to import from an Application IdM service provider. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.import_users(application_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: ObjectID of the Application. (required) + :param str filter: Filter users by a search term + :param str query: URL query to merge with the service provider request + :param str sort: Sort users by supported fields + :param str sort_order: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: ImportUsersResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.import_users_with_http_info(application_id, **kwargs) # noqa: E501 + else: + (data) = self.import_users_with_http_info(application_id, **kwargs) # noqa: E501 + return data + + def import_users_with_http_info(self, application_id, **kwargs): # noqa: E501 + """Get a list of users to import from an Application IdM service provider # noqa: E501 + + Get a list of users to import from an Application IdM service provider. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.import_users_with_http_info(application_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: ObjectID of the Application. (required) + :param str filter: Filter users by a search term + :param str query: URL query to merge with the service provider request + :param str sort: Sort users by supported fields + :param str sort_order: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: ImportUsersResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['application_id', 'filter', 'query', 'sort', 'sort_order', 'x_org_id', 'limit', 'skip'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method import_users" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'application_id' is set + if ('application_id' not in params or + params['application_id'] is None): + raise ValueError("Missing the required parameter `application_id` when calling `import_users`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'application_id' in params: + path_params['application_id'] = params['application_id'] # noqa: E501 + + query_params = [] + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + if 'query' in params: + query_params.append(('query', params['query'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + if 'sort_order' in params: + query_params.append(('sortOrder', params['sort_order'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{application_id}/import/users', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ImportUsersResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/authentication_policies_api.py b/jcapiv2/jcapiv2/api/authentication_policies_api.py new file mode 100644 index 0000000..19472e7 --- /dev/null +++ b/jcapiv2/jcapiv2/api/authentication_policies_api.py @@ -0,0 +1,550 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv2.api_client import ApiClient + + +class AuthenticationPoliciesApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def authnpolicies_delete(self, id, **kwargs): # noqa: E501 + """Delete Authentication Policy # noqa: E501 + + Delete the specified authentication policy. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/authn/policies/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.authnpolicies_delete(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Unique identifier of the authentication policy (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AuthnPolicy + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.authnpolicies_delete_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.authnpolicies_delete_with_http_info(id, **kwargs) # noqa: E501 + return data + + def authnpolicies_delete_with_http_info(self, id, **kwargs): # noqa: E501 + """Delete Authentication Policy # noqa: E501 + + Delete the specified authentication policy. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/authn/policies/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.authnpolicies_delete_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Unique identifier of the authentication policy (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AuthnPolicy + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method authnpolicies_delete" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `authnpolicies_delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/authn/policies/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AuthnPolicy', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def authnpolicies_get(self, id, **kwargs): # noqa: E501 + """Get an authentication policy # noqa: E501 + + Return a specific authentication policy. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/authn/policies/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.authnpolicies_get(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Unique identifier of the authentication policy (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AuthnPolicy + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.authnpolicies_get_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.authnpolicies_get_with_http_info(id, **kwargs) # noqa: E501 + return data + + def authnpolicies_get_with_http_info(self, id, **kwargs): # noqa: E501 + """Get an authentication policy # noqa: E501 + + Return a specific authentication policy. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/authn/policies/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.authnpolicies_get_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Unique identifier of the authentication policy (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AuthnPolicy + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method authnpolicies_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `authnpolicies_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/authn/policies/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AuthnPolicy', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def authnpolicies_list(self, **kwargs): # noqa: E501 + """List Authentication Policies # noqa: E501 + + Get a list of all authentication policies. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/authn/policies \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.authnpolicies_list(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int x_total_count: + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: list[AuthnPolicy] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.authnpolicies_list_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.authnpolicies_list_with_http_info(**kwargs) # noqa: E501 + return data + + def authnpolicies_list_with_http_info(self, **kwargs): # noqa: E501 + """List Authentication Policies # noqa: E501 + + Get a list of all authentication policies. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/authn/policies \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.authnpolicies_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int x_total_count: + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: list[AuthnPolicy] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['x_org_id', 'x_total_count', 'limit', 'skip', 'filter', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method authnpolicies_list" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + if 'x_total_count' in params: + header_params['x-total-count'] = params['x_total_count'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/authn/policies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[AuthnPolicy]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def authnpolicies_patch(self, id, **kwargs): # noqa: E501 + """Patch Authentication Policy # noqa: E501 + + Patch the specified authentication policy. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/authn/policies/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"disabled\": false }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.authnpolicies_patch(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Unique identifier of the authentication policy (required) + :param AuthnPolicyInput body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AuthnPolicy + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.authnpolicies_patch_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.authnpolicies_patch_with_http_info(id, **kwargs) # noqa: E501 + return data + + def authnpolicies_patch_with_http_info(self, id, **kwargs): # noqa: E501 + """Patch Authentication Policy # noqa: E501 + + Patch the specified authentication policy. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/authn/policies/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"disabled\": false }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.authnpolicies_patch_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Unique identifier of the authentication policy (required) + :param AuthnPolicyInput body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AuthnPolicy + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method authnpolicies_patch" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `authnpolicies_patch`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/authn/policies/{id}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AuthnPolicy', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def authnpolicies_post(self, **kwargs): # noqa: E501 + """Create an Authentication Policy # noqa: E501 + + Create an authentication policy. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/authn/policies \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Sample Policy\", \"disabled\": false, \"effect\": { \"action\": \"allow\" }, \"targets\": { \"users\": { \"inclusions\": [\"ALL\"] }, \"userGroups\": { \"exclusions\": [{USER_GROUP_ID}] }, \"resources\": [ {\"type\": \"user_portal\" } ] }, \"conditions\":{ \"ipAddressIn\": [{IP_LIST_ID}] } }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.authnpolicies_post(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param AuthnPolicyInput body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AuthnPolicy + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.authnpolicies_post_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.authnpolicies_post_with_http_info(**kwargs) # noqa: E501 + return data + + def authnpolicies_post_with_http_info(self, **kwargs): # noqa: E501 + """Create an Authentication Policy # noqa: E501 + + Create an authentication policy. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/authn/policies \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Sample Policy\", \"disabled\": false, \"effect\": { \"action\": \"allow\" }, \"targets\": { \"users\": { \"inclusions\": [\"ALL\"] }, \"userGroups\": { \"exclusions\": [{USER_GROUP_ID}] }, \"resources\": [ {\"type\": \"user_portal\" } ] }, \"conditions\":{ \"ipAddressIn\": [{IP_LIST_ID}] } }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.authnpolicies_post_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param AuthnPolicyInput body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: AuthnPolicy + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method authnpolicies_post" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/authn/policies', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AuthnPolicy', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/bulk_job_requests_api.py b/jcapiv2/jcapiv2/api/bulk_job_requests_api.py index 74a288d..b82dd84 100644 --- a/jcapiv2/jcapiv2/api/bulk_job_requests_api.py +++ b/jcapiv2/jcapiv2/api/bulk_job_requests_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,51 +32,47 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def bulk_users_create(self, content_type, accept, **kwargs): # noqa: E501 - """Bulk Users Create # noqa: E501 + def bulk_user_states_create(self, **kwargs): # noqa: E501 + """Create Scheduled Userstate Job # noqa: E501 - The endpoint allows you to create a bulk job to asynchronously create users. See [Create a System User](https://docs.jumpcloud.com/1.0/systemusers/create-a-system-user) for full list of attributes. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"email\":\"{email}\", \"firstname\":\"{firstname}\", \"lastname\":\"{firstname}\", \"username\":\"{username}\", \"attributes\":[ {\"name\":\"EmployeeID\",\"value\":\"0000\"}, {\"name\":\"Custom\",\"value\":\"attribute\"} ] } ] ``` # noqa: E501 + This endpoint allows you to create scheduled statechange jobs. #### Sample Request ``` curl -X POST \"https://console.jumpcloud.com/api/v2/bulk/userstates\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -d '{ \"user_ids\": [\"{User_ID_1}\", \"{User_ID_2}\", \"{User_ID_3}\"], \"state\": \"SUSPENDED\", \"start_date\": \"2000-01-01T00:00:00.000Z\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.bulk_users_create(content_type, accept, async_req=True) + >>> thread = api.bulk_user_states_create(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param list[BulkUserCreate] body: - :param str x_org_id: - :return: JobId + :param BulkScheduledStatechangeCreate body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[ScheduledUserstateResult] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.bulk_users_create_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.bulk_user_states_create_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.bulk_users_create_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.bulk_user_states_create_with_http_info(**kwargs) # noqa: E501 return data - def bulk_users_create_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """Bulk Users Create # noqa: E501 + def bulk_user_states_create_with_http_info(self, **kwargs): # noqa: E501 + """Create Scheduled Userstate Job # noqa: E501 - The endpoint allows you to create a bulk job to asynchronously create users. See [Create a System User](https://docs.jumpcloud.com/1.0/systemusers/create-a-system-user) for full list of attributes. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"email\":\"{email}\", \"firstname\":\"{firstname}\", \"lastname\":\"{firstname}\", \"username\":\"{username}\", \"attributes\":[ {\"name\":\"EmployeeID\",\"value\":\"0000\"}, {\"name\":\"Custom\",\"value\":\"attribute\"} ] } ] ``` # noqa: E501 + This endpoint allows you to create scheduled statechange jobs. #### Sample Request ``` curl -X POST \"https://console.jumpcloud.com/api/v2/bulk/userstates\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -d '{ \"user_ids\": [\"{User_ID_1}\", \"{User_ID_2}\", \"{User_ID_3}\"], \"state\": \"SUSPENDED\", \"start_date\": \"2000-01-01T00:00:00.000Z\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.bulk_users_create_with_http_info(content_type, accept, async_req=True) + >>> thread = api.bulk_user_states_create_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param list[BulkUserCreate] body: - :param str x_org_id: - :return: JobId + :param BulkScheduledStatechangeCreate body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[ScheduledUserstateResult] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -88,18 +83,10 @@ def bulk_users_create_with_http_info(self, content_type, accept, **kwargs): # n if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method bulk_users_create" % key + " to method bulk_user_states_create" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `bulk_users_create`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `bulk_users_create`") # noqa: E501 collection_formats = {} @@ -108,10 +95,6 @@ def bulk_users_create_with_http_info(self, content_type, accept, **kwargs): # n query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -133,14 +116,14 @@ def bulk_users_create_with_http_info(self, content_type, accept, **kwargs): # n auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/bulk/users', 'POST', + '/bulk/userstates', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='JobId', # noqa: E501 + response_type='list[ScheduledUserstateResult]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -148,55 +131,148 @@ def bulk_users_create_with_http_info(self, content_type, accept, **kwargs): # n _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def bulk_users_create_results(self, job_id, content_type, accept, **kwargs): # noqa: E501 - """List Bulk Users Results # noqa: E501 + def bulk_user_states_delete(self, id, **kwargs): # noqa: E501 + """Delete Scheduled Userstate Job # noqa: E501 - This endpoint will return the results of particular user import or update job request. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/bulk/users/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint deletes a scheduled statechange job. #### Sample Request ``` curl -X DELETE \"https://console.jumpcloud.com/api/v2/bulk/userstates/{ScheduledJob_ID}\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.bulk_users_create_results(job_id, content_type, accept, async_req=True) + >>> thread = api.bulk_user_states_delete(id, async_req=True) >>> result = thread.get() :param async_req bool - :param str job_id: (required) - :param str content_type: (required) - :param str accept: (required) + :param str id: Unique identifier of the scheduled statechange job. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.bulk_user_states_delete_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.bulk_user_states_delete_with_http_info(id, **kwargs) # noqa: E501 + return data + + def bulk_user_states_delete_with_http_info(self, id, **kwargs): # noqa: E501 + """Delete Scheduled Userstate Job # noqa: E501 + + This endpoint deletes a scheduled statechange job. #### Sample Request ``` curl -X DELETE \"https://console.jumpcloud.com/api/v2/bulk/userstates/{ScheduledJob_ID}\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.bulk_user_states_delete_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Unique identifier of the scheduled statechange job. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method bulk_user_states_delete" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `bulk_user_states_delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/bulk/userstates/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def bulk_user_states_get_next_scheduled(self, users, **kwargs): # noqa: E501 + """Gets the next scheduled state change for each user in a list of system users # noqa: E501 + + This endpoint is used to lookup the next upcoming scheduled state change for each user in the given list. The users parameter is limited to 100 items per request. #### Sample Request ``` curl -X GET \"https://console.jumpcloud.com/api/v2/bulk/userstates/eventlist/next?users={UserID1},{UserID2},{UserID3}\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.bulk_user_states_get_next_scheduled(users, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] users: A list of system user IDs (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: - :return: list[JobWorkresult] + :return: InlineResponse200 If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.bulk_users_create_results_with_http_info(job_id, content_type, accept, **kwargs) # noqa: E501 + return self.bulk_user_states_get_next_scheduled_with_http_info(users, **kwargs) # noqa: E501 else: - (data) = self.bulk_users_create_results_with_http_info(job_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.bulk_user_states_get_next_scheduled_with_http_info(users, **kwargs) # noqa: E501 return data - def bulk_users_create_results_with_http_info(self, job_id, content_type, accept, **kwargs): # noqa: E501 - """List Bulk Users Results # noqa: E501 + def bulk_user_states_get_next_scheduled_with_http_info(self, users, **kwargs): # noqa: E501 + """Gets the next scheduled state change for each user in a list of system users # noqa: E501 - This endpoint will return the results of particular user import or update job request. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/bulk/users/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint is used to lookup the next upcoming scheduled state change for each user in the given list. The users parameter is limited to 100 items per request. #### Sample Request ``` curl -X GET \"https://console.jumpcloud.com/api/v2/bulk/userstates/eventlist/next?users={UserID1},{UserID2},{UserID3}\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.bulk_users_create_results_with_http_info(job_id, content_type, accept, async_req=True) + >>> thread = api.bulk_user_states_get_next_scheduled_with_http_info(users, async_req=True) >>> result = thread.get() :param async_req bool - :param str job_id: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] users: A list of system user IDs (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: - :return: list[JobWorkresult] + :return: InlineResponse200 If the method is called asynchronously, returns the request thread. """ - all_params = ['job_id', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['users', 'limit', 'skip'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -207,44 +283,29 @@ def bulk_users_create_results_with_http_info(self, job_id, content_type, accept, if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method bulk_users_create_results" % key + " to method bulk_user_states_get_next_scheduled" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'job_id' is set - if ('job_id' not in params or - params['job_id'] is None): - raise ValueError("Missing the required parameter `job_id` when calling `bulk_users_create_results`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `bulk_users_create_results`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `bulk_users_create_results`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `bulk_users_create_results`, must be a value greater than or equal to `0`") # noqa: E501 + # verify the required parameter 'users' is set + if ('users' not in params or + params['users'] is None): + raise ValueError("Missing the required parameter `users` when calling `bulk_user_states_get_next_scheduled`") # noqa: E501 + collection_formats = {} path_params = {} - if 'job_id' in params: - path_params['job_id'] = params['job_id'] # noqa: E501 query_params = [] + if 'users' in params: + query_params.append(('users', params['users'])) # noqa: E501 + collection_formats['users'] = 'csv' # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - if 'x_org_id' in params: - header_params['x-org-id'] = params['x_org_id'] # noqa: E501 form_params = [] local_var_files = {} @@ -254,22 +315,18 @@ def bulk_users_create_results_with_http_info(self, job_id, content_type, accept, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/bulk/users/{job_id}/results', 'GET', + '/bulk/userstates/eventlist/next', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[JobWorkresult]', # noqa: E501 + response_type='InlineResponse200', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -277,51 +334,53 @@ def bulk_users_create_results_with_http_info(self, job_id, content_type, accept, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def bulk_users_update(self, content_type, accept, **kwargs): # noqa: E501 - """Bulk Users Update # noqa: E501 + def bulk_user_states_list(self, **kwargs): # noqa: E501 + """List Scheduled Userstate Change Jobs # noqa: E501 - The endpoint allows you to create a bulk job to asynchronously update users. See [Update a System User](https://docs.jumpcloud.com/1.0/systemusers/update-a-system-user) for full list of attributes. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"department\":\"{UPDATED_DEPARTMENT}\", \"attributes\":[ {\"name\":\"Custom\",\"value\":\"{ATTRIBUTE_VALUE}\"} ] }, { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"costCenter\":\"{UPDATED_COST_CENTER}\", \"phoneNumbers\":[ {\"type\":\"home\",\"number\":\"{HOME_PHONE_NUMBER}\"}, {\"type\":\"work\",\"number\":\"{WORK_PHONE_NUMBER}\"} ] } ] ``` # noqa: E501 + The endpoint allows you to list scheduled statechange jobs. #### Sample Request ``` curl -X GET \"https://console.jumpcloud.com/api/v2/bulk/userstates\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.bulk_users_update(content_type, accept, async_req=True) + >>> thread = api.bulk_user_states_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param list[BulkUserUpdate] body: - :param str x_org_id: - :return: JobId + :param int limit: The number of records to return at once. Limited to 100. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int skip: The offset into the records to return. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param str userid: The systemuser id to filter by. + :return: list[ScheduledUserstateResult] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.bulk_users_update_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.bulk_user_states_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.bulk_users_update_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.bulk_user_states_list_with_http_info(**kwargs) # noqa: E501 return data - def bulk_users_update_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """Bulk Users Update # noqa: E501 + def bulk_user_states_list_with_http_info(self, **kwargs): # noqa: E501 + """List Scheduled Userstate Change Jobs # noqa: E501 - The endpoint allows you to create a bulk job to asynchronously update users. See [Update a System User](https://docs.jumpcloud.com/1.0/systemusers/update-a-system-user) for full list of attributes. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"department\":\"{UPDATED_DEPARTMENT}\", \"attributes\":[ {\"name\":\"Custom\",\"value\":\"{ATTRIBUTE_VALUE}\"} ] }, { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"costCenter\":\"{UPDATED_COST_CENTER}\", \"phoneNumbers\":[ {\"type\":\"home\",\"number\":\"{HOME_PHONE_NUMBER}\"}, {\"type\":\"work\",\"number\":\"{WORK_PHONE_NUMBER}\"} ] } ] ``` # noqa: E501 + The endpoint allows you to list scheduled statechange jobs. #### Sample Request ``` curl -X GET \"https://console.jumpcloud.com/api/v2/bulk/userstates\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.bulk_users_update_with_http_info(content_type, accept, async_req=True) + >>> thread = api.bulk_user_states_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param list[BulkUserUpdate] body: - :param str x_org_id: - :return: JobId + :param int limit: The number of records to return at once. Limited to 100. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int skip: The offset into the records to return. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param str userid: The systemuser id to filter by. + :return: list[ScheduledUserstateResult] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['limit', 'filter', 'skip', 'x_org_id', 'userid'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -332,59 +391,50 @@ def bulk_users_update_with_http_info(self, content_type, accept, **kwargs): # n if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method bulk_users_update" % key + " to method bulk_user_states_list" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `bulk_users_update`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `bulk_users_update`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'userid' in params: + query_params.append(('userid', params['userid'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} body_params = None - if 'body' in params: - body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/bulk/users', 'PATCH', + '/bulk/userstates', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='JobId', # noqa: E501 + response_type='list[ScheduledUserstateResult]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -392,51 +442,49 @@ def bulk_users_update_with_http_info(self, content_type, accept, **kwargs): # n _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def jobs_get(self, id, content_type, accept, **kwargs): # noqa: E501 - """Get Job (incomplete) # noqa: E501 + def bulk_users_create(self, **kwargs): # noqa: E501 + """Bulk Users Create # noqa: E501 - **This endpoint is not complete and should remain hidden as it's not functional yet.** # noqa: E501 + The endpoint allows you to create a bulk job to asynchronously create users. See [Create a System User](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_post) for the full list of attributes. #### Default User State The `state` of each user in the request can be explicitly passed in or omitted. If `state` is omitted, then the user will get created using the value returned from the [Get an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organizations_get) endpoint. The default user state for bulk created users depends on the `creation-source` header. For `creation-source:jumpcloud:bulk` the default state is stored in `settings.newSystemUserStateDefaults.csvImport`. For other `creation-source` header values, the default state is stored in `settings.newSystemUserStateDefaults.applicationImport` These default state values can be changed in the admin portal settings or by using the [Update an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organization_put) endpoint. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"email\":\"{email}\", \"firstname\":\"{firstname}\", \"lastname\":\"{firstname}\", \"username\":\"{username}\", \"attributes\":[ { \"name\":\"EmployeeID\", \"value\":\"0000\" }, { \"name\":\"Custom\", \"value\":\"attribute\" } ] } ]' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.jobs_get(id, content_type, accept, async_req=True) + >>> thread = api.bulk_users_create(async_req=True) >>> result = thread.get() :param async_req bool - :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: JobDetails + :param list[BulkUserCreate] body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param str creation_source: Defines the creation-source header for gapps, o365 and workdays requests. If the header isn't sent, the default value is `jumpcloud:bulk`, if you send the header with a malformed value you receive a 400 error. + :return: JobId If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.jobs_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.bulk_users_create_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.jobs_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.bulk_users_create_with_http_info(**kwargs) # noqa: E501 return data - def jobs_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """Get Job (incomplete) # noqa: E501 + def bulk_users_create_with_http_info(self, **kwargs): # noqa: E501 + """Bulk Users Create # noqa: E501 - **This endpoint is not complete and should remain hidden as it's not functional yet.** # noqa: E501 + The endpoint allows you to create a bulk job to asynchronously create users. See [Create a System User](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_post) for the full list of attributes. #### Default User State The `state` of each user in the request can be explicitly passed in or omitted. If `state` is omitted, then the user will get created using the value returned from the [Get an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organizations_get) endpoint. The default user state for bulk created users depends on the `creation-source` header. For `creation-source:jumpcloud:bulk` the default state is stored in `settings.newSystemUserStateDefaults.csvImport`. For other `creation-source` header values, the default state is stored in `settings.newSystemUserStateDefaults.applicationImport` These default state values can be changed in the admin portal settings or by using the [Update an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organization_put) endpoint. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"email\":\"{email}\", \"firstname\":\"{firstname}\", \"lastname\":\"{firstname}\", \"username\":\"{username}\", \"attributes\":[ { \"name\":\"EmployeeID\", \"value\":\"0000\" }, { \"name\":\"Custom\", \"value\":\"attribute\" } ] } ]' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.jobs_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.bulk_users_create_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: JobDetails + :param list[BulkUserCreate] body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param str creation_source: Defines the creation-source header for gapps, o365 and workdays requests. If the header isn't sent, the default value is `jumpcloud:bulk`, if you send the header with a malformed value you receive a 400 error. + :return: JobId If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['body', 'x_org_id', 'creation_source'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -447,43 +495,29 @@ def jobs_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method jobs_get" % key + " to method bulk_users_create" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `jobs_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `jobs_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `jobs_get`") # noqa: E501 collection_formats = {} path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + if 'creation_source' in params: + header_params['creation-source'] = params['creation_source'] # noqa: E501 form_params = [] local_var_files = {} body_params = None + if 'body' in params: + body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 @@ -496,14 +530,14 @@ def jobs_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/jobs/{id}', 'GET', + '/bulk/users', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='JobDetails', # noqa: E501 + response_type='JobId', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -511,55 +545,51 @@ def jobs_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def jobs_results(self, id, content_type, accept, **kwargs): # noqa: E501 - """List Job Results # noqa: E501 + def bulk_users_create_results(self, job_id, **kwargs): # noqa: E501 + """List Bulk Users Results # noqa: E501 - This endpoint will return the results of particular import job request. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/jobs/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return the results of particular user import or update job request. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/bulk/users/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.jobs_results(id, content_type, accept, async_req=True) + >>> thread = api.bulk_users_create_results(job_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str id: (required) - :param str content_type: (required) - :param str accept: (required) + :param str job_id: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[JobWorkresult] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.jobs_results_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.bulk_users_create_results_with_http_info(job_id, **kwargs) # noqa: E501 else: - (data) = self.jobs_results_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.bulk_users_create_results_with_http_info(job_id, **kwargs) # noqa: E501 return data - def jobs_results_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """List Job Results # noqa: E501 + def bulk_users_create_results_with_http_info(self, job_id, **kwargs): # noqa: E501 + """List Bulk Users Results # noqa: E501 - This endpoint will return the results of particular import job request. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/jobs/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return the results of particular user import or update job request. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/bulk/users/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.jobs_results_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.bulk_users_create_results_with_http_info(job_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str id: (required) - :param str content_type: (required) - :param str accept: (required) + :param str job_id: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[JobWorkresult] If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['job_id', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -570,30 +600,20 @@ def jobs_results_with_http_info(self, id, content_type, accept, **kwargs): # no if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method jobs_results" % key + " to method bulk_users_create_results" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `jobs_results`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `jobs_results`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `jobs_results`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `jobs_results`, must be a value greater than or equal to `0`") # noqa: E501 + # verify the required parameter 'job_id' is set + if ('job_id' not in params or + params['job_id'] is None): + raise ValueError("Missing the required parameter `job_id` when calling `bulk_users_create_results`") # noqa: E501 + collection_formats = {} path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 + if 'job_id' in params: + path_params['job_id'] = params['job_id'] # noqa: E501 query_params = [] if 'limit' in params: @@ -602,10 +622,6 @@ def jobs_results_with_http_info(self, id, content_type, accept, **kwargs): # no query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -617,6 +633,101 @@ def jobs_results_with_http_info(self, id, content_type, accept, **kwargs): # no header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/bulk/users/{job_id}/results', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[JobWorkresult]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def bulk_users_update(self, **kwargs): # noqa: E501 + """Bulk Users Update # noqa: E501 + + The endpoint allows you to create a bulk job to asynchronously update users. See [Update a System User](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_put) for full list of attributes. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"department\":\"{UPDATED_DEPARTMENT}\", \"attributes\":[ {\"name\":\"Custom\",\"value\":\"{ATTRIBUTE_VALUE}\"} ] }, { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"costCenter\":\"{UPDATED_COST_CENTER}\", \"phoneNumbers\":[ {\"type\":\"home\",\"number\":\"{HOME_PHONE_NUMBER}\"}, {\"type\":\"work\",\"number\":\"{WORK_PHONE_NUMBER}\"} ] } ] ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.bulk_users_update(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[BulkUserUpdate] body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: JobId + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.bulk_users_update_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.bulk_users_update_with_http_info(**kwargs) # noqa: E501 + return data + + def bulk_users_update_with_http_info(self, **kwargs): # noqa: E501 + """Bulk Users Update # noqa: E501 + + The endpoint allows you to create a bulk job to asynchronously update users. See [Update a System User](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_put) for full list of attributes. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"department\":\"{UPDATED_DEPARTMENT}\", \"attributes\":[ {\"name\":\"Custom\",\"value\":\"{ATTRIBUTE_VALUE}\"} ] }, { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"costCenter\":\"{UPDATED_COST_CENTER}\", \"phoneNumbers\":[ {\"type\":\"home\",\"number\":\"{HOME_PHONE_NUMBER}\"}, {\"type\":\"work\",\"number\":\"{WORK_PHONE_NUMBER}\"} ] } ] ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.bulk_users_update_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[BulkUserUpdate] body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: JobId + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method bulk_users_update" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -625,14 +736,14 @@ def jobs_results_with_http_info(self, id, content_type, accept, **kwargs): # no auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/jobs/{id}/results', 'GET', + '/bulk/users', 'PATCH', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[JobWorkresult]', # noqa: E501 + response_type='JobId', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/jcapiv2/jcapiv2/api/command_results_api.py b/jcapiv2/jcapiv2/api/command_results_api.py new file mode 100644 index 0000000..5cae34e --- /dev/null +++ b/jcapiv2/jcapiv2/api/command_results_api.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv2.api_client import ApiClient + + +class CommandResultsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def commands_list_results_by_workflow(self, **kwargs): # noqa: E501 + """List all Command Results by Workflow # noqa: E501 + + This endpoint returns all command results, grouped by workflowInstanceId. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commandresult/workflows \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key:{API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.commands_list_results_by_workflow(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int skip: The offset into the records to return. + :return: CommandResultList + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.commands_list_results_by_workflow_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.commands_list_results_by_workflow_with_http_info(**kwargs) # noqa: E501 + return data + + def commands_list_results_by_workflow_with_http_info(self, **kwargs): # noqa: E501 + """List all Command Results by Workflow # noqa: E501 + + This endpoint returns all command results, grouped by workflowInstanceId. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commandresult/workflows \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key:{API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.commands_list_results_by_workflow_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int skip: The offset into the records to return. + :return: CommandResultList + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['x_org_id', 'limit', 'filter', 'skip'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method commands_list_results_by_workflow" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/commandresult/workflows', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CommandResultList', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/commands_api.py b/jcapiv2/jcapiv2/api/commands_api.py index a30ff36..a81efdb 100644 --- a/jcapiv2/jcapiv2/api/commands_api.py +++ b/jcapiv2/jcapiv2/api/commands_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,57 +32,256 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def graph_command_associations_list(self, command_id, targets, content_type, accept, **kwargs): # noqa: E501 + def commands_cancel_queued_commands_by_workflow_instance_id(self, workflow_instance_id, **kwargs): # noqa: E501 + """Cancel all queued commands for an organization by workflow instance Id # noqa: E501 + + This endpoint allows all queued commands for one workflow instance to be canceled. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/commandqueue/{workflow_instance_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.commands_cancel_queued_commands_by_workflow_instance_id(workflow_instance_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_instance_id: Workflow instance Id of the queued commands to cancel. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.commands_cancel_queued_commands_by_workflow_instance_id_with_http_info(workflow_instance_id, **kwargs) # noqa: E501 + else: + (data) = self.commands_cancel_queued_commands_by_workflow_instance_id_with_http_info(workflow_instance_id, **kwargs) # noqa: E501 + return data + + def commands_cancel_queued_commands_by_workflow_instance_id_with_http_info(self, workflow_instance_id, **kwargs): # noqa: E501 + """Cancel all queued commands for an organization by workflow instance Id # noqa: E501 + + This endpoint allows all queued commands for one workflow instance to be canceled. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/commandqueue/{workflow_instance_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.commands_cancel_queued_commands_by_workflow_instance_id_with_http_info(workflow_instance_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str workflow_instance_id: Workflow instance Id of the queued commands to cancel. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['workflow_instance_id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method commands_cancel_queued_commands_by_workflow_instance_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'workflow_instance_id' is set + if ('workflow_instance_id' not in params or + params['workflow_instance_id'] is None): + raise ValueError("Missing the required parameter `workflow_instance_id` when calling `commands_cancel_queued_commands_by_workflow_instance_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'workflow_instance_id' in params: + path_params['workflow_instance_id'] = params['workflow_instance_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/commandqueue/{workflow_instance_id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def commands_get_queued_commands_by_workflow(self, **kwargs): # noqa: E501 + """Fetch the queued Commands for an Organization # noqa: E501 + + This endpoint will return all queued Commands for an Organization. Each element will contain the workflow ID, the command name, the launch type (e.g. manual, triggered, or scheduled), the target OS, the number of assigned devices, and the number of pending devices that have not yet ran the command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/queuedcommand/workflows \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.commands_get_queued_commands_by_workflow(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int skip: The offset into the records to return. + :return: QueuedCommandList + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.commands_get_queued_commands_by_workflow_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.commands_get_queued_commands_by_workflow_with_http_info(**kwargs) # noqa: E501 + return data + + def commands_get_queued_commands_by_workflow_with_http_info(self, **kwargs): # noqa: E501 + """Fetch the queued Commands for an Organization # noqa: E501 + + This endpoint will return all queued Commands for an Organization. Each element will contain the workflow ID, the command name, the launch type (e.g. manual, triggered, or scheduled), the target OS, the number of assigned devices, and the number of pending devices that have not yet ran the command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/queuedcommand/workflows \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.commands_get_queued_commands_by_workflow_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int skip: The offset into the records to return. + :return: QueuedCommandList + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['x_org_id', 'limit', 'filter', 'skip'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method commands_get_queued_commands_by_workflow" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/queuedcommand/workflows', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='QueuedCommandList', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_command_associations_list(self, command_id, targets, **kwargs): # noqa: E501 """List the associations of a Command # noqa: E501 This endpoint will return the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_command_associations_list(command_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_command_associations_list(command_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str command_id: ObjectID of the Command. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"command\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_command_associations_list_with_http_info(command_id, targets, content_type, accept, **kwargs) # noqa: E501 + return self.graph_command_associations_list_with_http_info(command_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_command_associations_list_with_http_info(command_id, targets, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_command_associations_list_with_http_info(command_id, targets, **kwargs) # noqa: E501 return data - def graph_command_associations_list_with_http_info(self, command_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_command_associations_list_with_http_info(self, command_id, targets, **kwargs): # noqa: E501 """List the associations of a Command # noqa: E501 This endpoint will return the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_command_associations_list_with_http_info(command_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_command_associations_list_with_http_info(command_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str command_id: ObjectID of the Command. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"command\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['command_id', 'targets', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['command_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -106,17 +304,7 @@ def graph_command_associations_list_with_http_info(self, command_id, targets, co if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_command_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_command_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_command_associations_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_command_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -133,10 +321,6 @@ def graph_command_associations_list_with_http_info(self, command_id, targets, co query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -148,10 +332,6 @@ def graph_command_associations_list_with_http_info(self, command_id, targets, co header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -171,53 +351,49 @@ def graph_command_associations_list_with_http_info(self, command_id, targets, co _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_command_associations_post(self, command_id, content_type, accept, **kwargs): # noqa: E501 + def graph_command_associations_post(self, command_id, **kwargs): # noqa: E501 """Manage the associations of a Command # noqa: E501 - This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` # noqa: E501 + This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_command_associations_post(command_id, content_type, accept, async_req=True) + >>> thread = api.graph_command_associations_post(command_id, async_req=True) >>> result = thread.get() :param async_req bool :param str command_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationCommand body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_command_associations_post_with_http_info(command_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_command_associations_post_with_http_info(command_id, **kwargs) # noqa: E501 else: - (data) = self.graph_command_associations_post_with_http_info(command_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_command_associations_post_with_http_info(command_id, **kwargs) # noqa: E501 return data - def graph_command_associations_post_with_http_info(self, command_id, content_type, accept, **kwargs): # noqa: E501 + def graph_command_associations_post_with_http_info(self, command_id, **kwargs): # noqa: E501 """Manage the associations of a Command # noqa: E501 - This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` # noqa: E501 + This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_command_associations_post_with_http_info(command_id, content_type, accept, async_req=True) + >>> thread = api.graph_command_associations_post_with_http_info(command_id, async_req=True) >>> result = thread.get() :param async_req bool :param str command_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationCommand body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['command_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['command_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -236,14 +412,6 @@ def graph_command_associations_post_with_http_info(self, command_id, content_typ if ('command_id' not in params or params['command_id'] is None): raise ValueError("Missing the required parameter `command_id` when calling `graph_command_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_command_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_command_associations_post`") # noqa: E501 collection_formats = {} @@ -254,10 +422,6 @@ def graph_command_associations_post_with_http_info(self, command_id, content_typ query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -267,10 +431,6 @@ def graph_command_associations_post_with_http_info(self, command_id, content_typ body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -294,57 +454,53 @@ def graph_command_associations_post_with_http_info(self, command_id, content_typ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_command_traverse_system(self, command_id, content_type, accept, **kwargs): # noqa: E501 + def graph_command_traverse_system(self, command_id, **kwargs): # noqa: E501 """List the Systems bound to a Command # noqa: E501 This endpoint will return all Systems bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systems \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_command_traverse_system(command_id, content_type, accept, async_req=True) + >>> thread = api.graph_command_traverse_system(command_id, async_req=True) >>> result = thread.get() :param async_req bool :param str command_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_command_traverse_system_with_http_info(command_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_command_traverse_system_with_http_info(command_id, **kwargs) # noqa: E501 else: - (data) = self.graph_command_traverse_system_with_http_info(command_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_command_traverse_system_with_http_info(command_id, **kwargs) # noqa: E501 return data - def graph_command_traverse_system_with_http_info(self, command_id, content_type, accept, **kwargs): # noqa: E501 + def graph_command_traverse_system_with_http_info(self, command_id, **kwargs): # noqa: E501 """List the Systems bound to a Command # noqa: E501 This endpoint will return all Systems bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systems \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_command_traverse_system_with_http_info(command_id, content_type, accept, async_req=True) + >>> thread = api.graph_command_traverse_system_with_http_info(command_id, async_req=True) >>> result = thread.get() :param async_req bool :param str command_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['command_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['command_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -363,17 +519,7 @@ def graph_command_traverse_system_with_http_info(self, command_id, content_type, if ('command_id' not in params or params['command_id'] is None): raise ValueError("Missing the required parameter `command_id` when calling `graph_command_traverse_system`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_command_traverse_system`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_command_traverse_system`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_command_traverse_system`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -392,10 +538,6 @@ def graph_command_traverse_system_with_http_info(self, command_id, content_type, header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -405,10 +547,6 @@ def graph_command_traverse_system_with_http_info(self, command_id, content_type, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -428,57 +566,53 @@ def graph_command_traverse_system_with_http_info(self, command_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_command_traverse_system_group(self, command_id, content_type, accept, **kwargs): # noqa: E501 + def graph_command_traverse_system_group(self, command_id, **kwargs): # noqa: E501 """List the System Groups bound to a Command # noqa: E501 This endpoint will return all System Groups bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systemgroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_command_traverse_system_group(command_id, content_type, accept, async_req=True) + >>> thread = api.graph_command_traverse_system_group(command_id, async_req=True) >>> result = thread.get() :param async_req bool :param str command_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_command_traverse_system_group_with_http_info(command_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_command_traverse_system_group_with_http_info(command_id, **kwargs) # noqa: E501 else: - (data) = self.graph_command_traverse_system_group_with_http_info(command_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_command_traverse_system_group_with_http_info(command_id, **kwargs) # noqa: E501 return data - def graph_command_traverse_system_group_with_http_info(self, command_id, content_type, accept, **kwargs): # noqa: E501 + def graph_command_traverse_system_group_with_http_info(self, command_id, **kwargs): # noqa: E501 """List the System Groups bound to a Command # noqa: E501 This endpoint will return all System Groups bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systemgroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_command_traverse_system_group_with_http_info(command_id, content_type, accept, async_req=True) + >>> thread = api.graph_command_traverse_system_group_with_http_info(command_id, async_req=True) >>> result = thread.get() :param async_req bool :param str command_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['command_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['command_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -497,17 +631,7 @@ def graph_command_traverse_system_group_with_http_info(self, command_id, content if ('command_id' not in params or params['command_id'] is None): raise ValueError("Missing the required parameter `command_id` when calling `graph_command_traverse_system_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_command_traverse_system_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_command_traverse_system_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_command_traverse_system_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -526,10 +650,6 @@ def graph_command_traverse_system_group_with_http_info(self, command_id, content header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -539,10 +659,6 @@ def graph_command_traverse_system_group_with_http_info(self, command_id, content header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 diff --git a/jcapiv2/jcapiv2/api/custom_emails_api.py b/jcapiv2/jcapiv2/api/custom_emails_api.py new file mode 100644 index 0000000..e7e56f3 --- /dev/null +++ b/jcapiv2/jcapiv2/api/custom_emails_api.py @@ -0,0 +1,524 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv2.api_client import ApiClient + + +class CustomEmailsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def custom_emails_create(self, **kwargs): # noqa: E501 + """Create custom email configuration # noqa: E501 + + Create the custom email configuration for the specified custom email type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.custom_emails_create(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param CustomEmail body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: CustomEmail + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.custom_emails_create_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.custom_emails_create_with_http_info(**kwargs) # noqa: E501 + return data + + def custom_emails_create_with_http_info(self, **kwargs): # noqa: E501 + """Create custom email configuration # noqa: E501 + + Create the custom email configuration for the specified custom email type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.custom_emails_create_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param CustomEmail body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: CustomEmail + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method custom_emails_create" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/customemails', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CustomEmail', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def custom_emails_destroy(self, custom_email_type, **kwargs): # noqa: E501 + """Delete custom email configuration # noqa: E501 + + Delete the custom email configuration for the specified custom email type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.custom_emails_destroy(custom_email_type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str custom_email_type: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.custom_emails_destroy_with_http_info(custom_email_type, **kwargs) # noqa: E501 + else: + (data) = self.custom_emails_destroy_with_http_info(custom_email_type, **kwargs) # noqa: E501 + return data + + def custom_emails_destroy_with_http_info(self, custom_email_type, **kwargs): # noqa: E501 + """Delete custom email configuration # noqa: E501 + + Delete the custom email configuration for the specified custom email type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.custom_emails_destroy_with_http_info(custom_email_type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str custom_email_type: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['custom_email_type', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method custom_emails_destroy" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'custom_email_type' is set + if ('custom_email_type' not in params or + params['custom_email_type'] is None): + raise ValueError("Missing the required parameter `custom_email_type` when calling `custom_emails_destroy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'custom_email_type' in params: + path_params['custom_email_type'] = params['custom_email_type'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/customemails/{custom_email_type}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def custom_emails_get_templates(self, **kwargs): # noqa: E501 + """List custom email templates # noqa: E501 + + Get the list of custom email templates # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.custom_emails_get_templates(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[CustomEmailTemplate] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.custom_emails_get_templates_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.custom_emails_get_templates_with_http_info(**kwargs) # noqa: E501 + return data + + def custom_emails_get_templates_with_http_info(self, **kwargs): # noqa: E501 + """List custom email templates # noqa: E501 + + Get the list of custom email templates # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.custom_emails_get_templates_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[CustomEmailTemplate] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method custom_emails_get_templates" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/customemail/templates', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[CustomEmailTemplate]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def custom_emails_read(self, custom_email_type, **kwargs): # noqa: E501 + """Get custom email configuration # noqa: E501 + + Get the custom email configuration for the specified custom email type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.custom_emails_read(custom_email_type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str custom_email_type: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: CustomEmail + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.custom_emails_read_with_http_info(custom_email_type, **kwargs) # noqa: E501 + else: + (data) = self.custom_emails_read_with_http_info(custom_email_type, **kwargs) # noqa: E501 + return data + + def custom_emails_read_with_http_info(self, custom_email_type, **kwargs): # noqa: E501 + """Get custom email configuration # noqa: E501 + + Get the custom email configuration for the specified custom email type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.custom_emails_read_with_http_info(custom_email_type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str custom_email_type: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: CustomEmail + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['custom_email_type', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method custom_emails_read" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'custom_email_type' is set + if ('custom_email_type' not in params or + params['custom_email_type'] is None): + raise ValueError("Missing the required parameter `custom_email_type` when calling `custom_emails_read`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'custom_email_type' in params: + path_params['custom_email_type'] = params['custom_email_type'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/customemails/{custom_email_type}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CustomEmail', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def custom_emails_update(self, custom_email_type, **kwargs): # noqa: E501 + """Update custom email configuration # noqa: E501 + + Update the custom email configuration for the specified custom email type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.custom_emails_update(custom_email_type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str custom_email_type: (required) + :param CustomEmail body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: CustomEmail + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.custom_emails_update_with_http_info(custom_email_type, **kwargs) # noqa: E501 + else: + (data) = self.custom_emails_update_with_http_info(custom_email_type, **kwargs) # noqa: E501 + return data + + def custom_emails_update_with_http_info(self, custom_email_type, **kwargs): # noqa: E501 + """Update custom email configuration # noqa: E501 + + Update the custom email configuration for the specified custom email type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.custom_emails_update_with_http_info(custom_email_type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str custom_email_type: (required) + :param CustomEmail body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: CustomEmail + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['custom_email_type', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method custom_emails_update" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'custom_email_type' is set + if ('custom_email_type' not in params or + params['custom_email_type'] is None): + raise ValueError("Missing the required parameter `custom_email_type` when calling `custom_emails_update`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'custom_email_type' in params: + path_params['custom_email_type'] = params['custom_email_type'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/customemails/{custom_email_type}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CustomEmail', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/default_api.py b/jcapiv2/jcapiv2/api/default_api.py deleted file mode 100644 index 869b908..0000000 --- a/jcapiv2/jcapiv2/api/default_api.py +++ /dev/null @@ -1,529 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from jcapiv2.api_client import ApiClient - - -class DefaultApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def jc_enrollment_profiles_delete(self, enrollment_profile_id, **kwargs): # noqa: E501 - """Delete Enrollment Profile # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.jc_enrollment_profiles_delete(enrollment_profile_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str enrollment_profile_id: (required) - :return: JcEnrollmentProfile - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.jc_enrollment_profiles_delete_with_http_info(enrollment_profile_id, **kwargs) # noqa: E501 - else: - (data) = self.jc_enrollment_profiles_delete_with_http_info(enrollment_profile_id, **kwargs) # noqa: E501 - return data - - def jc_enrollment_profiles_delete_with_http_info(self, enrollment_profile_id, **kwargs): # noqa: E501 - """Delete Enrollment Profile # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.jc_enrollment_profiles_delete_with_http_info(enrollment_profile_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str enrollment_profile_id: (required) - :return: JcEnrollmentProfile - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['enrollment_profile_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method jc_enrollment_profiles_delete" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'enrollment_profile_id' is set - if ('enrollment_profile_id' not in params or - params['enrollment_profile_id'] is None): - raise ValueError("Missing the required parameter `enrollment_profile_id` when calling `jc_enrollment_profiles_delete`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'enrollment_profile_id' in params: - path_params['enrollment_profile_id'] = params['enrollment_profile_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/enrollmentprofiles/{enrollment_profile_id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='JcEnrollmentProfile', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def jc_enrollment_profiles_get(self, enrollment_profile_id, **kwargs): # noqa: E501 - """Get Enrollment Profile # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.jc_enrollment_profiles_get(enrollment_profile_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str enrollment_profile_id: (required) - :param JcEnrollmentProfile body: - :return: ERRORUNKNOWN - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.jc_enrollment_profiles_get_with_http_info(enrollment_profile_id, **kwargs) # noqa: E501 - else: - (data) = self.jc_enrollment_profiles_get_with_http_info(enrollment_profile_id, **kwargs) # noqa: E501 - return data - - def jc_enrollment_profiles_get_with_http_info(self, enrollment_profile_id, **kwargs): # noqa: E501 - """Get Enrollment Profile # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.jc_enrollment_profiles_get_with_http_info(enrollment_profile_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str enrollment_profile_id: (required) - :param JcEnrollmentProfile body: - :return: ERRORUNKNOWN - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['enrollment_profile_id', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method jc_enrollment_profiles_get" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'enrollment_profile_id' is set - if ('enrollment_profile_id' not in params or - params['enrollment_profile_id'] is None): - raise ValueError("Missing the required parameter `enrollment_profile_id` when calling `jc_enrollment_profiles_get`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'enrollment_profile_id' in params: - path_params['enrollment_profile_id'] = params['enrollment_profile_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/enrollmentprofiles/{enrollment_profile_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ERRORUNKNOWN', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def jc_enrollment_profiles_list(self, **kwargs): # noqa: E501 - """List Enrollment Profiles # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.jc_enrollment_profiles_list(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int limit: - :param int skip: The offset into the records to return. - :return: list[JcEnrollmentProfile] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.jc_enrollment_profiles_list_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.jc_enrollment_profiles_list_with_http_info(**kwargs) # noqa: E501 - return data - - def jc_enrollment_profiles_list_with_http_info(self, **kwargs): # noqa: E501 - """List Enrollment Profiles # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.jc_enrollment_profiles_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int limit: - :param int skip: The offset into the records to return. - :return: list[JcEnrollmentProfile] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['limit', 'skip'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method jc_enrollment_profiles_list" % key - ) - params[key] = val - del params['kwargs'] - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `jc_enrollment_profiles_list`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `jc_enrollment_profiles_list`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `jc_enrollment_profiles_list`, must be a value greater than or equal to `0`") # noqa: E501 - collection_formats = {} - - path_params = {} - - query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/enrollmentprofiles', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[JcEnrollmentProfile]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def jc_enrollment_profiles_post(self, **kwargs): # noqa: E501 - """Create new Enrollment Profile # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.jc_enrollment_profiles_post(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param Body1 body: - :return: JcEnrollmentProfile - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.jc_enrollment_profiles_post_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.jc_enrollment_profiles_post_with_http_info(**kwargs) # noqa: E501 - return data - - def jc_enrollment_profiles_post_with_http_info(self, **kwargs): # noqa: E501 - """Create new Enrollment Profile # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.jc_enrollment_profiles_post_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param Body1 body: - :return: JcEnrollmentProfile - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method jc_enrollment_profiles_post" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/enrollmentprofiles', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='JcEnrollmentProfile', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def jc_enrollment_profiles_put(self, enrollment_profile_id, **kwargs): # noqa: E501 - """Update Enrollment Profile # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.jc_enrollment_profiles_put(enrollment_profile_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str enrollment_profile_id: (required) - :param Body2 body: - :return: JcEnrollmentProfile - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.jc_enrollment_profiles_put_with_http_info(enrollment_profile_id, **kwargs) # noqa: E501 - else: - (data) = self.jc_enrollment_profiles_put_with_http_info(enrollment_profile_id, **kwargs) # noqa: E501 - return data - - def jc_enrollment_profiles_put_with_http_info(self, enrollment_profile_id, **kwargs): # noqa: E501 - """Update Enrollment Profile # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.jc_enrollment_profiles_put_with_http_info(enrollment_profile_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str enrollment_profile_id: (required) - :param Body2 body: - :return: JcEnrollmentProfile - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['enrollment_profile_id', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method jc_enrollment_profiles_put" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'enrollment_profile_id' is set - if ('enrollment_profile_id' not in params or - params['enrollment_profile_id'] is None): - raise ValueError("Missing the required parameter `enrollment_profile_id` when calling `jc_enrollment_profiles_put`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'enrollment_profile_id' in params: - path_params['enrollment_profile_id'] = params['enrollment_profile_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/enrollmentprofiles/{enrollment_profile_id}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='JcEnrollmentProfile', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/directories_api.py b/jcapiv2/jcapiv2/api/directories_api.py index bdcd13b..1f1061a 100644 --- a/jcapiv2/jcapiv2/api/directories_api.py +++ b/jcapiv2/jcapiv2/api/directories_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,57 +32,53 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def directories_list(self, content_type, accept, **kwargs): # noqa: E501 + def directories_list(self, **kwargs): # noqa: E501 """List All Directories # noqa: E501 This endpoint returns all active directories (LDAP, O365 Suite, G-Suite). #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.directories_list(content_type, accept, async_req=True) + >>> thread = api.directories_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. :param int limit: The number of records to return at once. Limited to 100. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[Directory] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.directories_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.directories_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.directories_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.directories_list_with_http_info(**kwargs) # noqa: E501 return data - def directories_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def directories_list_with_http_info(self, **kwargs): # noqa: E501 """List All Directories # noqa: E501 This endpoint returns all active directories (LDAP, O365 Suite, G-Suite). #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.directories_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.directories_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. :param int limit: The number of records to return at once. Limited to 100. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[Directory] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'fields', 'limit', 'sort', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['fields', 'limit', 'sort', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -98,17 +93,7 @@ def directories_list_with_http_info(self, content_type, accept, **kwargs): # no ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `directories_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `directories_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `directories_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -126,10 +111,6 @@ def directories_list_with_http_info(self, content_type, accept, **kwargs): # no query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -141,10 +122,6 @@ def directories_list_with_http_info(self, content_type, accept, **kwargs): # no header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 diff --git a/jcapiv2/jcapiv2/api/duo_api.py b/jcapiv2/jcapiv2/api/duo_api.py index 0fd4097..76f7f92 100644 --- a/jcapiv2/jcapiv2/api/duo_api.py +++ b/jcapiv2/jcapiv2/api/duo_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,51 +32,47 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def duo_account_delete(self, id, content_type, accept, **kwargs): # noqa: E501 + def duo_account_delete(self, id, **kwargs): # noqa: E501 """Delete a Duo Account # noqa: E501 Removes the specified Duo account, an error will be returned if the account has some Duo application used in a protected resource. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/duo/accounts/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_account_delete(id, content_type, accept, async_req=True) + >>> thread = api.duo_account_delete(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the Duo Account (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: DuoAccount If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.duo_account_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.duo_account_delete_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.duo_account_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.duo_account_delete_with_http_info(id, **kwargs) # noqa: E501 return data - def duo_account_delete_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def duo_account_delete_with_http_info(self, id, **kwargs): # noqa: E501 """Delete a Duo Account # noqa: E501 Removes the specified Duo account, an error will be returned if the account has some Duo application used in a protected resource. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/duo/accounts/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_account_delete_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.duo_account_delete_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the Duo Account (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: DuoAccount If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -96,14 +91,6 @@ def duo_account_delete_with_http_info(self, id, content_type, accept, **kwargs): if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `duo_account_delete`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `duo_account_delete`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `duo_account_delete`") # noqa: E501 collection_formats = {} @@ -116,10 +103,6 @@ def duo_account_delete_with_http_info(self, id, content_type, accept, **kwargs): header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -129,10 +112,6 @@ def duo_account_delete_with_http_info(self, id, content_type, accept, **kwargs): header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -152,51 +131,47 @@ def duo_account_delete_with_http_info(self, id, content_type, accept, **kwargs): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def duo_account_get(self, id, content_type, accept, **kwargs): # noqa: E501 + def duo_account_get(self, id, **kwargs): # noqa: E501 """Get a Duo Acount # noqa: E501 This endpoint returns a specific Duo account. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_account_get(id, content_type, accept, async_req=True) + >>> thread = api.duo_account_get(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the Duo Account (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: DuoAccount If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.duo_account_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.duo_account_get_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.duo_account_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.duo_account_get_with_http_info(id, **kwargs) # noqa: E501 return data - def duo_account_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def duo_account_get_with_http_info(self, id, **kwargs): # noqa: E501 """Get a Duo Acount # noqa: E501 This endpoint returns a specific Duo account. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_account_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.duo_account_get_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the Duo Account (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: DuoAccount If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -215,14 +190,6 @@ def duo_account_get_with_http_info(self, id, content_type, accept, **kwargs): # if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `duo_account_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `duo_account_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `duo_account_get`") # noqa: E501 collection_formats = {} @@ -235,10 +202,6 @@ def duo_account_get_with_http_info(self, id, content_type, accept, **kwargs): # header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -248,10 +211,6 @@ def duo_account_get_with_http_info(self, id, content_type, accept, **kwargs): # header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -271,49 +230,45 @@ def duo_account_get_with_http_info(self, id, content_type, accept, **kwargs): # _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def duo_account_list(self, content_type, accept, **kwargs): # noqa: E501 - """List Duo Acounts # noqa: E501 + def duo_account_list(self, **kwargs): # noqa: E501 + """List Duo Accounts # noqa: E501 This endpoint returns all the Duo accounts for your organization. Note: There can currently only be one Duo account for your organization. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_account_list(content_type, accept, async_req=True) + >>> thread = api.duo_account_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[DuoAccount] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.duo_account_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.duo_account_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.duo_account_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.duo_account_list_with_http_info(**kwargs) # noqa: E501 return data - def duo_account_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List Duo Acounts # noqa: E501 + def duo_account_list_with_http_info(self, **kwargs): # noqa: E501 + """List Duo Accounts # noqa: E501 This endpoint returns all the Duo accounts for your organization. Note: There can currently only be one Duo account for your organization. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_account_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.duo_account_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[DuoAccount] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -328,14 +283,6 @@ def duo_account_list_with_http_info(self, content_type, accept, **kwargs): # no ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `duo_account_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `duo_account_list`") # noqa: E501 collection_formats = {} @@ -346,10 +293,6 @@ def duo_account_list_with_http_info(self, content_type, accept, **kwargs): # no header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -359,10 +302,6 @@ def duo_account_list_with_http_info(self, content_type, accept, **kwargs): # no header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -382,49 +321,45 @@ def duo_account_list_with_http_info(self, content_type, accept, **kwargs): # no _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def duo_account_post(self, content_type, accept, **kwargs): # noqa: E501 + def duo_account_post(self, **kwargs): # noqa: E501 """Create Duo Account # noqa: E501 Registers a Duo account for an organization. Only one Duo account will be allowed, in case an organization has a Duo account already a 409 (Conflict) code will be returned. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/duo/accounts \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_account_post(content_type, accept, async_req=True) + >>> thread = api.duo_account_post(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: DuoAccount If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.duo_account_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.duo_account_post_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.duo_account_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.duo_account_post_with_http_info(**kwargs) # noqa: E501 return data - def duo_account_post_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def duo_account_post_with_http_info(self, **kwargs): # noqa: E501 """Create Duo Account # noqa: E501 Registers a Duo account for an organization. Only one Duo account will be allowed, in case an organization has a Duo account already a 409 (Conflict) code will be returned. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/duo/accounts \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_account_post_with_http_info(content_type, accept, async_req=True) + >>> thread = api.duo_account_post_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: DuoAccount If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -439,14 +374,6 @@ def duo_account_post_with_http_info(self, content_type, accept, **kwargs): # no ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `duo_account_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `duo_account_post`") # noqa: E501 collection_formats = {} @@ -455,10 +382,6 @@ def duo_account_post_with_http_info(self, content_type, accept, **kwargs): # no query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -470,10 +393,6 @@ def duo_account_post_with_http_info(self, content_type, accept, **kwargs): # no header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -493,53 +412,49 @@ def duo_account_post_with_http_info(self, content_type, accept, **kwargs): # no _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def duo_application_delete(self, account_id, application_id, content_type, accept, **kwargs): # noqa: E501 + def duo_application_delete(self, account_id, application_id, **kwargs): # noqa: E501 """Delete a Duo Application # noqa: E501 Deletes the specified Duo application, an error will be returned if the application is used in a protected resource. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}'' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_application_delete(account_id, application_id, content_type, accept, async_req=True) + >>> thread = api.duo_application_delete(account_id, application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str account_id: (required) :param str application_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: DuoApplication If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.duo_application_delete_with_http_info(account_id, application_id, content_type, accept, **kwargs) # noqa: E501 + return self.duo_application_delete_with_http_info(account_id, application_id, **kwargs) # noqa: E501 else: - (data) = self.duo_application_delete_with_http_info(account_id, application_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.duo_application_delete_with_http_info(account_id, application_id, **kwargs) # noqa: E501 return data - def duo_application_delete_with_http_info(self, account_id, application_id, content_type, accept, **kwargs): # noqa: E501 + def duo_application_delete_with_http_info(self, account_id, application_id, **kwargs): # noqa: E501 """Delete a Duo Application # noqa: E501 Deletes the specified Duo application, an error will be returned if the application is used in a protected resource. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}'' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_application_delete_with_http_info(account_id, application_id, content_type, accept, async_req=True) + >>> thread = api.duo_application_delete_with_http_info(account_id, application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str account_id: (required) :param str application_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: DuoApplication If the method is called asynchronously, returns the request thread. """ - all_params = ['account_id', 'application_id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['account_id', 'application_id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -562,14 +477,6 @@ def duo_application_delete_with_http_info(self, account_id, application_id, cont if ('application_id' not in params or params['application_id'] is None): raise ValueError("Missing the required parameter `application_id` when calling `duo_application_delete`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `duo_application_delete`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `duo_application_delete`") # noqa: E501 collection_formats = {} @@ -584,10 +491,6 @@ def duo_application_delete_with_http_info(self, account_id, application_id, cont header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -597,10 +500,6 @@ def duo_application_delete_with_http_info(self, account_id, application_id, cont header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -620,53 +519,49 @@ def duo_application_delete_with_http_info(self, account_id, application_id, cont _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def duo_application_get(self, account_id, application_id, content_type, accept, **kwargs): # noqa: E501 + def duo_application_get(self, account_id, application_id, **kwargs): # noqa: E501 """Get a Duo application # noqa: E501 This endpoint returns a specific Duo application that is associated with the specified Duo account. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_application_get(account_id, application_id, content_type, accept, async_req=True) + >>> thread = api.duo_application_get(account_id, application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str account_id: (required) :param str application_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: DuoApplication If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.duo_application_get_with_http_info(account_id, application_id, content_type, accept, **kwargs) # noqa: E501 + return self.duo_application_get_with_http_info(account_id, application_id, **kwargs) # noqa: E501 else: - (data) = self.duo_application_get_with_http_info(account_id, application_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.duo_application_get_with_http_info(account_id, application_id, **kwargs) # noqa: E501 return data - def duo_application_get_with_http_info(self, account_id, application_id, content_type, accept, **kwargs): # noqa: E501 + def duo_application_get_with_http_info(self, account_id, application_id, **kwargs): # noqa: E501 """Get a Duo application # noqa: E501 This endpoint returns a specific Duo application that is associated with the specified Duo account. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_application_get_with_http_info(account_id, application_id, content_type, accept, async_req=True) + >>> thread = api.duo_application_get_with_http_info(account_id, application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str account_id: (required) :param str application_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: DuoApplication If the method is called asynchronously, returns the request thread. """ - all_params = ['account_id', 'application_id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['account_id', 'application_id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -689,14 +584,6 @@ def duo_application_get_with_http_info(self, account_id, application_id, content if ('application_id' not in params or params['application_id'] is None): raise ValueError("Missing the required parameter `application_id` when calling `duo_application_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `duo_application_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `duo_application_get`") # noqa: E501 collection_formats = {} @@ -711,10 +598,6 @@ def duo_application_get_with_http_info(self, account_id, application_id, content header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -724,10 +607,6 @@ def duo_application_get_with_http_info(self, account_id, application_id, content header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -747,51 +626,47 @@ def duo_application_get_with_http_info(self, account_id, application_id, content _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def duo_application_list(self, account_id, content_type, accept, **kwargs): # noqa: E501 + def duo_application_list(self, account_id, **kwargs): # noqa: E501 """List Duo Applications # noqa: E501 This endpoint returns all the Duo applications for the specified Duo account. Note: There can currently only be one Duo application for your organization. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_application_list(account_id, content_type, accept, async_req=True) + >>> thread = api.duo_application_list(account_id, async_req=True) >>> result = thread.get() :param async_req bool :param str account_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[DuoApplication] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.duo_application_list_with_http_info(account_id, content_type, accept, **kwargs) # noqa: E501 + return self.duo_application_list_with_http_info(account_id, **kwargs) # noqa: E501 else: - (data) = self.duo_application_list_with_http_info(account_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.duo_application_list_with_http_info(account_id, **kwargs) # noqa: E501 return data - def duo_application_list_with_http_info(self, account_id, content_type, accept, **kwargs): # noqa: E501 + def duo_application_list_with_http_info(self, account_id, **kwargs): # noqa: E501 """List Duo Applications # noqa: E501 This endpoint returns all the Duo applications for the specified Duo account. Note: There can currently only be one Duo application for your organization. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_application_list_with_http_info(account_id, content_type, accept, async_req=True) + >>> thread = api.duo_application_list_with_http_info(account_id, async_req=True) >>> result = thread.get() :param async_req bool :param str account_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[DuoApplication] If the method is called asynchronously, returns the request thread. """ - all_params = ['account_id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['account_id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -810,14 +685,6 @@ def duo_application_list_with_http_info(self, account_id, content_type, accept, if ('account_id' not in params or params['account_id'] is None): raise ValueError("Missing the required parameter `account_id` when calling `duo_application_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `duo_application_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `duo_application_list`") # noqa: E501 collection_formats = {} @@ -830,10 +697,6 @@ def duo_application_list_with_http_info(self, account_id, content_type, accept, header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -843,10 +706,6 @@ def duo_application_list_with_http_info(self, account_id, content_type, accept, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -866,53 +725,49 @@ def duo_application_list_with_http_info(self, account_id, content_type, accept, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def duo_application_post(self, account_id, content_type, accept, **kwargs): # noqa: E501 + def duo_application_post(self, account_id, **kwargs): # noqa: E501 """Create Duo Application # noqa: E501 Creates a Duo application for your organization and the specified account. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Application Name\", \"apiHost\": \"api-1234.duosecurity.com\", \"integrationKey\": \"1234\", \"secretKey\": \"5678\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_application_post(account_id, content_type, accept, async_req=True) + >>> thread = api.duo_application_post(account_id, async_req=True) >>> result = thread.get() :param async_req bool :param str account_id: (required) - :param str content_type: (required) - :param str accept: (required) :param DuoApplicationReq body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: DuoApplication If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.duo_application_post_with_http_info(account_id, content_type, accept, **kwargs) # noqa: E501 + return self.duo_application_post_with_http_info(account_id, **kwargs) # noqa: E501 else: - (data) = self.duo_application_post_with_http_info(account_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.duo_application_post_with_http_info(account_id, **kwargs) # noqa: E501 return data - def duo_application_post_with_http_info(self, account_id, content_type, accept, **kwargs): # noqa: E501 + def duo_application_post_with_http_info(self, account_id, **kwargs): # noqa: E501 """Create Duo Application # noqa: E501 Creates a Duo application for your organization and the specified account. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Application Name\", \"apiHost\": \"api-1234.duosecurity.com\", \"integrationKey\": \"1234\", \"secretKey\": \"5678\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_application_post_with_http_info(account_id, content_type, accept, async_req=True) + >>> thread = api.duo_application_post_with_http_info(account_id, async_req=True) >>> result = thread.get() :param async_req bool :param str account_id: (required) - :param str content_type: (required) - :param str accept: (required) :param DuoApplicationReq body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: DuoApplication If the method is called asynchronously, returns the request thread. """ - all_params = ['account_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['account_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -931,14 +786,6 @@ def duo_application_post_with_http_info(self, account_id, content_type, accept, if ('account_id' not in params or params['account_id'] is None): raise ValueError("Missing the required parameter `account_id` when calling `duo_application_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `duo_application_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `duo_application_post`") # noqa: E501 collection_formats = {} @@ -951,10 +798,6 @@ def duo_application_post_with_http_info(self, account_id, content_type, accept, header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -989,55 +832,51 @@ def duo_application_post_with_http_info(self, account_id, content_type, accept, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def duo_application_update(self, account_id, application_id, content_type, accept, **kwargs): # noqa: E501 + def duo_application_update(self, account_id, application_id, **kwargs): # noqa: E501 """Update Duo Application # noqa: E501 Updates the specified Duo application. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Application Name\", \"apiHost\": \"api-1234.duosecurity.com\", \"integrationKey\": \"1234\", \"secretKey\": \"5678\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_application_update(account_id, application_id, content_type, accept, async_req=True) + >>> thread = api.duo_application_update(account_id, application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str account_id: (required) :param str application_id: (required) - :param str content_type: (required) - :param str accept: (required) :param DuoApplicationUpdateReq body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: DuoApplication If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.duo_application_update_with_http_info(account_id, application_id, content_type, accept, **kwargs) # noqa: E501 + return self.duo_application_update_with_http_info(account_id, application_id, **kwargs) # noqa: E501 else: - (data) = self.duo_application_update_with_http_info(account_id, application_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.duo_application_update_with_http_info(account_id, application_id, **kwargs) # noqa: E501 return data - def duo_application_update_with_http_info(self, account_id, application_id, content_type, accept, **kwargs): # noqa: E501 + def duo_application_update_with_http_info(self, account_id, application_id, **kwargs): # noqa: E501 """Update Duo Application # noqa: E501 Updates the specified Duo application. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Application Name\", \"apiHost\": \"api-1234.duosecurity.com\", \"integrationKey\": \"1234\", \"secretKey\": \"5678\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.duo_application_update_with_http_info(account_id, application_id, content_type, accept, async_req=True) + >>> thread = api.duo_application_update_with_http_info(account_id, application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str account_id: (required) :param str application_id: (required) - :param str content_type: (required) - :param str accept: (required) :param DuoApplicationUpdateReq body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: DuoApplication If the method is called asynchronously, returns the request thread. """ - all_params = ['account_id', 'application_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['account_id', 'application_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1060,14 +899,6 @@ def duo_application_update_with_http_info(self, account_id, application_id, cont if ('application_id' not in params or params['application_id'] is None): raise ValueError("Missing the required parameter `application_id` when calling `duo_application_update`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `duo_application_update`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `duo_application_update`") # noqa: E501 collection_formats = {} @@ -1082,10 +913,6 @@ def duo_application_update_with_http_info(self, account_id, application_id, cont header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} diff --git a/jcapiv2/jcapiv2/api/fde_api.py b/jcapiv2/jcapiv2/api/fde_api.py index 215d5d2..fd17c4c 100644 --- a/jcapiv2/jcapiv2/api/fde_api.py +++ b/jcapiv2/jcapiv2/api/fde_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -44,7 +43,7 @@ def systems_get_fde_key(self, system_id, **kwargs): # noqa: E501 :param async_req bool :param str system_id: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: Systemfdekey If the method is called asynchronously, returns the request thread. @@ -67,7 +66,7 @@ def systems_get_fde_key_with_http_info(self, system_id, **kwargs): # noqa: E501 :param async_req bool :param str system_id: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: Systemfdekey If the method is called asynchronously, returns the request thread. @@ -113,10 +112,6 @@ def systems_get_fde_key_with_http_info(self, system_id, **kwargs): # noqa: E501 header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 diff --git a/jcapiv2/jcapiv2/api/g_suite_api.py b/jcapiv2/jcapiv2/api/g_suite_api.py index a05b5c5..c76d485 100644 --- a/jcapiv2/jcapiv2/api/g_suite_api.py +++ b/jcapiv2/jcapiv2/api/g_suite_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,57 +32,53 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def graph_g_suite_associations_list(self, gsuite_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_g_suite_associations_list(self, gsuite_id, targets, **kwargs): # noqa: E501 """List the associations of a G Suite instance # noqa: E501 This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_g_suite_associations_list(gsuite_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_g_suite_associations_list(gsuite_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: ObjectID of the G Suite instance. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"g_suite\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_g_suite_associations_list_with_http_info(gsuite_id, targets, content_type, accept, **kwargs) # noqa: E501 + return self.graph_g_suite_associations_list_with_http_info(gsuite_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_g_suite_associations_list_with_http_info(gsuite_id, targets, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_g_suite_associations_list_with_http_info(gsuite_id, targets, **kwargs) # noqa: E501 return data - def graph_g_suite_associations_list_with_http_info(self, gsuite_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_g_suite_associations_list_with_http_info(self, gsuite_id, targets, **kwargs): # noqa: E501 """List the associations of a G Suite instance # noqa: E501 This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_g_suite_associations_list_with_http_info(gsuite_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_g_suite_associations_list_with_http_info(gsuite_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: ObjectID of the G Suite instance. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"g_suite\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['gsuite_id', 'targets', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['gsuite_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -106,17 +101,7 @@ def graph_g_suite_associations_list_with_http_info(self, gsuite_id, targets, con if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_g_suite_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_g_suite_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_g_suite_associations_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_g_suite_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -133,10 +118,6 @@ def graph_g_suite_associations_list_with_http_info(self, gsuite_id, targets, con query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -148,10 +129,6 @@ def graph_g_suite_associations_list_with_http_info(self, gsuite_id, targets, con header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -174,7 +151,7 @@ def graph_g_suite_associations_list_with_http_info(self, gsuite_id, targets, con def graph_g_suite_associations_post(self, gsuite_id, **kwargs): # noqa: E501 """Manage the associations of a G Suite instance # noqa: E501 - This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 + This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.graph_g_suite_associations_post(gsuite_id, async_req=True) @@ -182,8 +159,8 @@ def graph_g_suite_associations_post(self, gsuite_id, **kwargs): # noqa: E501 :param async_req bool :param str gsuite_id: ObjectID of the G Suite instance. (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationGSuite body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. @@ -198,7 +175,7 @@ def graph_g_suite_associations_post(self, gsuite_id, **kwargs): # noqa: E501 def graph_g_suite_associations_post_with_http_info(self, gsuite_id, **kwargs): # noqa: E501 """Manage the associations of a G Suite instance # noqa: E501 - This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 + This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.graph_g_suite_associations_post_with_http_info(gsuite_id, async_req=True) @@ -206,8 +183,8 @@ def graph_g_suite_associations_post_with_http_info(self, gsuite_id, **kwargs): :param async_req bool :param str gsuite_id: ObjectID of the G Suite instance. (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationGSuite body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. @@ -251,10 +228,6 @@ def graph_g_suite_associations_post_with_http_info(self, gsuite_id, **kwargs): body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -278,57 +251,53 @@ def graph_g_suite_associations_post_with_http_info(self, gsuite_id, **kwargs): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_g_suite_traverse_user(self, gsuite_id, content_type, accept, **kwargs): # noqa: E501 + def graph_g_suite_traverse_user(self, gsuite_id, **kwargs): # noqa: E501 """List the Users bound to a G Suite instance # noqa: E501 This endpoint will return all Users bound to a G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_g_suite_traverse_user(gsuite_id, content_type, accept, async_req=True) + >>> thread = api.graph_g_suite_traverse_user(gsuite_id, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: ObjectID of the G Suite instance. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_g_suite_traverse_user_with_http_info(gsuite_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_g_suite_traverse_user_with_http_info(gsuite_id, **kwargs) # noqa: E501 else: - (data) = self.graph_g_suite_traverse_user_with_http_info(gsuite_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_g_suite_traverse_user_with_http_info(gsuite_id, **kwargs) # noqa: E501 return data - def graph_g_suite_traverse_user_with_http_info(self, gsuite_id, content_type, accept, **kwargs): # noqa: E501 + def graph_g_suite_traverse_user_with_http_info(self, gsuite_id, **kwargs): # noqa: E501 """List the Users bound to a G Suite instance # noqa: E501 This endpoint will return all Users bound to a G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_g_suite_traverse_user_with_http_info(gsuite_id, content_type, accept, async_req=True) + >>> thread = api.graph_g_suite_traverse_user_with_http_info(gsuite_id, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: ObjectID of the G Suite instance. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['gsuite_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['gsuite_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -347,17 +316,7 @@ def graph_g_suite_traverse_user_with_http_info(self, gsuite_id, content_type, ac if ('gsuite_id' not in params or params['gsuite_id'] is None): raise ValueError("Missing the required parameter `gsuite_id` when calling `graph_g_suite_traverse_user`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_g_suite_traverse_user`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_g_suite_traverse_user`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_g_suite_traverse_user`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -376,10 +335,6 @@ def graph_g_suite_traverse_user_with_http_info(self, gsuite_id, content_type, ac header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -389,10 +344,6 @@ def graph_g_suite_traverse_user_with_http_info(self, gsuite_id, content_type, ac header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -412,57 +363,53 @@ def graph_g_suite_traverse_user_with_http_info(self, gsuite_id, content_type, ac _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_g_suite_traverse_user_group(self, gsuite_id, content_type, accept, **kwargs): # noqa: E501 + def graph_g_suite_traverse_user_group(self, gsuite_id, **kwargs): # noqa: E501 """List the User Groups bound to a G Suite instance # noqa: E501 This endpoint will return all User Groups bound to an G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSuite_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_g_suite_traverse_user_group(gsuite_id, content_type, accept, async_req=True) + >>> thread = api.graph_g_suite_traverse_user_group(gsuite_id, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: ObjectID of the G Suite instance. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_g_suite_traverse_user_group_with_http_info(gsuite_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_g_suite_traverse_user_group_with_http_info(gsuite_id, **kwargs) # noqa: E501 else: - (data) = self.graph_g_suite_traverse_user_group_with_http_info(gsuite_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_g_suite_traverse_user_group_with_http_info(gsuite_id, **kwargs) # noqa: E501 return data - def graph_g_suite_traverse_user_group_with_http_info(self, gsuite_id, content_type, accept, **kwargs): # noqa: E501 + def graph_g_suite_traverse_user_group_with_http_info(self, gsuite_id, **kwargs): # noqa: E501 """List the User Groups bound to a G Suite instance # noqa: E501 This endpoint will return all User Groups bound to an G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSuite_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_g_suite_traverse_user_group_with_http_info(gsuite_id, content_type, accept, async_req=True) + >>> thread = api.graph_g_suite_traverse_user_group_with_http_info(gsuite_id, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: ObjectID of the G Suite instance. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['gsuite_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['gsuite_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -481,17 +428,7 @@ def graph_g_suite_traverse_user_group_with_http_info(self, gsuite_id, content_ty if ('gsuite_id' not in params or params['gsuite_id'] is None): raise ValueError("Missing the required parameter `gsuite_id` when calling `graph_g_suite_traverse_user_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_g_suite_traverse_user_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_g_suite_traverse_user_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_g_suite_traverse_user_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -510,10 +447,6 @@ def graph_g_suite_traverse_user_group_with_http_info(self, gsuite_id, content_ty header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -523,10 +456,6 @@ def graph_g_suite_traverse_user_group_with_http_info(self, gsuite_id, content_ty header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -546,51 +475,47 @@ def graph_g_suite_traverse_user_group_with_http_info(self, gsuite_id, content_ty _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def gsuites_get(self, id, content_type, accept, **kwargs): # noqa: E501 + def gsuites_get(self, id, **kwargs): # noqa: E501 """Get G Suite # noqa: E501 This endpoint returns a specific G Suite. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.gsuites_get(id, content_type, accept, async_req=True) + >>> thread = api.gsuites_get(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: Unique identifier of the GSuite. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: GsuiteOutput If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.gsuites_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.gsuites_get_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.gsuites_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.gsuites_get_with_http_info(id, **kwargs) # noqa: E501 return data - def gsuites_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def gsuites_get_with_http_info(self, id, **kwargs): # noqa: E501 """Get G Suite # noqa: E501 This endpoint returns a specific G Suite. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.gsuites_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.gsuites_get_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: Unique identifier of the GSuite. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: GsuiteOutput If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -609,14 +534,6 @@ def gsuites_get_with_http_info(self, id, content_type, accept, **kwargs): # noq if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `gsuites_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `gsuites_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `gsuites_get`") # noqa: E501 collection_formats = {} @@ -629,10 +546,6 @@ def gsuites_get_with_http_info(self, id, content_type, accept, **kwargs): # noq header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -642,12 +555,8 @@ def gsuites_get_with_http_info(self, id, content_type, accept, **kwargs): # noq header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting - auth_settings = [] # noqa: E501 + auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( '/gsuites/{id}', 'GET', @@ -665,53 +574,283 @@ def gsuites_get_with_http_info(self, id, content_type, accept, **kwargs): # noq _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def gsuites_patch(self, id, content_type, accept, **kwargs): # noqa: E501 + def gsuites_list_import_jumpcloud_users(self, gsuite_id, **kwargs): # noqa: E501 + """Get a list of users in Jumpcloud format to import from a Google Workspace account. # noqa: E501 + + Lists available G Suite users for import, translated to the Jumpcloud user schema. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.gsuites_list_import_jumpcloud_users(gsuite_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str gsuite_id: (required) + :param int max_results: Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str order_by: Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str page_token: Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str query: Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. + :param str sort_order: Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :return: InlineResponse2001 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.gsuites_list_import_jumpcloud_users_with_http_info(gsuite_id, **kwargs) # noqa: E501 + else: + (data) = self.gsuites_list_import_jumpcloud_users_with_http_info(gsuite_id, **kwargs) # noqa: E501 + return data + + def gsuites_list_import_jumpcloud_users_with_http_info(self, gsuite_id, **kwargs): # noqa: E501 + """Get a list of users in Jumpcloud format to import from a Google Workspace account. # noqa: E501 + + Lists available G Suite users for import, translated to the Jumpcloud user schema. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.gsuites_list_import_jumpcloud_users_with_http_info(gsuite_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str gsuite_id: (required) + :param int max_results: Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str order_by: Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str page_token: Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str query: Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. + :param str sort_order: Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :return: InlineResponse2001 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['gsuite_id', 'max_results', 'order_by', 'page_token', 'query', 'sort_order'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method gsuites_list_import_jumpcloud_users" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'gsuite_id' is set + if ('gsuite_id' not in params or + params['gsuite_id'] is None): + raise ValueError("Missing the required parameter `gsuite_id` when calling `gsuites_list_import_jumpcloud_users`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'gsuite_id' in params: + path_params['gsuite_id'] = params['gsuite_id'] # noqa: E501 + + query_params = [] + if 'max_results' in params: + query_params.append(('maxResults', params['max_results'])) # noqa: E501 + if 'order_by' in params: + query_params.append(('orderBy', params['order_by'])) # noqa: E501 + if 'page_token' in params: + query_params.append(('pageToken', params['page_token'])) # noqa: E501 + if 'query' in params: + query_params.append(('query', params['query'])) # noqa: E501 + if 'sort_order' in params: + query_params.append(('sortOrder', params['sort_order'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/gsuites/{gsuite_id}/import/jumpcloudusers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse2001', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def gsuites_list_import_users(self, gsuite_id, **kwargs): # noqa: E501 + """Get a list of users to import from a G Suite instance # noqa: E501 + + Lists G Suite users available for import. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.gsuites_list_import_users(gsuite_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str gsuite_id: (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int max_results: Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str order_by: Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str page_token: Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str query: Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. + :param str sort_order: Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :return: InlineResponse2002 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.gsuites_list_import_users_with_http_info(gsuite_id, **kwargs) # noqa: E501 + else: + (data) = self.gsuites_list_import_users_with_http_info(gsuite_id, **kwargs) # noqa: E501 + return data + + def gsuites_list_import_users_with_http_info(self, gsuite_id, **kwargs): # noqa: E501 + """Get a list of users to import from a G Suite instance # noqa: E501 + + Lists G Suite users available for import. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.gsuites_list_import_users_with_http_info(gsuite_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str gsuite_id: (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int max_results: Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str order_by: Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str page_token: Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str query: Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. + :param str sort_order: Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :return: InlineResponse2002 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['gsuite_id', 'limit', 'max_results', 'order_by', 'page_token', 'query', 'sort_order'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method gsuites_list_import_users" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'gsuite_id' is set + if ('gsuite_id' not in params or + params['gsuite_id'] is None): + raise ValueError("Missing the required parameter `gsuite_id` when calling `gsuites_list_import_users`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'gsuite_id' in params: + path_params['gsuite_id'] = params['gsuite_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'max_results' in params: + query_params.append(('maxResults', params['max_results'])) # noqa: E501 + if 'order_by' in params: + query_params.append(('orderBy', params['order_by'])) # noqa: E501 + if 'page_token' in params: + query_params.append(('pageToken', params['page_token'])) # noqa: E501 + if 'query' in params: + query_params.append(('query', params['query'])) # noqa: E501 + if 'sort_order' in params: + query_params.append(('sortOrder', params['sort_order'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/gsuites/{gsuite_id}/import/users', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse2002', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def gsuites_patch(self, id, **kwargs): # noqa: E501 """Update existing G Suite # noqa: E501 - This endpoint allows updating some attributes of a G Suite. ##### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"remove\", \"userPasswordExpirationAction\": \"disable\" }' ``` # noqa: E501 + This endpoint allows updating some attributes of a G Suite. ##### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"suspend\", \"userPasswordExpirationAction\": \"maintain\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.gsuites_patch(id, content_type, accept, async_req=True) + >>> thread = api.gsuites_patch(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: Unique identifier of the GSuite. (required) - :param str content_type: (required) - :param str accept: (required) :param GsuitePatchInput body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: GsuiteOutput If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.gsuites_patch_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.gsuites_patch_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.gsuites_patch_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.gsuites_patch_with_http_info(id, **kwargs) # noqa: E501 return data - def gsuites_patch_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def gsuites_patch_with_http_info(self, id, **kwargs): # noqa: E501 """Update existing G Suite # noqa: E501 - This endpoint allows updating some attributes of a G Suite. ##### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"remove\", \"userPasswordExpirationAction\": \"disable\" }' ``` # noqa: E501 + This endpoint allows updating some attributes of a G Suite. ##### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"suspend\", \"userPasswordExpirationAction\": \"maintain\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.gsuites_patch_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.gsuites_patch_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: Unique identifier of the GSuite. (required) - :param str content_type: (required) - :param str accept: (required) :param GsuitePatchInput body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: GsuiteOutput If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -730,14 +869,6 @@ def gsuites_patch_with_http_info(self, id, content_type, accept, **kwargs): # n if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `gsuites_patch`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `gsuites_patch`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `gsuites_patch`") # noqa: E501 collection_formats = {} @@ -750,10 +881,6 @@ def gsuites_patch_with_http_info(self, id, content_type, accept, **kwargs): # n header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -788,51 +915,47 @@ def gsuites_patch_with_http_info(self, id, content_type, accept, **kwargs): # n _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def translation_rules_g_suite_delete(self, gsuite_id, id, content_type, accept, **kwargs): # noqa: E501 + def translation_rules_g_suite_delete(self, gsuite_id, id, **kwargs): # noqa: E501 """Deletes a G Suite translation rule # noqa: E501 This endpoint allows you to delete a translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.translation_rules_g_suite_delete(gsuite_id, id, content_type, accept, async_req=True) + >>> thread = api.translation_rules_g_suite_delete(gsuite_id, id, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: (required) :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.translation_rules_g_suite_delete_with_http_info(gsuite_id, id, content_type, accept, **kwargs) # noqa: E501 + return self.translation_rules_g_suite_delete_with_http_info(gsuite_id, id, **kwargs) # noqa: E501 else: - (data) = self.translation_rules_g_suite_delete_with_http_info(gsuite_id, id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.translation_rules_g_suite_delete_with_http_info(gsuite_id, id, **kwargs) # noqa: E501 return data - def translation_rules_g_suite_delete_with_http_info(self, gsuite_id, id, content_type, accept, **kwargs): # noqa: E501 + def translation_rules_g_suite_delete_with_http_info(self, gsuite_id, id, **kwargs): # noqa: E501 """Deletes a G Suite translation rule # noqa: E501 This endpoint allows you to delete a translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.translation_rules_g_suite_delete_with_http_info(gsuite_id, id, content_type, accept, async_req=True) + >>> thread = api.translation_rules_g_suite_delete_with_http_info(gsuite_id, id, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: (required) :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['gsuite_id', 'id', 'content_type', 'accept'] # noqa: E501 + all_params = ['gsuite_id', 'id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -855,14 +978,6 @@ def translation_rules_g_suite_delete_with_http_info(self, gsuite_id, id, content if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `translation_rules_g_suite_delete`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `translation_rules_g_suite_delete`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `translation_rules_g_suite_delete`") # noqa: E501 collection_formats = {} @@ -875,23 +990,11 @@ def translation_rules_g_suite_delete_with_http_info(self, gsuite_id, id, content query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -911,51 +1014,47 @@ def translation_rules_g_suite_delete_with_http_info(self, gsuite_id, id, content _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def translation_rules_g_suite_get(self, gsuite_id, id, content_type, accept, **kwargs): # noqa: E501 + def translation_rules_g_suite_get(self, gsuite_id, id, **kwargs): # noqa: E501 """Gets a specific G Suite translation rule # noqa: E501 This endpoint returns a specific translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.translation_rules_g_suite_get(gsuite_id, id, content_type, accept, async_req=True) + >>> thread = api.translation_rules_g_suite_get(gsuite_id, id, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: (required) :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :return: GSuiteTranslationRule If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.translation_rules_g_suite_get_with_http_info(gsuite_id, id, content_type, accept, **kwargs) # noqa: E501 + return self.translation_rules_g_suite_get_with_http_info(gsuite_id, id, **kwargs) # noqa: E501 else: - (data) = self.translation_rules_g_suite_get_with_http_info(gsuite_id, id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.translation_rules_g_suite_get_with_http_info(gsuite_id, id, **kwargs) # noqa: E501 return data - def translation_rules_g_suite_get_with_http_info(self, gsuite_id, id, content_type, accept, **kwargs): # noqa: E501 + def translation_rules_g_suite_get_with_http_info(self, gsuite_id, id, **kwargs): # noqa: E501 """Gets a specific G Suite translation rule # noqa: E501 This endpoint returns a specific translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.translation_rules_g_suite_get_with_http_info(gsuite_id, id, content_type, accept, async_req=True) + >>> thread = api.translation_rules_g_suite_get_with_http_info(gsuite_id, id, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: (required) :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :return: GSuiteTranslationRule If the method is called asynchronously, returns the request thread. """ - all_params = ['gsuite_id', 'id', 'content_type', 'accept'] # noqa: E501 + all_params = ['gsuite_id', 'id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -978,14 +1077,6 @@ def translation_rules_g_suite_get_with_http_info(self, gsuite_id, id, content_ty if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `translation_rules_g_suite_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `translation_rules_g_suite_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `translation_rules_g_suite_get`") # noqa: E501 collection_formats = {} @@ -998,10 +1089,6 @@ def translation_rules_g_suite_get_with_http_info(self, gsuite_id, id, content_ty query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1011,10 +1098,6 @@ def translation_rules_g_suite_get_with_http_info(self, gsuite_id, id, content_ty header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1034,21 +1117,19 @@ def translation_rules_g_suite_get_with_http_info(self, gsuite_id, id, content_ty _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def translation_rules_g_suite_list(self, gsuite_id, content_type, accept, **kwargs): # noqa: E501 + def translation_rules_g_suite_list(self, gsuite_id, **kwargs): # noqa: E501 """List all the G Suite Translation Rules # noqa: E501 This endpoint returns all graph translation rules for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.translation_rules_g_suite_list(gsuite_id, content_type, accept, async_req=True) + >>> thread = api.translation_rules_g_suite_list(gsuite_id, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: (required) - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. @@ -1058,26 +1139,24 @@ def translation_rules_g_suite_list(self, gsuite_id, content_type, accept, **kwar """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.translation_rules_g_suite_list_with_http_info(gsuite_id, content_type, accept, **kwargs) # noqa: E501 + return self.translation_rules_g_suite_list_with_http_info(gsuite_id, **kwargs) # noqa: E501 else: - (data) = self.translation_rules_g_suite_list_with_http_info(gsuite_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.translation_rules_g_suite_list_with_http_info(gsuite_id, **kwargs) # noqa: E501 return data - def translation_rules_g_suite_list_with_http_info(self, gsuite_id, content_type, accept, **kwargs): # noqa: E501 + def translation_rules_g_suite_list_with_http_info(self, gsuite_id, **kwargs): # noqa: E501 """List all the G Suite Translation Rules # noqa: E501 This endpoint returns all graph translation rules for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.translation_rules_g_suite_list_with_http_info(gsuite_id, content_type, accept, async_req=True) + >>> thread = api.translation_rules_g_suite_list_with_http_info(gsuite_id, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: (required) - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. @@ -1086,7 +1165,7 @@ def translation_rules_g_suite_list_with_http_info(self, gsuite_id, content_type, returns the request thread. """ - all_params = ['gsuite_id', 'content_type', 'accept', 'fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params = ['gsuite_id', 'fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1105,17 +1184,7 @@ def translation_rules_g_suite_list_with_http_info(self, gsuite_id, content_type, if ('gsuite_id' not in params or params['gsuite_id'] is None): raise ValueError("Missing the required parameter `gsuite_id` when calling `translation_rules_g_suite_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `translation_rules_g_suite_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `translation_rules_g_suite_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `translation_rules_g_suite_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1138,10 +1207,6 @@ def translation_rules_g_suite_list_with_http_info(self, gsuite_id, content_type, collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1151,10 +1216,6 @@ def translation_rules_g_suite_list_with_http_info(self, gsuite_id, content_type, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1174,19 +1235,17 @@ def translation_rules_g_suite_list_with_http_info(self, gsuite_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def translation_rules_g_suite_post(self, gsuite_id, content_type, accept, **kwargs): # noqa: E501 + def translation_rules_g_suite_post(self, gsuite_id, **kwargs): # noqa: E501 """Create a new G Suite Translation Rule # noqa: E501 - This endpoint allows you to create a translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` # noqa: E501 + This endpoint allows you to create a translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.translation_rules_g_suite_post(gsuite_id, content_type, accept, async_req=True) + >>> thread = api.translation_rules_g_suite_post(gsuite_id, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: (required) - :param str content_type: (required) - :param str accept: (required) :param GSuiteTranslationRuleRequest body: :return: GSuiteTranslationRule If the method is called asynchronously, @@ -1194,31 +1253,29 @@ def translation_rules_g_suite_post(self, gsuite_id, content_type, accept, **kwar """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.translation_rules_g_suite_post_with_http_info(gsuite_id, content_type, accept, **kwargs) # noqa: E501 + return self.translation_rules_g_suite_post_with_http_info(gsuite_id, **kwargs) # noqa: E501 else: - (data) = self.translation_rules_g_suite_post_with_http_info(gsuite_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.translation_rules_g_suite_post_with_http_info(gsuite_id, **kwargs) # noqa: E501 return data - def translation_rules_g_suite_post_with_http_info(self, gsuite_id, content_type, accept, **kwargs): # noqa: E501 + def translation_rules_g_suite_post_with_http_info(self, gsuite_id, **kwargs): # noqa: E501 """Create a new G Suite Translation Rule # noqa: E501 - This endpoint allows you to create a translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` # noqa: E501 + This endpoint allows you to create a translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.translation_rules_g_suite_post_with_http_info(gsuite_id, content_type, accept, async_req=True) + >>> thread = api.translation_rules_g_suite_post_with_http_info(gsuite_id, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: (required) - :param str content_type: (required) - :param str accept: (required) :param GSuiteTranslationRuleRequest body: :return: GSuiteTranslationRule If the method is called asynchronously, returns the request thread. """ - all_params = ['gsuite_id', 'content_type', 'accept', 'body'] # noqa: E501 + all_params = ['gsuite_id', 'body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1237,14 +1294,6 @@ def translation_rules_g_suite_post_with_http_info(self, gsuite_id, content_type, if ('gsuite_id' not in params or params['gsuite_id'] is None): raise ValueError("Missing the required parameter `gsuite_id` when calling `translation_rules_g_suite_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `translation_rules_g_suite_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `translation_rules_g_suite_post`") # noqa: E501 collection_formats = {} @@ -1255,10 +1304,6 @@ def translation_rules_g_suite_post_with_http_info(self, gsuite_id, content_type, query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} diff --git a/jcapiv2/jcapiv2/api/g_suite_import_api.py b/jcapiv2/jcapiv2/api/g_suite_import_api.py new file mode 100644 index 0000000..5269cb1 --- /dev/null +++ b/jcapiv2/jcapiv2/api/g_suite_import_api.py @@ -0,0 +1,267 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv2.api_client import ApiClient + + +class GSuiteImportApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def gsuites_list_import_jumpcloud_users(self, gsuite_id, **kwargs): # noqa: E501 + """Get a list of users in Jumpcloud format to import from a Google Workspace account. # noqa: E501 + + Lists available G Suite users for import, translated to the Jumpcloud user schema. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.gsuites_list_import_jumpcloud_users(gsuite_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str gsuite_id: (required) + :param int max_results: Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str order_by: Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str page_token: Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str query: Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. + :param str sort_order: Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :return: InlineResponse2001 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.gsuites_list_import_jumpcloud_users_with_http_info(gsuite_id, **kwargs) # noqa: E501 + else: + (data) = self.gsuites_list_import_jumpcloud_users_with_http_info(gsuite_id, **kwargs) # noqa: E501 + return data + + def gsuites_list_import_jumpcloud_users_with_http_info(self, gsuite_id, **kwargs): # noqa: E501 + """Get a list of users in Jumpcloud format to import from a Google Workspace account. # noqa: E501 + + Lists available G Suite users for import, translated to the Jumpcloud user schema. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.gsuites_list_import_jumpcloud_users_with_http_info(gsuite_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str gsuite_id: (required) + :param int max_results: Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str order_by: Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str page_token: Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str query: Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. + :param str sort_order: Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :return: InlineResponse2001 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['gsuite_id', 'max_results', 'order_by', 'page_token', 'query', 'sort_order'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method gsuites_list_import_jumpcloud_users" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'gsuite_id' is set + if ('gsuite_id' not in params or + params['gsuite_id'] is None): + raise ValueError("Missing the required parameter `gsuite_id` when calling `gsuites_list_import_jumpcloud_users`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'gsuite_id' in params: + path_params['gsuite_id'] = params['gsuite_id'] # noqa: E501 + + query_params = [] + if 'max_results' in params: + query_params.append(('maxResults', params['max_results'])) # noqa: E501 + if 'order_by' in params: + query_params.append(('orderBy', params['order_by'])) # noqa: E501 + if 'page_token' in params: + query_params.append(('pageToken', params['page_token'])) # noqa: E501 + if 'query' in params: + query_params.append(('query', params['query'])) # noqa: E501 + if 'sort_order' in params: + query_params.append(('sortOrder', params['sort_order'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/gsuites/{gsuite_id}/import/jumpcloudusers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse2001', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def gsuites_list_import_users(self, gsuite_id, **kwargs): # noqa: E501 + """Get a list of users to import from a G Suite instance # noqa: E501 + + Lists G Suite users available for import. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.gsuites_list_import_users(gsuite_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str gsuite_id: (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int max_results: Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str order_by: Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str page_token: Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str query: Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. + :param str sort_order: Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :return: InlineResponse2002 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.gsuites_list_import_users_with_http_info(gsuite_id, **kwargs) # noqa: E501 + else: + (data) = self.gsuites_list_import_users_with_http_info(gsuite_id, **kwargs) # noqa: E501 + return data + + def gsuites_list_import_users_with_http_info(self, gsuite_id, **kwargs): # noqa: E501 + """Get a list of users to import from a G Suite instance # noqa: E501 + + Lists G Suite users available for import. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.gsuites_list_import_users_with_http_info(gsuite_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str gsuite_id: (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int max_results: Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str order_by: Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str page_token: Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :param str query: Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. + :param str sort_order: Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + :return: InlineResponse2002 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['gsuite_id', 'limit', 'max_results', 'order_by', 'page_token', 'query', 'sort_order'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method gsuites_list_import_users" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'gsuite_id' is set + if ('gsuite_id' not in params or + params['gsuite_id'] is None): + raise ValueError("Missing the required parameter `gsuite_id` when calling `gsuites_list_import_users`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'gsuite_id' in params: + path_params['gsuite_id'] = params['gsuite_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'max_results' in params: + query_params.append(('maxResults', params['max_results'])) # noqa: E501 + if 'order_by' in params: + query_params.append(('orderBy', params['order_by'])) # noqa: E501 + if 'page_token' in params: + query_params.append(('pageToken', params['page_token'])) # noqa: E501 + if 'query' in params: + query_params.append(('query', params['query'])) # noqa: E501 + if 'sort_order' in params: + query_params.append(('sortOrder', params['sort_order'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/gsuites/{gsuite_id}/import/users', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse2002', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/graph_api.py b/jcapiv2/jcapiv2/api/graph_api.py index d1f23bb..d9a7c02 100644 --- a/jcapiv2/jcapiv2/api/graph_api.py +++ b/jcapiv2/jcapiv2/api/graph_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,57 +32,53 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def graph_active_directory_associations_list(self, activedirectory_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_active_directory_associations_list(self, activedirectory_id, targets, **kwargs): # noqa: E501 """List the associations of an Active Directory instance # noqa: E501 This endpoint returns the direct associations of this Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/associations?targets=user \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_active_directory_associations_list(activedirectory_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_active_directory_associations_list(activedirectory_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"active_directory\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_active_directory_associations_list_with_http_info(activedirectory_id, targets, content_type, accept, **kwargs) # noqa: E501 + return self.graph_active_directory_associations_list_with_http_info(activedirectory_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_active_directory_associations_list_with_http_info(activedirectory_id, targets, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_active_directory_associations_list_with_http_info(activedirectory_id, targets, **kwargs) # noqa: E501 return data - def graph_active_directory_associations_list_with_http_info(self, activedirectory_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_active_directory_associations_list_with_http_info(self, activedirectory_id, targets, **kwargs): # noqa: E501 """List the associations of an Active Directory instance # noqa: E501 This endpoint returns the direct associations of this Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/associations?targets=user \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_active_directory_associations_list_with_http_info(activedirectory_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_active_directory_associations_list_with_http_info(activedirectory_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"active_directory\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['activedirectory_id', 'targets', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['activedirectory_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -106,17 +101,7 @@ def graph_active_directory_associations_list_with_http_info(self, activedirector if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_active_directory_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_active_directory_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_active_directory_associations_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_active_directory_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -133,10 +118,6 @@ def graph_active_directory_associations_list_with_http_info(self, activedirector query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -148,10 +129,6 @@ def graph_active_directory_associations_list_with_http_info(self, activedirector header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -171,53 +148,49 @@ def graph_active_directory_associations_list_with_http_info(self, activedirector _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_active_directory_associations_post(self, activedirectory_id, content_type, accept, **kwargs): # noqa: E501 + def graph_active_directory_associations_post(self, activedirectory_id, **kwargs): # noqa: E501 """Manage the associations of an Active Directory instance # noqa: E501 - This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" } ' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_active_directory_associations_post(activedirectory_id, content_type, accept, async_req=True) + >>> thread = api.graph_active_directory_associations_post(activedirectory_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationActiveDirectory body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_active_directory_associations_post_with_http_info(activedirectory_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_active_directory_associations_post_with_http_info(activedirectory_id, **kwargs) # noqa: E501 else: - (data) = self.graph_active_directory_associations_post_with_http_info(activedirectory_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_active_directory_associations_post_with_http_info(activedirectory_id, **kwargs) # noqa: E501 return data - def graph_active_directory_associations_post_with_http_info(self, activedirectory_id, content_type, accept, **kwargs): # noqa: E501 + def graph_active_directory_associations_post_with_http_info(self, activedirectory_id, **kwargs): # noqa: E501 """Manage the associations of an Active Directory instance # noqa: E501 - This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" } ' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_active_directory_associations_post_with_http_info(activedirectory_id, content_type, accept, async_req=True) + >>> thread = api.graph_active_directory_associations_post_with_http_info(activedirectory_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationActiveDirectory body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['activedirectory_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['activedirectory_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -236,14 +209,6 @@ def graph_active_directory_associations_post_with_http_info(self, activedirector if ('activedirectory_id' not in params or params['activedirectory_id'] is None): raise ValueError("Missing the required parameter `activedirectory_id` when calling `graph_active_directory_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_active_directory_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_active_directory_associations_post`") # noqa: E501 collection_formats = {} @@ -254,10 +219,6 @@ def graph_active_directory_associations_post_with_http_info(self, activedirector query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -267,10 +228,6 @@ def graph_active_directory_associations_post_with_http_info(self, activedirector body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -294,22 +251,20 @@ def graph_active_directory_associations_post_with_http_info(self, activedirector _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_active_directory_traverse_user(self, activedirectory_id, content_type, accept, **kwargs): # noqa: E501 + def graph_active_directory_traverse_user(self, activedirectory_id, **kwargs): # noqa: E501 """List the Users bound to an Active Directory instance # noqa: E501 This endpoint will return all Users bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_active_directory_traverse_user(activedirectory_id, content_type, accept, async_req=True) + >>> thread = api.graph_active_directory_traverse_user(activedirectory_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: ObjectID of the Active Directory instance. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. :return: list[GraphObjectWithPaths] If the method is called asynchronously, @@ -317,34 +272,32 @@ def graph_active_directory_traverse_user(self, activedirectory_id, content_type, """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_active_directory_traverse_user_with_http_info(activedirectory_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_active_directory_traverse_user_with_http_info(activedirectory_id, **kwargs) # noqa: E501 else: - (data) = self.graph_active_directory_traverse_user_with_http_info(activedirectory_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_active_directory_traverse_user_with_http_info(activedirectory_id, **kwargs) # noqa: E501 return data - def graph_active_directory_traverse_user_with_http_info(self, activedirectory_id, content_type, accept, **kwargs): # noqa: E501 + def graph_active_directory_traverse_user_with_http_info(self, activedirectory_id, **kwargs): # noqa: E501 """List the Users bound to an Active Directory instance # noqa: E501 This endpoint will return all Users bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_active_directory_traverse_user_with_http_info(activedirectory_id, content_type, accept, async_req=True) + >>> thread = api.graph_active_directory_traverse_user_with_http_info(activedirectory_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: ObjectID of the Active Directory instance. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['activedirectory_id', 'content_type', 'accept', 'filter', 'limit', 'x_org_id', 'skip'] # noqa: E501 + all_params = ['activedirectory_id', 'filter', 'limit', 'x_org_id', 'skip'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -363,17 +316,7 @@ def graph_active_directory_traverse_user_with_http_info(self, activedirectory_id if ('activedirectory_id' not in params or params['activedirectory_id'] is None): raise ValueError("Missing the required parameter `activedirectory_id` when calling `graph_active_directory_traverse_user`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_active_directory_traverse_user`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_active_directory_traverse_user`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_active_directory_traverse_user`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -392,10 +335,6 @@ def graph_active_directory_traverse_user_with_http_info(self, activedirectory_id header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -405,10 +344,6 @@ def graph_active_directory_traverse_user_with_http_info(self, activedirectory_id header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -428,57 +363,53 @@ def graph_active_directory_traverse_user_with_http_info(self, activedirectory_id _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_active_directory_traverse_user_group(self, activedirectory_id, content_type, accept, **kwargs): # noqa: E501 + def graph_active_directory_traverse_user_group(self, activedirectory_id, **kwargs): # noqa: E501 """List the User Groups bound to an Active Directory instance # noqa: E501 This endpoint will return all Users Groups bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_active_directory_traverse_user_group(activedirectory_id, content_type, accept, async_req=True) + >>> thread = api.graph_active_directory_traverse_user_group(activedirectory_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: ObjectID of the Active Directory instance. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_active_directory_traverse_user_group_with_http_info(activedirectory_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_active_directory_traverse_user_group_with_http_info(activedirectory_id, **kwargs) # noqa: E501 else: - (data) = self.graph_active_directory_traverse_user_group_with_http_info(activedirectory_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_active_directory_traverse_user_group_with_http_info(activedirectory_id, **kwargs) # noqa: E501 return data - def graph_active_directory_traverse_user_group_with_http_info(self, activedirectory_id, content_type, accept, **kwargs): # noqa: E501 + def graph_active_directory_traverse_user_group_with_http_info(self, activedirectory_id, **kwargs): # noqa: E501 """List the User Groups bound to an Active Directory instance # noqa: E501 This endpoint will return all Users Groups bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_active_directory_traverse_user_group_with_http_info(activedirectory_id, content_type, accept, async_req=True) + >>> thread = api.graph_active_directory_traverse_user_group_with_http_info(activedirectory_id, async_req=True) >>> result = thread.get() :param async_req bool :param str activedirectory_id: ObjectID of the Active Directory instance. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['activedirectory_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['activedirectory_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -497,17 +428,7 @@ def graph_active_directory_traverse_user_group_with_http_info(self, activedirect if ('activedirectory_id' not in params or params['activedirectory_id'] is None): raise ValueError("Missing the required parameter `activedirectory_id` when calling `graph_active_directory_traverse_user_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_active_directory_traverse_user_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_active_directory_traverse_user_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_active_directory_traverse_user_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -526,10 +447,6 @@ def graph_active_directory_traverse_user_group_with_http_info(self, activedirect header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -539,10 +456,6 @@ def graph_active_directory_traverse_user_group_with_http_info(self, activedirect header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -562,57 +475,53 @@ def graph_active_directory_traverse_user_group_with_http_info(self, activedirect _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_application_associations_list(self, application_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_application_associations_list(self, application_id, targets, **kwargs): # noqa: E501 """List the associations of an Application # noqa: E501 This endpoint will return the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Applications and User Groups. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_application_associations_list(application_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_application_associations_list(application_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str application_id: ObjectID of the Application. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"application\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_application_associations_list_with_http_info(application_id, targets, content_type, accept, **kwargs) # noqa: E501 + return self.graph_application_associations_list_with_http_info(application_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_application_associations_list_with_http_info(application_id, targets, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_application_associations_list_with_http_info(application_id, targets, **kwargs) # noqa: E501 return data - def graph_application_associations_list_with_http_info(self, application_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_application_associations_list_with_http_info(self, application_id, targets, **kwargs): # noqa: E501 """List the associations of an Application # noqa: E501 This endpoint will return the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Applications and User Groups. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_application_associations_list_with_http_info(application_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_application_associations_list_with_http_info(application_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str application_id: ObjectID of the Application. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"application\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['application_id', 'targets', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['application_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -635,17 +544,7 @@ def graph_application_associations_list_with_http_info(self, application_id, tar if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_application_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_application_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_application_associations_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_application_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -662,10 +561,6 @@ def graph_application_associations_list_with_http_info(self, application_id, tar query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -677,10 +572,6 @@ def graph_application_associations_list_with_http_info(self, application_id, tar header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -700,53 +591,49 @@ def graph_application_associations_list_with_http_info(self, application_id, tar _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_application_associations_post(self, application_id, content_type, accept, **kwargs): # noqa: E501 + def graph_application_associations_post(self, application_id, **kwargs): # noqa: E501 """Manage the associations of an Application # noqa: E501 - This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_application_associations_post(application_id, content_type, accept, async_req=True) + >>> thread = api.graph_application_associations_post(application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str application_id: ObjectID of the Application. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationApplication body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_application_associations_post_with_http_info(application_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_application_associations_post_with_http_info(application_id, **kwargs) # noqa: E501 else: - (data) = self.graph_application_associations_post_with_http_info(application_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_application_associations_post_with_http_info(application_id, **kwargs) # noqa: E501 return data - def graph_application_associations_post_with_http_info(self, application_id, content_type, accept, **kwargs): # noqa: E501 + def graph_application_associations_post_with_http_info(self, application_id, **kwargs): # noqa: E501 """Manage the associations of an Application # noqa: E501 - This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_application_associations_post_with_http_info(application_id, content_type, accept, async_req=True) + >>> thread = api.graph_application_associations_post_with_http_info(application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str application_id: ObjectID of the Application. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationApplication body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['application_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['application_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -765,14 +652,6 @@ def graph_application_associations_post_with_http_info(self, application_id, con if ('application_id' not in params or params['application_id'] is None): raise ValueError("Missing the required parameter `application_id` when calling `graph_application_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_application_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_application_associations_post`") # noqa: E501 collection_formats = {} @@ -783,10 +662,6 @@ def graph_application_associations_post_with_http_info(self, application_id, con query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -796,10 +671,6 @@ def graph_application_associations_post_with_http_info(self, application_id, con body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -823,57 +694,53 @@ def graph_application_associations_post_with_http_info(self, application_id, con _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_application_traverse_user(self, application_id, content_type, accept, **kwargs): # noqa: E501 + def graph_application_traverse_user(self, application_id, **kwargs): # noqa: E501 """List the Users bound to an Application # noqa: E501 This endpoint will return all Users bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_application_traverse_user(application_id, content_type, accept, async_req=True) + >>> thread = api.graph_application_traverse_user(application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str application_id: ObjectID of the Application. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_application_traverse_user_with_http_info(application_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_application_traverse_user_with_http_info(application_id, **kwargs) # noqa: E501 else: - (data) = self.graph_application_traverse_user_with_http_info(application_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_application_traverse_user_with_http_info(application_id, **kwargs) # noqa: E501 return data - def graph_application_traverse_user_with_http_info(self, application_id, content_type, accept, **kwargs): # noqa: E501 + def graph_application_traverse_user_with_http_info(self, application_id, **kwargs): # noqa: E501 """List the Users bound to an Application # noqa: E501 This endpoint will return all Users bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_application_traverse_user_with_http_info(application_id, content_type, accept, async_req=True) + >>> thread = api.graph_application_traverse_user_with_http_info(application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str application_id: ObjectID of the Application. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['application_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['application_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -892,17 +759,7 @@ def graph_application_traverse_user_with_http_info(self, application_id, content if ('application_id' not in params or params['application_id'] is None): raise ValueError("Missing the required parameter `application_id` when calling `graph_application_traverse_user`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_application_traverse_user`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_application_traverse_user`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_application_traverse_user`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -921,10 +778,6 @@ def graph_application_traverse_user_with_http_info(self, application_id, content header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -934,10 +787,6 @@ def graph_application_traverse_user_with_http_info(self, application_id, content header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -957,57 +806,53 @@ def graph_application_traverse_user_with_http_info(self, application_id, content _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_application_traverse_user_group(self, application_id, content_type, accept, **kwargs): # noqa: E501 + def graph_application_traverse_user_group(self, application_id, **kwargs): # noqa: E501 """List the User Groups bound to an Application # noqa: E501 This endpoint will return all Users Groups bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_application_traverse_user_group(application_id, content_type, accept, async_req=True) + >>> thread = api.graph_application_traverse_user_group(application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str application_id: ObjectID of the Application. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_application_traverse_user_group_with_http_info(application_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_application_traverse_user_group_with_http_info(application_id, **kwargs) # noqa: E501 else: - (data) = self.graph_application_traverse_user_group_with_http_info(application_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_application_traverse_user_group_with_http_info(application_id, **kwargs) # noqa: E501 return data - def graph_application_traverse_user_group_with_http_info(self, application_id, content_type, accept, **kwargs): # noqa: E501 + def graph_application_traverse_user_group_with_http_info(self, application_id, **kwargs): # noqa: E501 """List the User Groups bound to an Application # noqa: E501 This endpoint will return all Users Groups bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_application_traverse_user_group_with_http_info(application_id, content_type, accept, async_req=True) + >>> thread = api.graph_application_traverse_user_group_with_http_info(application_id, async_req=True) >>> result = thread.get() :param async_req bool :param str application_id: ObjectID of the Application. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['application_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['application_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1026,17 +871,7 @@ def graph_application_traverse_user_group_with_http_info(self, application_id, c if ('application_id' not in params or params['application_id'] is None): raise ValueError("Missing the required parameter `application_id` when calling `graph_application_traverse_user_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_application_traverse_user_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_application_traverse_user_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_application_traverse_user_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1055,10 +890,6 @@ def graph_application_traverse_user_group_with_http_info(self, application_id, c header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1068,10 +899,6 @@ def graph_application_traverse_user_group_with_http_info(self, application_id, c header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1091,57 +918,53 @@ def graph_application_traverse_user_group_with_http_info(self, application_id, c _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_command_associations_list(self, command_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_command_associations_list(self, command_id, targets, **kwargs): # noqa: E501 """List the associations of a Command # noqa: E501 This endpoint will return the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_command_associations_list(command_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_command_associations_list(command_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str command_id: ObjectID of the Command. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"command\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_command_associations_list_with_http_info(command_id, targets, content_type, accept, **kwargs) # noqa: E501 + return self.graph_command_associations_list_with_http_info(command_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_command_associations_list_with_http_info(command_id, targets, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_command_associations_list_with_http_info(command_id, targets, **kwargs) # noqa: E501 return data - def graph_command_associations_list_with_http_info(self, command_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_command_associations_list_with_http_info(self, command_id, targets, **kwargs): # noqa: E501 """List the associations of a Command # noqa: E501 This endpoint will return the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_command_associations_list_with_http_info(command_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_command_associations_list_with_http_info(command_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str command_id: ObjectID of the Command. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"command\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['command_id', 'targets', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['command_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1164,17 +987,7 @@ def graph_command_associations_list_with_http_info(self, command_id, targets, co if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_command_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_command_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_command_associations_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_command_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1191,10 +1004,6 @@ def graph_command_associations_list_with_http_info(self, command_id, targets, co query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1206,10 +1015,6 @@ def graph_command_associations_list_with_http_info(self, command_id, targets, co header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1229,53 +1034,49 @@ def graph_command_associations_list_with_http_info(self, command_id, targets, co _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_command_associations_post(self, command_id, content_type, accept, **kwargs): # noqa: E501 + def graph_command_associations_post(self, command_id, **kwargs): # noqa: E501 """Manage the associations of a Command # noqa: E501 - This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` # noqa: E501 + This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_command_associations_post(command_id, content_type, accept, async_req=True) + >>> thread = api.graph_command_associations_post(command_id, async_req=True) >>> result = thread.get() :param async_req bool :param str command_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationCommand body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_command_associations_post_with_http_info(command_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_command_associations_post_with_http_info(command_id, **kwargs) # noqa: E501 else: - (data) = self.graph_command_associations_post_with_http_info(command_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_command_associations_post_with_http_info(command_id, **kwargs) # noqa: E501 return data - def graph_command_associations_post_with_http_info(self, command_id, content_type, accept, **kwargs): # noqa: E501 + def graph_command_associations_post_with_http_info(self, command_id, **kwargs): # noqa: E501 """Manage the associations of a Command # noqa: E501 - This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` # noqa: E501 + This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_command_associations_post_with_http_info(command_id, content_type, accept, async_req=True) + >>> thread = api.graph_command_associations_post_with_http_info(command_id, async_req=True) >>> result = thread.get() :param async_req bool :param str command_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationCommand body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['command_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['command_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1294,14 +1095,6 @@ def graph_command_associations_post_with_http_info(self, command_id, content_typ if ('command_id' not in params or params['command_id'] is None): raise ValueError("Missing the required parameter `command_id` when calling `graph_command_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_command_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_command_associations_post`") # noqa: E501 collection_formats = {} @@ -1312,10 +1105,6 @@ def graph_command_associations_post_with_http_info(self, command_id, content_typ query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1325,10 +1114,6 @@ def graph_command_associations_post_with_http_info(self, command_id, content_typ body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -1352,57 +1137,53 @@ def graph_command_associations_post_with_http_info(self, command_id, content_typ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_command_traverse_system(self, command_id, content_type, accept, **kwargs): # noqa: E501 + def graph_command_traverse_system(self, command_id, **kwargs): # noqa: E501 """List the Systems bound to a Command # noqa: E501 This endpoint will return all Systems bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systems \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_command_traverse_system(command_id, content_type, accept, async_req=True) + >>> thread = api.graph_command_traverse_system(command_id, async_req=True) >>> result = thread.get() :param async_req bool :param str command_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_command_traverse_system_with_http_info(command_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_command_traverse_system_with_http_info(command_id, **kwargs) # noqa: E501 else: - (data) = self.graph_command_traverse_system_with_http_info(command_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_command_traverse_system_with_http_info(command_id, **kwargs) # noqa: E501 return data - def graph_command_traverse_system_with_http_info(self, command_id, content_type, accept, **kwargs): # noqa: E501 + def graph_command_traverse_system_with_http_info(self, command_id, **kwargs): # noqa: E501 """List the Systems bound to a Command # noqa: E501 This endpoint will return all Systems bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systems \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_command_traverse_system_with_http_info(command_id, content_type, accept, async_req=True) + >>> thread = api.graph_command_traverse_system_with_http_info(command_id, async_req=True) >>> result = thread.get() :param async_req bool :param str command_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['command_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['command_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1421,17 +1202,7 @@ def graph_command_traverse_system_with_http_info(self, command_id, content_type, if ('command_id' not in params or params['command_id'] is None): raise ValueError("Missing the required parameter `command_id` when calling `graph_command_traverse_system`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_command_traverse_system`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_command_traverse_system`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_command_traverse_system`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1450,10 +1221,6 @@ def graph_command_traverse_system_with_http_info(self, command_id, content_type, header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1463,10 +1230,6 @@ def graph_command_traverse_system_with_http_info(self, command_id, content_type, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1486,57 +1249,53 @@ def graph_command_traverse_system_with_http_info(self, command_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_command_traverse_system_group(self, command_id, content_type, accept, **kwargs): # noqa: E501 + def graph_command_traverse_system_group(self, command_id, **kwargs): # noqa: E501 """List the System Groups bound to a Command # noqa: E501 This endpoint will return all System Groups bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systemgroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_command_traverse_system_group(command_id, content_type, accept, async_req=True) + >>> thread = api.graph_command_traverse_system_group(command_id, async_req=True) >>> result = thread.get() :param async_req bool :param str command_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_command_traverse_system_group_with_http_info(command_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_command_traverse_system_group_with_http_info(command_id, **kwargs) # noqa: E501 else: - (data) = self.graph_command_traverse_system_group_with_http_info(command_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_command_traverse_system_group_with_http_info(command_id, **kwargs) # noqa: E501 return data - def graph_command_traverse_system_group_with_http_info(self, command_id, content_type, accept, **kwargs): # noqa: E501 + def graph_command_traverse_system_group_with_http_info(self, command_id, **kwargs): # noqa: E501 """List the System Groups bound to a Command # noqa: E501 This endpoint will return all System Groups bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systemgroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_command_traverse_system_group_with_http_info(command_id, content_type, accept, async_req=True) + >>> thread = api.graph_command_traverse_system_group_with_http_info(command_id, async_req=True) >>> result = thread.get() :param async_req bool :param str command_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['command_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['command_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1555,17 +1314,7 @@ def graph_command_traverse_system_group_with_http_info(self, command_id, content if ('command_id' not in params or params['command_id'] is None): raise ValueError("Missing the required parameter `command_id` when calling `graph_command_traverse_system_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_command_traverse_system_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_command_traverse_system_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_command_traverse_system_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1584,10 +1333,6 @@ def graph_command_traverse_system_group_with_http_info(self, command_id, content header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1597,10 +1342,6 @@ def graph_command_traverse_system_group_with_http_info(self, command_id, content header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1620,57 +1361,53 @@ def graph_command_traverse_system_group_with_http_info(self, command_id, content _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_g_suite_associations_list(self, gsuite_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_g_suite_associations_list(self, gsuite_id, targets, **kwargs): # noqa: E501 """List the associations of a G Suite instance # noqa: E501 This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_g_suite_associations_list(gsuite_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_g_suite_associations_list(gsuite_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: ObjectID of the G Suite instance. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"g_suite\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_g_suite_associations_list_with_http_info(gsuite_id, targets, content_type, accept, **kwargs) # noqa: E501 + return self.graph_g_suite_associations_list_with_http_info(gsuite_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_g_suite_associations_list_with_http_info(gsuite_id, targets, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_g_suite_associations_list_with_http_info(gsuite_id, targets, **kwargs) # noqa: E501 return data - def graph_g_suite_associations_list_with_http_info(self, gsuite_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_g_suite_associations_list_with_http_info(self, gsuite_id, targets, **kwargs): # noqa: E501 """List the associations of a G Suite instance # noqa: E501 This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_g_suite_associations_list_with_http_info(gsuite_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_g_suite_associations_list_with_http_info(gsuite_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: ObjectID of the G Suite instance. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"g_suite\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['gsuite_id', 'targets', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['gsuite_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1693,17 +1430,7 @@ def graph_g_suite_associations_list_with_http_info(self, gsuite_id, targets, con if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_g_suite_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_g_suite_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_g_suite_associations_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_g_suite_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1720,10 +1447,6 @@ def graph_g_suite_associations_list_with_http_info(self, gsuite_id, targets, con query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1735,10 +1458,6 @@ def graph_g_suite_associations_list_with_http_info(self, gsuite_id, targets, con header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1761,7 +1480,7 @@ def graph_g_suite_associations_list_with_http_info(self, gsuite_id, targets, con def graph_g_suite_associations_post(self, gsuite_id, **kwargs): # noqa: E501 """Manage the associations of a G Suite instance # noqa: E501 - This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 + This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.graph_g_suite_associations_post(gsuite_id, async_req=True) @@ -1769,8 +1488,8 @@ def graph_g_suite_associations_post(self, gsuite_id, **kwargs): # noqa: E501 :param async_req bool :param str gsuite_id: ObjectID of the G Suite instance. (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationGSuite body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. @@ -1785,7 +1504,7 @@ def graph_g_suite_associations_post(self, gsuite_id, **kwargs): # noqa: E501 def graph_g_suite_associations_post_with_http_info(self, gsuite_id, **kwargs): # noqa: E501 """Manage the associations of a G Suite instance # noqa: E501 - This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 + This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.graph_g_suite_associations_post_with_http_info(gsuite_id, async_req=True) @@ -1793,8 +1512,8 @@ def graph_g_suite_associations_post_with_http_info(self, gsuite_id, **kwargs): :param async_req bool :param str gsuite_id: ObjectID of the G Suite instance. (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationGSuite body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. @@ -1838,10 +1557,6 @@ def graph_g_suite_associations_post_with_http_info(self, gsuite_id, **kwargs): body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -1865,57 +1580,53 @@ def graph_g_suite_associations_post_with_http_info(self, gsuite_id, **kwargs): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_g_suite_traverse_user(self, gsuite_id, content_type, accept, **kwargs): # noqa: E501 + def graph_g_suite_traverse_user(self, gsuite_id, **kwargs): # noqa: E501 """List the Users bound to a G Suite instance # noqa: E501 This endpoint will return all Users bound to a G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_g_suite_traverse_user(gsuite_id, content_type, accept, async_req=True) + >>> thread = api.graph_g_suite_traverse_user(gsuite_id, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: ObjectID of the G Suite instance. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_g_suite_traverse_user_with_http_info(gsuite_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_g_suite_traverse_user_with_http_info(gsuite_id, **kwargs) # noqa: E501 else: - (data) = self.graph_g_suite_traverse_user_with_http_info(gsuite_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_g_suite_traverse_user_with_http_info(gsuite_id, **kwargs) # noqa: E501 return data - def graph_g_suite_traverse_user_with_http_info(self, gsuite_id, content_type, accept, **kwargs): # noqa: E501 + def graph_g_suite_traverse_user_with_http_info(self, gsuite_id, **kwargs): # noqa: E501 """List the Users bound to a G Suite instance # noqa: E501 This endpoint will return all Users bound to a G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_g_suite_traverse_user_with_http_info(gsuite_id, content_type, accept, async_req=True) + >>> thread = api.graph_g_suite_traverse_user_with_http_info(gsuite_id, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: ObjectID of the G Suite instance. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['gsuite_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['gsuite_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1934,17 +1645,7 @@ def graph_g_suite_traverse_user_with_http_info(self, gsuite_id, content_type, ac if ('gsuite_id' not in params or params['gsuite_id'] is None): raise ValueError("Missing the required parameter `gsuite_id` when calling `graph_g_suite_traverse_user`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_g_suite_traverse_user`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_g_suite_traverse_user`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_g_suite_traverse_user`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1963,10 +1664,6 @@ def graph_g_suite_traverse_user_with_http_info(self, gsuite_id, content_type, ac header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1976,10 +1673,6 @@ def graph_g_suite_traverse_user_with_http_info(self, gsuite_id, content_type, ac header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1999,57 +1692,53 @@ def graph_g_suite_traverse_user_with_http_info(self, gsuite_id, content_type, ac _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_g_suite_traverse_user_group(self, gsuite_id, content_type, accept, **kwargs): # noqa: E501 + def graph_g_suite_traverse_user_group(self, gsuite_id, **kwargs): # noqa: E501 """List the User Groups bound to a G Suite instance # noqa: E501 This endpoint will return all User Groups bound to an G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSuite_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_g_suite_traverse_user_group(gsuite_id, content_type, accept, async_req=True) + >>> thread = api.graph_g_suite_traverse_user_group(gsuite_id, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: ObjectID of the G Suite instance. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_g_suite_traverse_user_group_with_http_info(gsuite_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_g_suite_traverse_user_group_with_http_info(gsuite_id, **kwargs) # noqa: E501 else: - (data) = self.graph_g_suite_traverse_user_group_with_http_info(gsuite_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_g_suite_traverse_user_group_with_http_info(gsuite_id, **kwargs) # noqa: E501 return data - def graph_g_suite_traverse_user_group_with_http_info(self, gsuite_id, content_type, accept, **kwargs): # noqa: E501 + def graph_g_suite_traverse_user_group_with_http_info(self, gsuite_id, **kwargs): # noqa: E501 """List the User Groups bound to a G Suite instance # noqa: E501 This endpoint will return all User Groups bound to an G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSuite_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_g_suite_traverse_user_group_with_http_info(gsuite_id, content_type, accept, async_req=True) + >>> thread = api.graph_g_suite_traverse_user_group_with_http_info(gsuite_id, async_req=True) >>> result = thread.get() :param async_req bool :param str gsuite_id: ObjectID of the G Suite instance. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['gsuite_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['gsuite_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2068,17 +1757,7 @@ def graph_g_suite_traverse_user_group_with_http_info(self, gsuite_id, content_ty if ('gsuite_id' not in params or params['gsuite_id'] is None): raise ValueError("Missing the required parameter `gsuite_id` when calling `graph_g_suite_traverse_user_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_g_suite_traverse_user_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_g_suite_traverse_user_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_g_suite_traverse_user_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -2097,10 +1776,6 @@ def graph_g_suite_traverse_user_group_with_http_info(self, gsuite_id, content_ty header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -2110,10 +1785,6 @@ def graph_g_suite_traverse_user_group_with_http_info(self, gsuite_id, content_ty header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -2133,57 +1804,53 @@ def graph_g_suite_traverse_user_group_with_http_info(self, gsuite_id, content_ty _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_ldap_server_associations_list(self, ldapserver_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_ldap_server_associations_list(self, ldapserver_id, targets, **kwargs): # noqa: E501 """List the associations of a LDAP Server # noqa: E501 This endpoint returns the _direct_ associations of this LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_ldap_server_associations_list(ldapserver_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_ldap_server_associations_list(ldapserver_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str ldapserver_id: ObjectID of the LDAP Server. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"ldap_server\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_ldap_server_associations_list_with_http_info(ldapserver_id, targets, content_type, accept, **kwargs) # noqa: E501 + return self.graph_ldap_server_associations_list_with_http_info(ldapserver_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_ldap_server_associations_list_with_http_info(ldapserver_id, targets, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_ldap_server_associations_list_with_http_info(ldapserver_id, targets, **kwargs) # noqa: E501 return data - def graph_ldap_server_associations_list_with_http_info(self, ldapserver_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_ldap_server_associations_list_with_http_info(self, ldapserver_id, targets, **kwargs): # noqa: E501 """List the associations of a LDAP Server # noqa: E501 This endpoint returns the _direct_ associations of this LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_ldap_server_associations_list_with_http_info(ldapserver_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_ldap_server_associations_list_with_http_info(ldapserver_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str ldapserver_id: ObjectID of the LDAP Server. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"ldap_server\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['ldapserver_id', 'targets', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['ldapserver_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2206,17 +1873,7 @@ def graph_ldap_server_associations_list_with_http_info(self, ldapserver_id, targ if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_ldap_server_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_ldap_server_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_ldap_server_associations_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_ldap_server_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -2233,10 +1890,6 @@ def graph_ldap_server_associations_list_with_http_info(self, ldapserver_id, targ query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -2248,10 +1901,6 @@ def graph_ldap_server_associations_list_with_http_info(self, ldapserver_id, targ header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -2271,53 +1920,49 @@ def graph_ldap_server_associations_list_with_http_info(self, ldapserver_id, targ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_ldap_server_associations_post(self, ldapserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_ldap_server_associations_post(self, ldapserver_id, **kwargs): # noqa: E501 """Manage the associations of a LDAP Server # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_ldap_server_associations_post(ldapserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_ldap_server_associations_post(ldapserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str ldapserver_id: ObjectID of the LDAP Server. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationLdapServer body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_ldap_server_associations_post_with_http_info(ldapserver_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_ldap_server_associations_post_with_http_info(ldapserver_id, **kwargs) # noqa: E501 else: - (data) = self.graph_ldap_server_associations_post_with_http_info(ldapserver_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_ldap_server_associations_post_with_http_info(ldapserver_id, **kwargs) # noqa: E501 return data - def graph_ldap_server_associations_post_with_http_info(self, ldapserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_ldap_server_associations_post_with_http_info(self, ldapserver_id, **kwargs): # noqa: E501 """Manage the associations of a LDAP Server # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_ldap_server_associations_post_with_http_info(ldapserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_ldap_server_associations_post_with_http_info(ldapserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str ldapserver_id: ObjectID of the LDAP Server. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationLdapServer body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['ldapserver_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['ldapserver_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2336,14 +1981,6 @@ def graph_ldap_server_associations_post_with_http_info(self, ldapserver_id, cont if ('ldapserver_id' not in params or params['ldapserver_id'] is None): raise ValueError("Missing the required parameter `ldapserver_id` when calling `graph_ldap_server_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_ldap_server_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_ldap_server_associations_post`") # noqa: E501 collection_formats = {} @@ -2354,10 +1991,6 @@ def graph_ldap_server_associations_post_with_http_info(self, ldapserver_id, cont query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -2367,10 +2000,6 @@ def graph_ldap_server_associations_post_with_http_info(self, ldapserver_id, cont body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -2394,57 +2023,53 @@ def graph_ldap_server_associations_post_with_http_info(self, ldapserver_id, cont _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_ldap_server_traverse_user(self, ldapserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_ldap_server_traverse_user(self, ldapserver_id, **kwargs): # noqa: E501 """List the Users bound to a LDAP Server # noqa: E501 This endpoint will return all Users bound to an LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_ldap_server_traverse_user(ldapserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_ldap_server_traverse_user(ldapserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str ldapserver_id: ObjectID of the LDAP Server. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_ldap_server_traverse_user_with_http_info(ldapserver_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_ldap_server_traverse_user_with_http_info(ldapserver_id, **kwargs) # noqa: E501 else: - (data) = self.graph_ldap_server_traverse_user_with_http_info(ldapserver_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_ldap_server_traverse_user_with_http_info(ldapserver_id, **kwargs) # noqa: E501 return data - def graph_ldap_server_traverse_user_with_http_info(self, ldapserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_ldap_server_traverse_user_with_http_info(self, ldapserver_id, **kwargs): # noqa: E501 """List the Users bound to a LDAP Server # noqa: E501 This endpoint will return all Users bound to an LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_ldap_server_traverse_user_with_http_info(ldapserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_ldap_server_traverse_user_with_http_info(ldapserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str ldapserver_id: ObjectID of the LDAP Server. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['ldapserver_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['ldapserver_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2463,17 +2088,7 @@ def graph_ldap_server_traverse_user_with_http_info(self, ldapserver_id, content_ if ('ldapserver_id' not in params or params['ldapserver_id'] is None): raise ValueError("Missing the required parameter `ldapserver_id` when calling `graph_ldap_server_traverse_user`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_ldap_server_traverse_user`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_ldap_server_traverse_user`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_ldap_server_traverse_user`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -2492,10 +2107,6 @@ def graph_ldap_server_traverse_user_with_http_info(self, ldapserver_id, content_ header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -2505,10 +2116,6 @@ def graph_ldap_server_traverse_user_with_http_info(self, ldapserver_id, content_ header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -2528,57 +2135,53 @@ def graph_ldap_server_traverse_user_with_http_info(self, ldapserver_id, content_ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_ldap_server_traverse_user_group(self, ldapserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_ldap_server_traverse_user_group(self, ldapserver_id, **kwargs): # noqa: E501 """List the User Groups bound to a LDAP Server # noqa: E501 This endpoint will return all Users Groups bound to a LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_ldap_server_traverse_user_group(ldapserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_ldap_server_traverse_user_group(ldapserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str ldapserver_id: ObjectID of the LDAP Server. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_ldap_server_traverse_user_group_with_http_info(ldapserver_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_ldap_server_traverse_user_group_with_http_info(ldapserver_id, **kwargs) # noqa: E501 else: - (data) = self.graph_ldap_server_traverse_user_group_with_http_info(ldapserver_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_ldap_server_traverse_user_group_with_http_info(ldapserver_id, **kwargs) # noqa: E501 return data - def graph_ldap_server_traverse_user_group_with_http_info(self, ldapserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_ldap_server_traverse_user_group_with_http_info(self, ldapserver_id, **kwargs): # noqa: E501 """List the User Groups bound to a LDAP Server # noqa: E501 This endpoint will return all Users Groups bound to a LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_ldap_server_traverse_user_group_with_http_info(ldapserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_ldap_server_traverse_user_group_with_http_info(ldapserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str ldapserver_id: ObjectID of the LDAP Server. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['ldapserver_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['ldapserver_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2597,17 +2200,7 @@ def graph_ldap_server_traverse_user_group_with_http_info(self, ldapserver_id, co if ('ldapserver_id' not in params or params['ldapserver_id'] is None): raise ValueError("Missing the required parameter `ldapserver_id` when calling `graph_ldap_server_traverse_user_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_ldap_server_traverse_user_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_ldap_server_traverse_user_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_ldap_server_traverse_user_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -2626,10 +2219,6 @@ def graph_ldap_server_traverse_user_group_with_http_info(self, ldapserver_id, co header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -2639,10 +2228,6 @@ def graph_ldap_server_traverse_user_group_with_http_info(self, ldapserver_id, co header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -2662,57 +2247,53 @@ def graph_ldap_server_traverse_user_group_with_http_info(self, ldapserver_id, co _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_office365_associations_list(self, office365_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_office365_associations_list(self, office365_id, targets, **kwargs): # noqa: E501 """List the associations of an Office 365 instance # noqa: E501 - This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations?targets=user_group' \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_office365_associations_list(office365_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_office365_associations_list(office365_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: ObjectID of the Office 365 instance. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"office_365\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_office365_associations_list_with_http_info(office365_id, targets, content_type, accept, **kwargs) # noqa: E501 + return self.graph_office365_associations_list_with_http_info(office365_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_office365_associations_list_with_http_info(office365_id, targets, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_office365_associations_list_with_http_info(office365_id, targets, **kwargs) # noqa: E501 return data - def graph_office365_associations_list_with_http_info(self, office365_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_office365_associations_list_with_http_info(self, office365_id, targets, **kwargs): # noqa: E501 """List the associations of an Office 365 instance # noqa: E501 - This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations?targets=user_group' \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_office365_associations_list_with_http_info(office365_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_office365_associations_list_with_http_info(office365_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: ObjectID of the Office 365 instance. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"office_365\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['office365_id', 'targets', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['office365_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2735,17 +2316,7 @@ def graph_office365_associations_list_with_http_info(self, office365_id, targets if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_office365_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_office365_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_office365_associations_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_office365_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -2762,10 +2333,6 @@ def graph_office365_associations_list_with_http_info(self, office365_id, targets query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -2777,10 +2344,6 @@ def graph_office365_associations_list_with_http_info(self, office365_id, targets header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -2800,53 +2363,49 @@ def graph_office365_associations_list_with_http_info(self, office365_id, targets _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_office365_associations_post(self, office365_id, content_type, accept, **kwargs): # noqa: E501 + def graph_office365_associations_post(self, office365_id, **kwargs): # noqa: E501 """Manage the associations of an Office 365 instance # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_office365_associations_post(office365_id, content_type, accept, async_req=True) + >>> thread = api.graph_office365_associations_post(office365_id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: ObjectID of the Office 365 instance. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationOffice365 body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_office365_associations_post_with_http_info(office365_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_office365_associations_post_with_http_info(office365_id, **kwargs) # noqa: E501 else: - (data) = self.graph_office365_associations_post_with_http_info(office365_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_office365_associations_post_with_http_info(office365_id, **kwargs) # noqa: E501 return data - def graph_office365_associations_post_with_http_info(self, office365_id, content_type, accept, **kwargs): # noqa: E501 + def graph_office365_associations_post_with_http_info(self, office365_id, **kwargs): # noqa: E501 """Manage the associations of an Office 365 instance # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_office365_associations_post_with_http_info(office365_id, content_type, accept, async_req=True) + >>> thread = api.graph_office365_associations_post_with_http_info(office365_id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: ObjectID of the Office 365 instance. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationOffice365 body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['office365_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['office365_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2865,14 +2424,6 @@ def graph_office365_associations_post_with_http_info(self, office365_id, content if ('office365_id' not in params or params['office365_id'] is None): raise ValueError("Missing the required parameter `office365_id` when calling `graph_office365_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_office365_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_office365_associations_post`") # noqa: E501 collection_formats = {} @@ -2883,10 +2434,6 @@ def graph_office365_associations_post_with_http_info(self, office365_id, content query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -2896,10 +2443,6 @@ def graph_office365_associations_post_with_http_info(self, office365_id, content body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -2923,57 +2466,53 @@ def graph_office365_associations_post_with_http_info(self, office365_id, content _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_office365_traverse_user(self, office365_id, content_type, accept, **kwargs): # noqa: E501 + def graph_office365_traverse_user(self, office365_id, **kwargs): # noqa: E501 """List the Users bound to an Office 365 instance # noqa: E501 - This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_office365_traverse_user(office365_id, content_type, accept, async_req=True) + >>> thread = api.graph_office365_traverse_user(office365_id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: ObjectID of the Office 365 suite. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_office365_traverse_user_with_http_info(office365_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_office365_traverse_user_with_http_info(office365_id, **kwargs) # noqa: E501 else: - (data) = self.graph_office365_traverse_user_with_http_info(office365_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_office365_traverse_user_with_http_info(office365_id, **kwargs) # noqa: E501 return data - def graph_office365_traverse_user_with_http_info(self, office365_id, content_type, accept, **kwargs): # noqa: E501 + def graph_office365_traverse_user_with_http_info(self, office365_id, **kwargs): # noqa: E501 """List the Users bound to an Office 365 instance # noqa: E501 - This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_office365_traverse_user_with_http_info(office365_id, content_type, accept, async_req=True) + >>> thread = api.graph_office365_traverse_user_with_http_info(office365_id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: ObjectID of the Office 365 suite. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['office365_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['office365_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2992,17 +2531,7 @@ def graph_office365_traverse_user_with_http_info(self, office365_id, content_typ if ('office365_id' not in params or params['office365_id'] is None): raise ValueError("Missing the required parameter `office365_id` when calling `graph_office365_traverse_user`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_office365_traverse_user`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_office365_traverse_user`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_office365_traverse_user`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -3021,10 +2550,6 @@ def graph_office365_traverse_user_with_http_info(self, office365_id, content_typ header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -3034,10 +2559,6 @@ def graph_office365_traverse_user_with_http_info(self, office365_id, content_typ header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -3057,57 +2578,53 @@ def graph_office365_traverse_user_with_http_info(self, office365_id, content_typ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_office365_traverse_user_group(self, office365_id, content_type, accept, **kwargs): # noqa: E501 + def graph_office365_traverse_user_group(self, office365_id, **kwargs): # noqa: E501 """List the User Groups bound to an Office 365 instance # noqa: E501 - This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_office365_traverse_user_group(office365_id, content_type, accept, async_req=True) + >>> thread = api.graph_office365_traverse_user_group(office365_id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: ObjectID of the Office 365 suite. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_office365_traverse_user_group_with_http_info(office365_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_office365_traverse_user_group_with_http_info(office365_id, **kwargs) # noqa: E501 else: - (data) = self.graph_office365_traverse_user_group_with_http_info(office365_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_office365_traverse_user_group_with_http_info(office365_id, **kwargs) # noqa: E501 return data - def graph_office365_traverse_user_group_with_http_info(self, office365_id, content_type, accept, **kwargs): # noqa: E501 + def graph_office365_traverse_user_group_with_http_info(self, office365_id, **kwargs): # noqa: E501 """List the User Groups bound to an Office 365 instance # noqa: E501 - This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_office365_traverse_user_group_with_http_info(office365_id, content_type, accept, async_req=True) + >>> thread = api.graph_office365_traverse_user_group_with_http_info(office365_id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: ObjectID of the Office 365 suite. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['office365_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['office365_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3126,17 +2643,7 @@ def graph_office365_traverse_user_group_with_http_info(self, office365_id, conte if ('office365_id' not in params or params['office365_id'] is None): raise ValueError("Missing the required parameter `office365_id` when calling `graph_office365_traverse_user_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_office365_traverse_user_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_office365_traverse_user_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_office365_traverse_user_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -3155,10 +2662,6 @@ def graph_office365_traverse_user_group_with_http_info(self, office365_id, conte header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -3168,10 +2671,6 @@ def graph_office365_traverse_user_group_with_http_info(self, office365_id, conte header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -3191,57 +2690,53 @@ def graph_office365_traverse_user_group_with_http_info(self, office365_id, conte _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_policy_associations_list(self, policy_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_policy_associations_list(self, policy_id, targets, **kwargs): # noqa: E501 """List the associations of a Policy # noqa: E501 This endpoint returns the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_policy_associations_list(policy_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_policy_associations_list(policy_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str policy_id: ObjectID of the Policy. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"policy\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_policy_associations_list_with_http_info(policy_id, targets, content_type, accept, **kwargs) # noqa: E501 + return self.graph_policy_associations_list_with_http_info(policy_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_policy_associations_list_with_http_info(policy_id, targets, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_policy_associations_list_with_http_info(policy_id, targets, **kwargs) # noqa: E501 return data - def graph_policy_associations_list_with_http_info(self, policy_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_policy_associations_list_with_http_info(self, policy_id, targets, **kwargs): # noqa: E501 """List the associations of a Policy # noqa: E501 This endpoint returns the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_policy_associations_list_with_http_info(policy_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_policy_associations_list_with_http_info(policy_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str policy_id: ObjectID of the Policy. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"policy\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['policy_id', 'targets', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['policy_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3264,17 +2759,7 @@ def graph_policy_associations_list_with_http_info(self, policy_id, targets, cont if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_policy_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_policy_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_policy_associations_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_policy_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -3291,10 +2776,6 @@ def graph_policy_associations_list_with_http_info(self, policy_id, targets, cont query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -3306,10 +2787,6 @@ def graph_policy_associations_list_with_http_info(self, policy_id, targets, cont header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -3329,53 +2806,49 @@ def graph_policy_associations_list_with_http_info(self, policy_id, targets, cont _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_policy_associations_post(self, policy_id, content_type, accept, **kwargs): # noqa: E501 + def graph_policy_associations_post(self, policy_id, **kwargs): # noqa: E501 """Manage the associations of a Policy # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_policy_associations_post(policy_id, content_type, accept, async_req=True) + >>> thread = api.graph_policy_associations_post(policy_id, async_req=True) >>> result = thread.get() :param async_req bool :param str policy_id: ObjectID of the Policy. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationPolicy body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_policy_associations_post_with_http_info(policy_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_policy_associations_post_with_http_info(policy_id, **kwargs) # noqa: E501 else: - (data) = self.graph_policy_associations_post_with_http_info(policy_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_policy_associations_post_with_http_info(policy_id, **kwargs) # noqa: E501 return data - def graph_policy_associations_post_with_http_info(self, policy_id, content_type, accept, **kwargs): # noqa: E501 + def graph_policy_associations_post_with_http_info(self, policy_id, **kwargs): # noqa: E501 """Manage the associations of a Policy # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_policy_associations_post_with_http_info(policy_id, content_type, accept, async_req=True) + >>> thread = api.graph_policy_associations_post_with_http_info(policy_id, async_req=True) >>> result = thread.get() :param async_req bool :param str policy_id: ObjectID of the Policy. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationPolicy body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['policy_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['policy_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3394,14 +2867,6 @@ def graph_policy_associations_post_with_http_info(self, policy_id, content_type, if ('policy_id' not in params or params['policy_id'] is None): raise ValueError("Missing the required parameter `policy_id` when calling `graph_policy_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_policy_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_policy_associations_post`") # noqa: E501 collection_formats = {} @@ -3412,10 +2877,6 @@ def graph_policy_associations_post_with_http_info(self, policy_id, content_type, query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -3425,10 +2886,6 @@ def graph_policy_associations_post_with_http_info(self, policy_id, content_type, body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -3452,57 +2909,53 @@ def graph_policy_associations_post_with_http_info(self, policy_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_policy_traverse_system(self, policy_id, content_type, accept, **kwargs): # noqa: E501 - """List the Systems bound to a Policy # noqa: E501 + def graph_policy_group_associations_list(self, group_id, targets, **kwargs): # noqa: E501 + """List the associations of a Policy Group. # noqa: E501 - This endpoint will return all Systems bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_policy_traverse_system(policy_id, content_type, accept, async_req=True) + >>> thread = api.graph_policy_group_associations_list(group_id, targets, async_req=True) >>> result = thread.get() :param async_req bool - :param str policy_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) + :param str group_id: ObjectID of the Policy Group. (required) + :param list[str] targets: Targets which a \"policy_group\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :return: list[GraphObjectWithPaths] + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_policy_traverse_system_with_http_info(policy_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_policy_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_policy_traverse_system_with_http_info(policy_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_policy_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 return data - def graph_policy_traverse_system_with_http_info(self, policy_id, content_type, accept, **kwargs): # noqa: E501 - """List the Systems bound to a Policy # noqa: E501 + def graph_policy_group_associations_list_with_http_info(self, group_id, targets, **kwargs): # noqa: E501 + """List the associations of a Policy Group. # noqa: E501 - This endpoint will return all Systems bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_policy_traverse_system_with_http_info(policy_id, content_type, accept, async_req=True) + >>> thread = api.graph_policy_group_associations_list_with_http_info(group_id, targets, async_req=True) >>> result = thread.get() :param async_req bool - :param str policy_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) + :param str group_id: ObjectID of the Policy Group. (required) + :param list[str] targets: Targets which a \"policy_group\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :return: list[GraphObjectWithPaths] + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['policy_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3513,47 +2966,37 @@ def graph_policy_traverse_system_with_http_info(self, policy_id, content_type, a if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method graph_policy_traverse_system" % key + " to method graph_policy_group_associations_list" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'policy_id' is set - if ('policy_id' not in params or - params['policy_id'] is None): - raise ValueError("Missing the required parameter `policy_id` when calling `graph_policy_traverse_system`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_policy_traverse_system`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_policy_traverse_system`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_policy_traverse_system`, must be a value greater than or equal to `0`") # noqa: E501 + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_associations_list`") # noqa: E501 + # verify the required parameter 'targets' is set + if ('targets' not in params or + params['targets'] is None): + raise ValueError("Missing the required parameter `targets` when calling `graph_policy_group_associations_list`") # noqa: E501 + collection_formats = {} path_params = {} - if 'policy_id' in params: - path_params['policy_id'] = params['policy_id'] # noqa: E501 + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 query_params = [] + if 'targets' in params: + query_params.append(('targets', params['targets'])) # noqa: E501 + collection_formats['targets'] = 'csv' # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 - collection_formats['filter'] = 'csv' # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -3563,22 +3006,18 @@ def graph_policy_traverse_system_with_http_info(self, policy_id, content_type, a header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/policies/{policy_id}/systems', 'GET', + '/policygroups/{group_id}/associations', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[GraphObjectWithPaths]', # noqa: E501 + response_type='list[GraphConnection]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -3586,57 +3025,49 @@ def graph_policy_traverse_system_with_http_info(self, policy_id, content_type, a _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_policy_traverse_system_group(self, policy_id, content_type, accept, **kwargs): # noqa: E501 - """List the System Groups bound to a Policy # noqa: E501 + def graph_policy_group_associations_post(self, group_id, **kwargs): # noqa: E501 + """Manage the associations of a Policy Group # noqa: E501 - This endpoint will return all Systems Groups bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint manages the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_policy_traverse_system_group(policy_id, content_type, accept, async_req=True) + >>> thread = api.graph_policy_group_associations_post(group_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str policy_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: - :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :return: list[GraphObjectWithPaths] + :param str group_id: ObjectID of the Policy Group. (required) + :param GraphOperationPolicyGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_policy_traverse_system_group_with_http_info(policy_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_policy_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_policy_traverse_system_group_with_http_info(policy_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_policy_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_policy_traverse_system_group_with_http_info(self, policy_id, content_type, accept, **kwargs): # noqa: E501 - """List the System Groups bound to a Policy # noqa: E501 + def graph_policy_group_associations_post_with_http_info(self, group_id, **kwargs): # noqa: E501 + """Manage the associations of a Policy Group # noqa: E501 - This endpoint will return all Systems Groups bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint manages the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_policy_traverse_system_group_with_http_info(policy_id, content_type, accept, async_req=True) + >>> thread = api.graph_policy_group_associations_post_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str policy_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: - :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :return: list[GraphObjectWithPaths] + :param str group_id: ObjectID of the Policy Group. (required) + :param GraphOperationPolicyGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['policy_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3647,56 +3078,33 @@ def graph_policy_traverse_system_group_with_http_info(self, policy_id, content_t if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method graph_policy_traverse_system_group" % key + " to method graph_policy_group_associations_post" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'policy_id' is set - if ('policy_id' not in params or - params['policy_id'] is None): - raise ValueError("Missing the required parameter `policy_id` when calling `graph_policy_traverse_system_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_policy_traverse_system_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_policy_traverse_system_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_policy_traverse_system_group`, must be a value greater than or equal to `0`") # noqa: E501 + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_associations_post`") # noqa: E501 + collection_formats = {} path_params = {} - if 'policy_id' in params: - path_params['policy_id'] = params['policy_id'] # noqa: E501 + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 - collection_formats['filter'] = 'csv' # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - + if 'body' in params: + body_params = params['body'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -3705,14 +3113,14 @@ def graph_policy_traverse_system_group_with_http_info(self, policy_id, content_t auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/policies/{policy_id}/systemgroups', 'GET', + '/policygroups/{group_id}/associations', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[GraphObjectWithPaths]', # noqa: E501 + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -3720,57 +3128,51 @@ def graph_policy_traverse_system_group_with_http_info(self, policy_id, content_t _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_radius_server_associations_list(self, radiusserver_id, targets, content_type, accept, **kwargs): # noqa: E501 - """List the associations of a RADIUS Server # noqa: E501 + def graph_policy_group_members_list(self, group_id, **kwargs): # noqa: E501 + """List the members of a Policy Group # noqa: E501 - This endpoint returns the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns the Policy members of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_radius_server_associations_list(radiusserver_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_policy_group_members_list(group_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str radiusserver_id: ObjectID of the Radius Server. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param str group_id: ObjectID of the Policy Group. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_radius_server_associations_list_with_http_info(radiusserver_id, targets, content_type, accept, **kwargs) # noqa: E501 + return self.graph_policy_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_radius_server_associations_list_with_http_info(radiusserver_id, targets, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_policy_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_radius_server_associations_list_with_http_info(self, radiusserver_id, targets, content_type, accept, **kwargs): # noqa: E501 - """List the associations of a RADIUS Server # noqa: E501 + def graph_policy_group_members_list_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the members of a Policy Group # noqa: E501 - This endpoint returns the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns the Policy members of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_radius_server_associations_list_with_http_info(radiusserver_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_policy_group_members_list_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str radiusserver_id: ObjectID of the Radius Server. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param str group_id: ObjectID of the Policy Group. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['radiusserver_id', 'targets', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3781,49 +3183,28 @@ def graph_radius_server_associations_list_with_http_info(self, radiusserver_id, if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method graph_radius_server_associations_list" % key + " to method graph_policy_group_members_list" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'radiusserver_id' is set - if ('radiusserver_id' not in params or - params['radiusserver_id'] is None): - raise ValueError("Missing the required parameter `radiusserver_id` when calling `graph_radius_server_associations_list`") # noqa: E501 - # verify the required parameter 'targets' is set - if ('targets' not in params or - params['targets'] is None): - raise ValueError("Missing the required parameter `targets` when calling `graph_radius_server_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_radius_server_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_radius_server_associations_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_radius_server_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_members_list`") # noqa: E501 + collection_formats = {} path_params = {} - if 'radiusserver_id' in params: - path_params['radiusserver_id'] = params['radiusserver_id'] # noqa: E501 + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 query_params = [] - if 'targets' in params: - query_params.append(('targets', params['targets'])) # noqa: E501 - collection_formats['targets'] = 'csv' # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -3835,15 +3216,11 @@ def graph_radius_server_associations_list_with_http_info(self, radiusserver_id, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/radiusservers/{radiusserver_id}/associations', 'GET', + '/policygroups/{group_id}/members', 'GET', path_params, query_params, header_params, @@ -3858,53 +3235,49 @@ def graph_radius_server_associations_list_with_http_info(self, radiusserver_id, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_radius_server_associations_post(self, radiusserver_id, content_type, accept, **kwargs): # noqa: E501 - """Manage the associations of a RADIUS Server # noqa: E501 + def graph_policy_group_members_post(self, group_id, **kwargs): # noqa: E501 + """Manage the members of a Policy Group # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"type\":\"user\", \"id\":\"{USER_ID}\", \"op\":\"add\" }' ``` # noqa: E501 + This endpoint allows you to manage the Policy members of a Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"policy\", \"id\": \"{Policy_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_radius_server_associations_post(radiusserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_policy_group_members_post(group_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str radiusserver_id: ObjectID of the Radius Server. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param str group_id: ObjectID of the Policy Group. (required) + :param GraphOperationPolicyGroupMember body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_radius_server_associations_post_with_http_info(radiusserver_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_policy_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_radius_server_associations_post_with_http_info(radiusserver_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_policy_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_radius_server_associations_post_with_http_info(self, radiusserver_id, content_type, accept, **kwargs): # noqa: E501 - """Manage the associations of a RADIUS Server # noqa: E501 + def graph_policy_group_members_post_with_http_info(self, group_id, **kwargs): # noqa: E501 + """Manage the members of a Policy Group # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"type\":\"user\", \"id\":\"{USER_ID}\", \"op\":\"add\" }' ``` # noqa: E501 + This endpoint allows you to manage the Policy members of a Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"policy\", \"id\": \"{Policy_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_radius_server_associations_post_with_http_info(radiusserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_policy_group_members_post_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str radiusserver_id: ObjectID of the Radius Server. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param str group_id: ObjectID of the Policy Group. (required) + :param GraphOperationPolicyGroupMember body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['radiusserver_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3915,36 +3288,24 @@ def graph_radius_server_associations_post_with_http_info(self, radiusserver_id, if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method graph_radius_server_associations_post" % key + " to method graph_policy_group_members_post" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'radiusserver_id' is set - if ('radiusserver_id' not in params or - params['radiusserver_id'] is None): - raise ValueError("Missing the required parameter `radiusserver_id` when calling `graph_radius_server_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_radius_server_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_radius_server_associations_post`") # noqa: E501 + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_members_post`") # noqa: E501 collection_formats = {} path_params = {} - if 'radiusserver_id' in params: - path_params['radiusserver_id'] = params['radiusserver_id'] # noqa: E501 + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -3954,10 +3315,1358 @@ def graph_radius_server_associations_post_with_http_info(self, radiusserver_id, body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/members', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_group_membership(self, group_id, **kwargs): # noqa: E501 + """List the Policy Group's membership # noqa: E501 + + This endpoint returns all Policy members that are a member of this Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_membership(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def graph_policy_group_membership_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the Policy Group's membership # noqa: E501 + + This endpoint returns all Policy members that are a member of this Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_membership_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_group_membership" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_membership`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/membership', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_group_traverse_system(self, group_id, **kwargs): # noqa: E501 + """List the Systems bound to a Policy Group # noqa: E501 + + This endpoint will return all Systems bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_traverse_system(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_group_traverse_system_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_group_traverse_system_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def graph_policy_group_traverse_system_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the Systems bound to a Policy Group # noqa: E501 + + This endpoint will return all Systems bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_traverse_system_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_group_traverse_system" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_traverse_system`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/systems', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_group_traverse_system_group(self, group_id, **kwargs): # noqa: E501 + """List the System Groups bound to Policy Groups # noqa: E501 + + This endpoint will return all System Groups bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_traverse_system_group(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_group_traverse_system_group_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_group_traverse_system_group_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def graph_policy_group_traverse_system_group_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the System Groups bound to Policy Groups # noqa: E501 + + This endpoint will return all System Groups bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_traverse_system_group_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_group_traverse_system_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_traverse_system_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/systemgroups', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_member_of(self, policy_id, **kwargs): # noqa: E501 + """List the parent Groups of a Policy # noqa: E501 + + This endpoint returns all the Policy Groups a Policy is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_member_of(policy_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str policy_id: ObjectID of the Policy. (required) + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str _date: Current date header for the System Context API + :param str authorization: Authorization header for the System Context API + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_member_of_with_http_info(policy_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_member_of_with_http_info(policy_id, **kwargs) # noqa: E501 + return data + + def graph_policy_member_of_with_http_info(self, policy_id, **kwargs): # noqa: E501 + """List the parent Groups of a Policy # noqa: E501 + + This endpoint returns all the Policy Groups a Policy is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_member_of_with_http_info(policy_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str policy_id: ObjectID of the Policy. (required) + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str _date: Current date header for the System Context API + :param str authorization: Authorization header for the System Context API + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['policy_id', 'filter', 'limit', 'skip', '_date', 'authorization', 'sort', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_member_of" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'policy_id' is set + if ('policy_id' not in params or + params['policy_id'] is None): + raise ValueError("Missing the required parameter `policy_id` when calling `graph_policy_member_of`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'policy_id' in params: + path_params['policy_id'] = params['policy_id'] # noqa: E501 + + query_params = [] + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + if '_date' in params: + header_params['Date'] = params['_date'] # noqa: E501 + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policies/{policy_id}/memberof', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_traverse_system(self, policy_id, **kwargs): # noqa: E501 + """List the Systems bound to a Policy # noqa: E501 + + This endpoint will return all Systems bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_traverse_system(policy_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str policy_id: ObjectID of the Command. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_traverse_system_with_http_info(policy_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_traverse_system_with_http_info(policy_id, **kwargs) # noqa: E501 + return data + + def graph_policy_traverse_system_with_http_info(self, policy_id, **kwargs): # noqa: E501 + """List the Systems bound to a Policy # noqa: E501 + + This endpoint will return all Systems bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_traverse_system_with_http_info(policy_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str policy_id: ObjectID of the Command. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['policy_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_traverse_system" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'policy_id' is set + if ('policy_id' not in params or + params['policy_id'] is None): + raise ValueError("Missing the required parameter `policy_id` when calling `graph_policy_traverse_system`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'policy_id' in params: + path_params['policy_id'] = params['policy_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policies/{policy_id}/systems', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_traverse_system_group(self, policy_id, **kwargs): # noqa: E501 + """List the System Groups bound to a Policy # noqa: E501 + + This endpoint will return all Systems Groups bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_traverse_system_group(policy_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str policy_id: ObjectID of the Command. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_traverse_system_group_with_http_info(policy_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_traverse_system_group_with_http_info(policy_id, **kwargs) # noqa: E501 + return data + + def graph_policy_traverse_system_group_with_http_info(self, policy_id, **kwargs): # noqa: E501 + """List the System Groups bound to a Policy # noqa: E501 + + This endpoint will return all Systems Groups bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_traverse_system_group_with_http_info(policy_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str policy_id: ObjectID of the Command. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['policy_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_traverse_system_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'policy_id' is set + if ('policy_id' not in params or + params['policy_id'] is None): + raise ValueError("Missing the required parameter `policy_id` when calling `graph_policy_traverse_system_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'policy_id' in params: + path_params['policy_id'] = params['policy_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policies/{policy_id}/systemgroups', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_radius_server_associations_list(self, radiusserver_id, targets, **kwargs): # noqa: E501 + """List the associations of a RADIUS Server # noqa: E501 + + This endpoint returns the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_radius_server_associations_list(radiusserver_id, targets, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str radiusserver_id: ObjectID of the Radius Server. (required) + :param list[str] targets: Targets which a \"radius_server\" can be associated to. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_radius_server_associations_list_with_http_info(radiusserver_id, targets, **kwargs) # noqa: E501 + else: + (data) = self.graph_radius_server_associations_list_with_http_info(radiusserver_id, targets, **kwargs) # noqa: E501 + return data + + def graph_radius_server_associations_list_with_http_info(self, radiusserver_id, targets, **kwargs): # noqa: E501 + """List the associations of a RADIUS Server # noqa: E501 + + This endpoint returns the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_radius_server_associations_list_with_http_info(radiusserver_id, targets, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str radiusserver_id: ObjectID of the Radius Server. (required) + :param list[str] targets: Targets which a \"radius_server\" can be associated to. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['radiusserver_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_radius_server_associations_list" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'radiusserver_id' is set + if ('radiusserver_id' not in params or + params['radiusserver_id'] is None): + raise ValueError("Missing the required parameter `radiusserver_id` when calling `graph_radius_server_associations_list`") # noqa: E501 + # verify the required parameter 'targets' is set + if ('targets' not in params or + params['targets'] is None): + raise ValueError("Missing the required parameter `targets` when calling `graph_radius_server_associations_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'radiusserver_id' in params: + path_params['radiusserver_id'] = params['radiusserver_id'] # noqa: E501 + + query_params = [] + if 'targets' in params: + query_params.append(('targets', params['targets'])) # noqa: E501 + collection_formats['targets'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/radiusservers/{radiusserver_id}/associations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphConnection]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_radius_server_associations_post(self, radiusserver_id, **kwargs): # noqa: E501 + """Manage the associations of a RADIUS Server # noqa: E501 + + This endpoint allows you to manage the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"type\":\"user\", \"id\":\"{USER_ID}\", \"op\":\"add\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_radius_server_associations_post(radiusserver_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str radiusserver_id: ObjectID of the Radius Server. (required) + :param GraphOperationRadiusServer body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_radius_server_associations_post_with_http_info(radiusserver_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_radius_server_associations_post_with_http_info(radiusserver_id, **kwargs) # noqa: E501 + return data + + def graph_radius_server_associations_post_with_http_info(self, radiusserver_id, **kwargs): # noqa: E501 + """Manage the associations of a RADIUS Server # noqa: E501 + + This endpoint allows you to manage the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"type\":\"user\", \"id\":\"{USER_ID}\", \"op\":\"add\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_radius_server_associations_post_with_http_info(radiusserver_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str radiusserver_id: ObjectID of the Radius Server. (required) + :param GraphOperationRadiusServer body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['radiusserver_id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_radius_server_associations_post" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'radiusserver_id' is set + if ('radiusserver_id' not in params or + params['radiusserver_id'] is None): + raise ValueError("Missing the required parameter `radiusserver_id` when calling `graph_radius_server_associations_post`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'radiusserver_id' in params: + path_params['radiusserver_id'] = params['radiusserver_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/radiusservers/{radiusserver_id}/associations', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_radius_server_traverse_user(self, radiusserver_id, **kwargs): # noqa: E501 + """List the Users bound to a RADIUS Server # noqa: E501 + + This endpoint will return all Users bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_radius_server_traverse_user(radiusserver_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str radiusserver_id: ObjectID of the Radius Server. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_radius_server_traverse_user_with_http_info(radiusserver_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_radius_server_traverse_user_with_http_info(radiusserver_id, **kwargs) # noqa: E501 + return data + + def graph_radius_server_traverse_user_with_http_info(self, radiusserver_id, **kwargs): # noqa: E501 + """List the Users bound to a RADIUS Server # noqa: E501 + + This endpoint will return all Users bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_radius_server_traverse_user_with_http_info(radiusserver_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str radiusserver_id: ObjectID of the Radius Server. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['radiusserver_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_radius_server_traverse_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'radiusserver_id' is set + if ('radiusserver_id' not in params or + params['radiusserver_id'] is None): + raise ValueError("Missing the required parameter `radiusserver_id` when calling `graph_radius_server_traverse_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'radiusserver_id' in params: + path_params['radiusserver_id'] = params['radiusserver_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/radiusservers/{radiusserver_id}/users', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_radius_server_traverse_user_group(self, radiusserver_id, **kwargs): # noqa: E501 + """List the User Groups bound to a RADIUS Server # noqa: E501 + + This endpoint will return all Users Groups bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_radius_server_traverse_user_group(radiusserver_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str radiusserver_id: ObjectID of the Radius Server. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_radius_server_traverse_user_group_with_http_info(radiusserver_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_radius_server_traverse_user_group_with_http_info(radiusserver_id, **kwargs) # noqa: E501 + return data + + def graph_radius_server_traverse_user_group_with_http_info(self, radiusserver_id, **kwargs): # noqa: E501 + """List the User Groups bound to a RADIUS Server # noqa: E501 + + This endpoint will return all Users Groups bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_radius_server_traverse_user_group_with_http_info(radiusserver_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str radiusserver_id: ObjectID of the Radius Server. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['radiusserver_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_radius_server_traverse_user_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'radiusserver_id' is set + if ('radiusserver_id' not in params or + params['radiusserver_id'] is None): + raise ValueError("Missing the required parameter `radiusserver_id` when calling `graph_radius_server_traverse_user_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'radiusserver_id' in params: + path_params['radiusserver_id'] = params['radiusserver_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/radiusservers/{radiusserver_id}/usergroups', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_softwareapps_associations_list(self, software_app_id, targets, **kwargs): # noqa: E501 + """List the associations of a Software Application # noqa: E501 + + This endpoint will return the _direct_ associations of a Software Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Software Application and System Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_softwareapps_associations_list(software_app_id, targets, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str software_app_id: ObjectID of the Software App. (required) + :param list[str] targets: Targets which a \"software_app\" can be associated to. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_softwareapps_associations_list_with_http_info(software_app_id, targets, **kwargs) # noqa: E501 + else: + (data) = self.graph_softwareapps_associations_list_with_http_info(software_app_id, targets, **kwargs) # noqa: E501 + return data + + def graph_softwareapps_associations_list_with_http_info(self, software_app_id, targets, **kwargs): # noqa: E501 + """List the associations of a Software Application # noqa: E501 + + This endpoint will return the _direct_ associations of a Software Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Software Application and System Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_softwareapps_associations_list_with_http_info(software_app_id, targets, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str software_app_id: ObjectID of the Software App. (required) + :param list[str] targets: Targets which a \"software_app\" can be associated to. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['software_app_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_softwareapps_associations_list" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'software_app_id' is set + if ('software_app_id' not in params or + params['software_app_id'] is None): + raise ValueError("Missing the required parameter `software_app_id` when calling `graph_softwareapps_associations_list`") # noqa: E501 + # verify the required parameter 'targets' is set + if ('targets' not in params or + params['targets'] is None): + raise ValueError("Missing the required parameter `targets` when calling `graph_softwareapps_associations_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'software_app_id' in params: + path_params['software_app_id'] = params['software_app_id'] # noqa: E501 + + query_params = [] + if 'targets' in params: + query_params.append(('targets', params['targets'])) # noqa: E501 + collection_formats['targets'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/softwareapps/{software_app_id}/associations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphConnection]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_softwareapps_associations_post(self, software_app_id, **kwargs): # noqa: E501 + """Manage the associations of a software application. # noqa: E501 + + This endpoint allows you to associate or disassociate a software application to a system or system group. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"id\": \"\", \"op\": \"add\", \"type\": \"system\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_softwareapps_associations_post(software_app_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str software_app_id: ObjectID of the Software App. (required) + :param GraphOperationSoftwareApp body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_softwareapps_associations_post_with_http_info(software_app_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_softwareapps_associations_post_with_http_info(software_app_id, **kwargs) # noqa: E501 + return data + + def graph_softwareapps_associations_post_with_http_info(self, software_app_id, **kwargs): # noqa: E501 + """Manage the associations of a software application. # noqa: E501 + + This endpoint allows you to associate or disassociate a software application to a system or system group. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"id\": \"\", \"op\": \"add\", \"type\": \"system\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_softwareapps_associations_post_with_http_info(software_app_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str software_app_id: ObjectID of the Software App. (required) + :param GraphOperationSoftwareApp body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['software_app_id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_softwareapps_associations_post" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'software_app_id' is set + if ('software_app_id' not in params or + params['software_app_id'] is None): + raise ValueError("Missing the required parameter `software_app_id` when calling `graph_softwareapps_associations_post`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'software_app_id' in params: + path_params['software_app_id'] = params['software_app_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -3966,7 +4675,7 @@ def graph_radius_server_associations_post_with_http_info(self, radiusserver_id, auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/radiusservers/{radiusserver_id}/associations', 'POST', + '/softwareapps/{software_app_id}/associations', 'POST', path_params, query_params, header_params, @@ -3981,57 +4690,53 @@ def graph_radius_server_associations_post_with_http_info(self, radiusserver_id, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_radius_server_traverse_user(self, radiusserver_id, content_type, accept, **kwargs): # noqa: E501 - """List the Users bound to a RADIUS Server # noqa: E501 + def graph_softwareapps_traverse_system(self, software_app_id, **kwargs): # noqa: E501 + """List the Systems bound to a Software App. # noqa: E501 - This endpoint will return all Users bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return all Systems bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_radius_server_traverse_user(radiusserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_softwareapps_traverse_system(software_app_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str radiusserver_id: ObjectID of the Radius Server. (required) - :param str content_type: (required) - :param str accept: (required) + :param str software_app_id: ObjectID of the Software App. (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_radius_server_traverse_user_with_http_info(radiusserver_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_softwareapps_traverse_system_with_http_info(software_app_id, **kwargs) # noqa: E501 else: - (data) = self.graph_radius_server_traverse_user_with_http_info(radiusserver_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_softwareapps_traverse_system_with_http_info(software_app_id, **kwargs) # noqa: E501 return data - def graph_radius_server_traverse_user_with_http_info(self, radiusserver_id, content_type, accept, **kwargs): # noqa: E501 - """List the Users bound to a RADIUS Server # noqa: E501 + def graph_softwareapps_traverse_system_with_http_info(self, software_app_id, **kwargs): # noqa: E501 + """List the Systems bound to a Software App. # noqa: E501 - This endpoint will return all Users bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return all Systems bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_radius_server_traverse_user_with_http_info(radiusserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_softwareapps_traverse_system_with_http_info(software_app_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str radiusserver_id: ObjectID of the Radius Server. (required) - :param str content_type: (required) - :param str accept: (required) + :param str software_app_id: ObjectID of the Software App. (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['radiusserver_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['software_app_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -4042,30 +4747,20 @@ def graph_radius_server_traverse_user_with_http_info(self, radiusserver_id, cont if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method graph_radius_server_traverse_user" % key + " to method graph_softwareapps_traverse_system" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'radiusserver_id' is set - if ('radiusserver_id' not in params or - params['radiusserver_id'] is None): - raise ValueError("Missing the required parameter `radiusserver_id` when calling `graph_radius_server_traverse_user`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_radius_server_traverse_user`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_radius_server_traverse_user`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_radius_server_traverse_user`, must be a value greater than or equal to `0`") # noqa: E501 + # verify the required parameter 'software_app_id' is set + if ('software_app_id' not in params or + params['software_app_id'] is None): + raise ValueError("Missing the required parameter `software_app_id` when calling `graph_softwareapps_traverse_system`") # noqa: E501 + collection_formats = {} path_params = {} - if 'radiusserver_id' in params: - path_params['radiusserver_id'] = params['radiusserver_id'] # noqa: E501 + if 'software_app_id' in params: + path_params['software_app_id'] = params['software_app_id'] # noqa: E501 query_params = [] if 'limit' in params: @@ -4079,10 +4774,6 @@ def graph_radius_server_traverse_user_with_http_info(self, radiusserver_id, cont header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -4092,15 +4783,11 @@ def graph_radius_server_traverse_user_with_http_info(self, radiusserver_id, cont header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/radiusservers/{radiusserver_id}/users', 'GET', + '/softwareapps/{software_app_id}/systems', 'GET', path_params, query_params, header_params, @@ -4115,57 +4802,53 @@ def graph_radius_server_traverse_user_with_http_info(self, radiusserver_id, cont _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_radius_server_traverse_user_group(self, radiusserver_id, content_type, accept, **kwargs): # noqa: E501 - """List the User Groups bound to a RADIUS Server # noqa: E501 + def graph_softwareapps_traverse_system_group(self, software_app_id, **kwargs): # noqa: E501 + """List the System Groups bound to a Software App. # noqa: E501 - This endpoint will return all Users Groups bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return all Systems Groups bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_radius_server_traverse_user_group(radiusserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_softwareapps_traverse_system_group(software_app_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str radiusserver_id: ObjectID of the Radius Server. (required) - :param str content_type: (required) - :param str accept: (required) + :param str software_app_id: ObjectID of the Software App. (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_radius_server_traverse_user_group_with_http_info(radiusserver_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_softwareapps_traverse_system_group_with_http_info(software_app_id, **kwargs) # noqa: E501 else: - (data) = self.graph_radius_server_traverse_user_group_with_http_info(radiusserver_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_softwareapps_traverse_system_group_with_http_info(software_app_id, **kwargs) # noqa: E501 return data - def graph_radius_server_traverse_user_group_with_http_info(self, radiusserver_id, content_type, accept, **kwargs): # noqa: E501 - """List the User Groups bound to a RADIUS Server # noqa: E501 + def graph_softwareapps_traverse_system_group_with_http_info(self, software_app_id, **kwargs): # noqa: E501 + """List the System Groups bound to a Software App. # noqa: E501 - This endpoint will return all Users Groups bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return all Systems Groups bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_radius_server_traverse_user_group_with_http_info(radiusserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_softwareapps_traverse_system_group_with_http_info(software_app_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str radiusserver_id: ObjectID of the Radius Server. (required) - :param str content_type: (required) - :param str accept: (required) + :param str software_app_id: ObjectID of the Software App. (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['radiusserver_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['software_app_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -4176,30 +4859,20 @@ def graph_radius_server_traverse_user_group_with_http_info(self, radiusserver_id if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method graph_radius_server_traverse_user_group" % key + " to method graph_softwareapps_traverse_system_group" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'radiusserver_id' is set - if ('radiusserver_id' not in params or - params['radiusserver_id'] is None): - raise ValueError("Missing the required parameter `radiusserver_id` when calling `graph_radius_server_traverse_user_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_radius_server_traverse_user_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_radius_server_traverse_user_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_radius_server_traverse_user_group`, must be a value greater than or equal to `0`") # noqa: E501 + # verify the required parameter 'software_app_id' is set + if ('software_app_id' not in params or + params['software_app_id'] is None): + raise ValueError("Missing the required parameter `software_app_id` when calling `graph_softwareapps_traverse_system_group`") # noqa: E501 + collection_formats = {} path_params = {} - if 'radiusserver_id' in params: - path_params['radiusserver_id'] = params['radiusserver_id'] # noqa: E501 + if 'software_app_id' in params: + path_params['software_app_id'] = params['software_app_id'] # noqa: E501 query_params = [] if 'limit' in params: @@ -4213,10 +4886,6 @@ def graph_radius_server_traverse_user_group_with_http_info(self, radiusserver_id header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -4226,15 +4895,11 @@ def graph_radius_server_traverse_user_group_with_http_info(self, radiusserver_id header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/radiusservers/{radiusserver_id}/usergroups', 'GET', + '/softwareapps/{software_app_id}/systemgroups', 'GET', path_params, query_params, header_params, @@ -4249,61 +4914,57 @@ def graph_radius_server_traverse_user_group_with_http_info(self, radiusserver_id _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_associations_list(self, system_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_system_associations_list(self, system_id, targets, **kwargs): # noqa: E501 """List the associations of a System # noqa: E501 This endpoint returns the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_associations_list(system_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_system_associations_list(system_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"system\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_associations_list_with_http_info(system_id, content_type, accept, targets, **kwargs) # noqa: E501 + return self.graph_system_associations_list_with_http_info(system_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_system_associations_list_with_http_info(system_id, content_type, accept, targets, **kwargs) # noqa: E501 + (data) = self.graph_system_associations_list_with_http_info(system_id, targets, **kwargs) # noqa: E501 return data - def graph_system_associations_list_with_http_info(self, system_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_system_associations_list_with_http_info(self, system_id, targets, **kwargs): # noqa: E501 """List the associations of a System # noqa: E501 This endpoint returns the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_associations_list_with_http_info(system_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_system_associations_list_with_http_info(system_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"system\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'targets', 'limit', 'skip', '_date', 'authorization', 'x_org_id'] # noqa: E501 + all_params = ['system_id', 'targets', 'limit', 'skip', '_date', 'authorization', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -4322,21 +4983,11 @@ def graph_system_associations_list_with_http_info(self, system_id, content_type, if ('system_id' not in params or params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `graph_system_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_associations_list`") # noqa: E501 # verify the required parameter 'targets' is set if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_system_associations_list`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -4344,19 +4995,15 @@ def graph_system_associations_list_with_http_info(self, system_id, content_type, path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] + if 'targets' in params: + query_params.append(('targets', params['targets'])) # noqa: E501 + collection_formats['targets'] = 'csv' # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 - if 'targets' in params: - query_params.append(('targets', params['targets'])) # noqa: E501 - collection_formats['targets'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if '_date' in params: header_params['Date'] = params['_date'] # noqa: E501 if 'authorization' in params: @@ -4372,10 +5019,6 @@ def graph_system_associations_list_with_http_info(self, system_id, content_type, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -4395,57 +5038,53 @@ def graph_system_associations_list_with_http_info(self, system_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_associations_post(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_associations_post(self, system_id, **kwargs): # noqa: E501 """Manage associations of a System # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_associations_post(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_associations_post(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGraphManagementReq body: + :param GraphOperationSystem body: :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_associations_post_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_associations_post_with_http_info(system_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_associations_post_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_associations_post_with_http_info(system_id, **kwargs) # noqa: E501 return data - def graph_system_associations_post_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_associations_post_with_http_info(self, system_id, **kwargs): # noqa: E501 """Manage associations of a System # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_associations_post_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_associations_post_with_http_info(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGraphManagementReq body: + :param GraphOperationSystem body: :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'body', '_date', 'authorization', 'x_org_id'] # noqa: E501 + all_params = ['system_id', 'body', '_date', 'authorization', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -4464,14 +5103,6 @@ def graph_system_associations_post_with_http_info(self, system_id, content_type, if ('system_id' not in params or params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `graph_system_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_associations_post`") # noqa: E501 collection_formats = {} @@ -4482,10 +5113,6 @@ def graph_system_associations_post_with_http_info(self, system_id, content_type, query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if '_date' in params: header_params['Date'] = params['_date'] # noqa: E501 if 'authorization' in params: @@ -4499,10 +5126,6 @@ def graph_system_associations_post_with_http_info(self, system_id, content_type, body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -4526,57 +5149,53 @@ def graph_system_associations_post_with_http_info(self, system_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_associations_list(self, group_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_system_group_associations_list(self, group_id, targets, **kwargs): # noqa: E501 """List the associations of a System Group # noqa: E501 This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_associations_list(group_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_system_group_associations_list(group_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"system_group\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_associations_list_with_http_info(group_id, content_type, accept, targets, **kwargs) # noqa: E501 + return self.graph_system_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_associations_list_with_http_info(group_id, content_type, accept, targets, **kwargs) # noqa: E501 + (data) = self.graph_system_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 return data - def graph_system_group_associations_list_with_http_info(self, group_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_system_group_associations_list_with_http_info(self, group_id, targets, **kwargs): # noqa: E501 """List the associations of a System Group # noqa: E501 This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_associations_list_with_http_info(group_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_system_group_associations_list_with_http_info(group_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"system_group\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -4595,21 +5214,11 @@ def graph_system_group_associations_list_with_http_info(self, group_id, content_ if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_associations_list`") # noqa: E501 # verify the required parameter 'targets' is set if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_system_group_associations_list`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -4617,19 +5226,15 @@ def graph_system_group_associations_list_with_http_info(self, group_id, content_ path_params['group_id'] = params['group_id'] # noqa: E501 query_params = [] + if 'targets' in params: + query_params.append(('targets', params['targets'])) # noqa: E501 + collection_formats['targets'] = 'csv' # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 - if 'targets' in params: - query_params.append(('targets', params['targets'])) # noqa: E501 - collection_formats['targets'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -4641,10 +5246,6 @@ def graph_system_group_associations_list_with_http_info(self, group_id, content_ header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -4664,53 +5265,49 @@ def graph_system_group_associations_list_with_http_info(self, group_id, content_ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_associations_post(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_associations_post(self, group_id, **kwargs): # noqa: E501 """Manage the associations of a System Group # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_associations_post(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_associations_post(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGroupGraphManagementReq body: - :param str x_org_id: + :param GraphOperationSystemGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_associations_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_associations_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_associations_post_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_associations_post_with_http_info(self, group_id, **kwargs): # noqa: E501 """Manage the associations of a System Group # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_associations_post_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_associations_post_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGroupGraphManagementReq body: - :param str x_org_id: + :param GraphOperationSystemGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -4729,169 +5326,16 @@ def graph_system_group_associations_post_with_http_info(self, group_id, content_ if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_associations_post`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'group_id' in params: - path_params['group_id'] = params['group_id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - if 'x_org_id' in params: - header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/systemgroups/{group_id}/associations', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def graph_system_group_member_of(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the System Group's parents # noqa: E501 - - This endpoint returns all System Groups a System Group is a member of. This endpoint is not yet public as we haven't completed the code yet. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_member_of(group_id, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: - :return: list[GraphObjectWithPaths] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.graph_system_group_member_of_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 - else: - (data) = self.graph_system_group_member_of_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 - return data - - def graph_system_group_member_of_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the System Group's parents # noqa: E501 - - This endpoint returns all System Groups a System Group is a member of. This endpoint is not yet public as we haven't completed the code yet. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_member_of_with_http_info(group_id, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: - :return: list[GraphObjectWithPaths] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['group_id', 'content_type', 'accept', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method graph_system_group_member_of" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'group_id' is set - if ('group_id' not in params or - params['group_id'] is None): - raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_member_of`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_member_of`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_member_of`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_member_of`, must be a value greater than or equal to `0`") # noqa: E501 - collection_formats = {} - - path_params = {} - if 'group_id' in params: - path_params['group_id'] = params['group_id'] # noqa: E501 - - query_params = [] - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 - collection_formats['filter'] = 'csv' # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - collection_formats['sort'] = 'csv' # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -4899,10 +5343,8 @@ def graph_system_group_member_of_with_http_info(self, group_id, content_type, ac local_var_files = {} body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - + if 'body' in params: + body_params = params['body'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -4911,14 +5353,14 @@ def graph_system_group_member_of_with_http_info(self, group_id, content_type, ac auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systemgroups/{group_id}/memberof', 'GET', + '/systemgroups/{group_id}/associations', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[GraphObjectWithPaths]', # noqa: E501 + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -4926,55 +5368,51 @@ def graph_system_group_member_of_with_http_info(self, group_id, content_type, ac _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_members_list(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_members_list(self, group_id, **kwargs): # noqa: E501 """List the members of a System Group # noqa: E501 This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_members_list(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_members_list(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_members_list_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_members_list_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_members_list_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_members_list_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the members of a System Group # noqa: E501 This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_members_list_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_members_list_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -4993,17 +5431,7 @@ def graph_system_group_members_list_with_http_info(self, group_id, content_type, if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_members_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_members_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_members_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_members_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -5017,10 +5445,6 @@ def graph_system_group_members_list_with_http_info(self, group_id, content_type, query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -5032,10 +5456,6 @@ def graph_system_group_members_list_with_http_info(self, group_id, content_type, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -5055,57 +5475,53 @@ def graph_system_group_members_list_with_http_info(self, group_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_members_post(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_members_post(self, group_id, **kwargs): # noqa: E501 """Manage the members of a System Group # noqa: E501 - This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_members_post(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_members_post(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGroupMembersReq body: + :param GraphOperationSystemGroupMember body: :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_members_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_members_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_members_post_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_members_post_with_http_info(self, group_id, **kwargs): # noqa: E501 """Manage the members of a System Group # noqa: E501 - This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_members_post_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_members_post_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGroupMembersReq body: + :param GraphOperationSystemGroupMember body: :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'body', '_date', 'authorization', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'body', '_date', 'authorization', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -5124,14 +5540,6 @@ def graph_system_group_members_post_with_http_info(self, group_id, content_type, if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_members_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_members_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_members_post`") # noqa: E501 collection_formats = {} @@ -5142,10 +5550,6 @@ def graph_system_group_members_post_with_http_info(self, group_id, content_type, query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if '_date' in params: header_params['Date'] = params['_date'] # noqa: E501 if 'authorization' in params: @@ -5159,10 +5563,6 @@ def graph_system_group_members_post_with_http_info(self, group_id, content_type, body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -5186,59 +5586,55 @@ def graph_system_group_members_post_with_http_info(self, group_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_membership(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_membership(self, group_id, **kwargs): # noqa: E501 """List the System Group's membership # noqa: E501 This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_membership(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_membership(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param str x_org_id: + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_membership_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_membership_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_membership_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_membership_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the System Group's membership # noqa: E501 This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_membership_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_membership_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param str x_org_id: + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'skip', 'sort', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'limit', 'skip', 'sort', 'filter', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -5257,17 +5653,7 @@ def graph_system_group_membership_with_http_info(self, group_id, content_type, a if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_membership`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_membership`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_membership`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_membership`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -5287,10 +5673,6 @@ def graph_system_group_membership_with_http_info(self, group_id, content_type, a collection_formats['filter'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -5302,10 +5684,6 @@ def graph_system_group_membership_with_http_info(self, group_id, content_type, a header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -5325,57 +5703,53 @@ def graph_system_group_membership_with_http_info(self, group_id, content_type, a _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_traverse_command(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_command(self, group_id, **kwargs): # noqa: E501 """List the Commands bound to a System Group # noqa: E501 This endpoint will return all Commands bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_command(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_command(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_traverse_command_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_traverse_command_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_traverse_command_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_traverse_command_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_traverse_command_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_command_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Commands bound to a System Group # noqa: E501 This endpoint will return all Commands bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_command_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_command_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -5394,17 +5768,7 @@ def graph_system_group_traverse_command_with_http_info(self, group_id, content_t if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_traverse_command`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_traverse_command`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_traverse_command`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_traverse_command`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -5423,10 +5787,6 @@ def graph_system_group_traverse_command_with_http_info(self, group_id, content_t header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -5436,10 +5796,6 @@ def graph_system_group_traverse_command_with_http_info(self, group_id, content_t header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -5459,57 +5815,53 @@ def graph_system_group_traverse_command_with_http_info(self, group_id, content_t _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_traverse_policy(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_policy(self, group_id, **kwargs): # noqa: E501 """List the Policies bound to a System Group # noqa: E501 This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_policy(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_policy(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_traverse_policy_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_traverse_policy_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_traverse_policy_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_traverse_policy_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_traverse_policy_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_policy_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Policies bound to a System Group # noqa: E501 This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_policy_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_policy_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -5528,17 +5880,7 @@ def graph_system_group_traverse_policy_with_http_info(self, group_id, content_ty if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_traverse_policy`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_traverse_policy`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_traverse_policy`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_traverse_policy`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -5557,10 +5899,6 @@ def graph_system_group_traverse_policy_with_http_info(self, group_id, content_ty header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -5570,15 +5908,123 @@ def graph_system_group_traverse_policy_with_http_info(self, group_id, content_ty header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systemgroups/{group_id}/policies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_system_group_traverse_policy_group(self, group_id, **kwargs): # noqa: E501 + """List the Policy Groups bound to a System Group # noqa: E501 + + This endpoint will return all Policy Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_system_group_traverse_policy_group(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the System Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_system_group_traverse_policy_group_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_system_group_traverse_policy_group_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def graph_system_group_traverse_policy_group_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the Policy Groups bound to a System Group # noqa: E501 + + This endpoint will return all Policy Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_system_group_traverse_policy_group_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the System Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_system_group_traverse_policy_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_traverse_policy_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systemgroups/{group_id}/policies', 'GET', + '/systemgroups/{group_id}/policygroups', 'GET', path_params, query_params, header_params, @@ -5593,57 +6039,53 @@ def graph_system_group_traverse_policy_with_http_info(self, group_id, content_ty _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_traverse_user(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_user(self, group_id, **kwargs): # noqa: E501 """List the Users bound to a System Group # noqa: E501 This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_user(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_user(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_traverse_user_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_traverse_user_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_traverse_user_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_traverse_user_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_traverse_user_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_user_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Users bound to a System Group # noqa: E501 This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_user_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_user_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -5662,17 +6104,7 @@ def graph_system_group_traverse_user_with_http_info(self, group_id, content_type if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_traverse_user`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_traverse_user`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_traverse_user`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_traverse_user`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -5691,10 +6123,6 @@ def graph_system_group_traverse_user_with_http_info(self, group_id, content_type header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -5704,10 +6132,6 @@ def graph_system_group_traverse_user_with_http_info(self, group_id, content_type header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -5727,57 +6151,53 @@ def graph_system_group_traverse_user_with_http_info(self, group_id, content_type _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_traverse_user_group(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_user_group(self, group_id, **kwargs): # noqa: E501 """List the User Groups bound to a System Group # noqa: E501 This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_user_group(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_user_group(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_traverse_user_group_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_traverse_user_group_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_traverse_user_group_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_traverse_user_group_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_traverse_user_group_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_user_group_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the User Groups bound to a System Group # noqa: E501 This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_user_group_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_user_group_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -5796,17 +6216,7 @@ def graph_system_group_traverse_user_group_with_http_info(self, group_id, conten if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_traverse_user_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_traverse_user_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_traverse_user_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_traverse_user_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -5825,10 +6235,6 @@ def graph_system_group_traverse_user_group_with_http_info(self, group_id, conten header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -5838,10 +6244,6 @@ def graph_system_group_traverse_user_group_with_http_info(self, group_id, conten header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -5861,63 +6263,59 @@ def graph_system_group_traverse_user_group_with_http_info(self, group_id, conten _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_member_of(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_member_of(self, system_id, **kwargs): # noqa: E501 """List the parent Groups of a System # noqa: E501 This endpoint returns all the System Groups a System is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_member_of(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_member_of(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_member_of_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_member_of_with_http_info(system_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_member_of_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_member_of_with_http_info(system_id, **kwargs) # noqa: E501 return data - def graph_system_member_of_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_member_of_with_http_info(self, system_id, **kwargs): # noqa: E501 """List the parent Groups of a System # noqa: E501 This endpoint returns all the System Groups a System is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_member_of_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_member_of_with_http_info(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'filter', 'limit', 'skip', '_date', 'authorization', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['system_id', 'filter', 'limit', 'skip', '_date', 'authorization', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -5936,17 +6334,7 @@ def graph_system_member_of_with_http_info(self, system_id, content_type, accept, if ('system_id' not in params or params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `graph_system_member_of`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_member_of`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_member_of`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_member_of`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -5966,10 +6354,6 @@ def graph_system_member_of_with_http_info(self, system_id, content_type, accept, collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if '_date' in params: header_params['Date'] = params['_date'] # noqa: E501 if 'authorization' in params: @@ -5985,10 +6369,6 @@ def graph_system_member_of_with_http_info(self, system_id, content_type, accept, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -6008,57 +6388,53 @@ def graph_system_member_of_with_http_info(self, system_id, content_type, accept, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_traverse_command(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_traverse_command(self, system_id, **kwargs): # noqa: E501 """List the Commands bound to a System # noqa: E501 This endpoint will return all Commands bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_traverse_command(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_traverse_command(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_traverse_command_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_traverse_command_with_http_info(system_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_traverse_command_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_traverse_command_with_http_info(system_id, **kwargs) # noqa: E501 return data - def graph_system_traverse_command_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_traverse_command_with_http_info(self, system_id, **kwargs): # noqa: E501 """List the Commands bound to a System # noqa: E501 This endpoint will return all Commands bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_traverse_command_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_traverse_command_with_http_info(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['system_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -6077,17 +6453,7 @@ def graph_system_traverse_command_with_http_info(self, system_id, content_type, if ('system_id' not in params or params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `graph_system_traverse_command`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_traverse_command`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_traverse_command`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_traverse_command`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -6106,10 +6472,6 @@ def graph_system_traverse_command_with_http_info(self, system_id, content_type, header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -6119,10 +6481,6 @@ def graph_system_traverse_command_with_http_info(self, system_id, content_type, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -6142,57 +6500,53 @@ def graph_system_traverse_command_with_http_info(self, system_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_traverse_policy(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_traverse_policy(self, system_id, **kwargs): # noqa: E501 """List the Policies bound to a System # noqa: E501 This endpoint will return all Policies bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not yet public as we have finish the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/{System_ID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_traverse_policy(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_traverse_policy(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_traverse_policy_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_traverse_policy_with_http_info(system_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_traverse_policy_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_traverse_policy_with_http_info(system_id, **kwargs) # noqa: E501 return data - def graph_system_traverse_policy_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_traverse_policy_with_http_info(self, system_id, **kwargs): # noqa: E501 """List the Policies bound to a System # noqa: E501 This endpoint will return all Policies bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not yet public as we have finish the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/{System_ID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_traverse_policy_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_traverse_policy_with_http_info(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['system_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -6211,17 +6565,7 @@ def graph_system_traverse_policy_with_http_info(self, system_id, content_type, a if ('system_id' not in params or params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `graph_system_traverse_policy`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_traverse_policy`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_traverse_policy`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_traverse_policy`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -6240,10 +6584,6 @@ def graph_system_traverse_policy_with_http_info(self, system_id, content_type, a header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -6253,15 +6593,131 @@ def graph_system_traverse_policy_with_http_info(self, system_id, content_type, a header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systems/{system_id}/policies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_system_traverse_policy_group(self, system_id, **kwargs): # noqa: E501 + """List the Policy Groups bound to a System # noqa: E501 + + This endpoint will return all Policy Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_system_traverse_policy_group(system_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str system_id: ObjectID of the System. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param str _date: Current date header for the System Context API + :param str authorization: Authorization header for the System Context API + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_system_traverse_policy_group_with_http_info(system_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_system_traverse_policy_group_with_http_info(system_id, **kwargs) # noqa: E501 + return data + + def graph_system_traverse_policy_group_with_http_info(self, system_id, **kwargs): # noqa: E501 + """List the Policy Groups bound to a System # noqa: E501 + + This endpoint will return all Policy Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_system_traverse_policy_group_with_http_info(system_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str system_id: ObjectID of the System. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param str _date: Current date header for the System Context API + :param str authorization: Authorization header for the System Context API + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['system_id', 'limit', 'x_org_id', 'skip', '_date', 'authorization', 'filter'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_system_traverse_policy_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'system_id' is set + if ('system_id' not in params or + params['system_id'] is None): + raise ValueError("Missing the required parameter `system_id` when calling `graph_system_traverse_policy_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'system_id' in params: + path_params['system_id'] = params['system_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + if '_date' in params: + header_params['Date'] = params['_date'] # noqa: E501 + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systems/{system_id}/policies', 'GET', + '/systems/{system_id}/policygroups', 'GET', path_params, query_params, header_params, @@ -6276,61 +6732,57 @@ def graph_system_traverse_policy_with_http_info(self, system_id, content_type, a _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_traverse_user(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_traverse_user(self, system_id, **kwargs): # noqa: E501 """List the Users bound to a System # noqa: E501 This endpoint will return all Users bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_traverse_user(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_traverse_user(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_traverse_user_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_traverse_user_with_http_info(system_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_traverse_user_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_traverse_user_with_http_info(system_id, **kwargs) # noqa: E501 return data - def graph_system_traverse_user_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_traverse_user_with_http_info(self, system_id, **kwargs): # noqa: E501 """List the Users bound to a System # noqa: E501 This endpoint will return all Users bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_traverse_user_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_traverse_user_with_http_info(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', '_date', 'authorization', 'filter'] # noqa: E501 + all_params = ['system_id', 'limit', 'x_org_id', 'skip', '_date', 'authorization', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -6349,17 +6801,7 @@ def graph_system_traverse_user_with_http_info(self, system_id, content_type, acc if ('system_id' not in params or params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `graph_system_traverse_user`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_traverse_user`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_traverse_user`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_traverse_user`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -6378,10 +6820,6 @@ def graph_system_traverse_user_with_http_info(self, system_id, content_type, acc header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if '_date' in params: header_params['Date'] = params['_date'] # noqa: E501 if 'authorization' in params: @@ -6395,10 +6833,6 @@ def graph_system_traverse_user_with_http_info(self, system_id, content_type, acc header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -6418,61 +6852,57 @@ def graph_system_traverse_user_with_http_info(self, system_id, content_type, acc _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_traverse_user_group(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_traverse_user_group(self, system_id, **kwargs): # noqa: E501 """List the User Groups bound to a System # noqa: E501 This endpoint will return all User Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_traverse_user_group(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_traverse_user_group(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_traverse_user_group_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_traverse_user_group_with_http_info(system_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_traverse_user_group_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_traverse_user_group_with_http_info(system_id, **kwargs) # noqa: E501 return data - def graph_system_traverse_user_group_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_traverse_user_group_with_http_info(self, system_id, **kwargs): # noqa: E501 """List the User Groups bound to a System # noqa: E501 This endpoint will return all User Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_traverse_user_group_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_traverse_user_group_with_http_info(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', '_date', 'authorization', 'filter'] # noqa: E501 + all_params = ['system_id', 'limit', 'x_org_id', 'skip', '_date', 'authorization', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -6491,17 +6921,7 @@ def graph_system_traverse_user_group_with_http_info(self, system_id, content_typ if ('system_id' not in params or params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `graph_system_traverse_user_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_traverse_user_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_traverse_user_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_traverse_user_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -6520,10 +6940,6 @@ def graph_system_traverse_user_group_with_http_info(self, system_id, content_typ header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if '_date' in params: header_params['Date'] = params['_date'] # noqa: E501 if 'authorization' in params: @@ -6537,10 +6953,6 @@ def graph_system_traverse_user_group_with_http_info(self, system_id, content_typ header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -6560,57 +6972,53 @@ def graph_system_traverse_user_group_with_http_info(self, system_id, content_typ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_associations_list(self, user_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_user_associations_list(self, user_id, targets, **kwargs): # noqa: E501 """List the associations of a User # noqa: E501 This endpoint returns the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_associations_list(user_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_user_associations_list(user_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"user\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_associations_list_with_http_info(user_id, content_type, accept, targets, **kwargs) # noqa: E501 + return self.graph_user_associations_list_with_http_info(user_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_user_associations_list_with_http_info(user_id, content_type, accept, targets, **kwargs) # noqa: E501 + (data) = self.graph_user_associations_list_with_http_info(user_id, targets, **kwargs) # noqa: E501 return data - def graph_user_associations_list_with_http_info(self, user_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_user_associations_list_with_http_info(self, user_id, targets, **kwargs): # noqa: E501 """List the associations of a User # noqa: E501 This endpoint returns the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_associations_list_with_http_info(user_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_user_associations_list_with_http_info(user_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"user\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['user_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -6629,21 +7037,11 @@ def graph_user_associations_list_with_http_info(self, user_id, content_type, acc if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_associations_list`") # noqa: E501 # verify the required parameter 'targets' is set if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_user_associations_list`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -6651,19 +7049,15 @@ def graph_user_associations_list_with_http_info(self, user_id, content_type, acc path_params['user_id'] = params['user_id'] # noqa: E501 query_params = [] + if 'targets' in params: + query_params.append(('targets', params['targets'])) # noqa: E501 + collection_formats['targets'] = 'csv' # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 - if 'targets' in params: - query_params.append(('targets', params['targets'])) # noqa: E501 - collection_formats['targets'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -6675,10 +7069,6 @@ def graph_user_associations_list_with_http_info(self, user_id, content_type, acc header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -6698,53 +7088,49 @@ def graph_user_associations_list_with_http_info(self, user_id, content_type, acc _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_associations_post(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_associations_post(self, user_id, **kwargs): # noqa: E501 """Manage the associations of a User # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_associations_post(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_associations_post(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGraphManagementReq body: - :param str x_org_id: + :param GraphOperationUser body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_associations_post_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_associations_post_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_associations_post_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_associations_post_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_associations_post_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_associations_post_with_http_info(self, user_id, **kwargs): # noqa: E501 """Manage the associations of a User # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_associations_post_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_associations_post_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGraphManagementReq body: - :param str x_org_id: + :param GraphOperationUser body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['user_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -6763,14 +7149,6 @@ def graph_user_associations_post_with_http_info(self, user_id, content_type, acc if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_associations_post`") # noqa: E501 collection_formats = {} @@ -6781,10 +7159,6 @@ def graph_user_associations_post_with_http_info(self, user_id, content_type, acc query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -6794,10 +7168,6 @@ def graph_user_associations_post_with_http_info(self, user_id, content_type, acc body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -6821,57 +7191,53 @@ def graph_user_associations_post_with_http_info(self, user_id, content_type, acc _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_associations_list(self, group_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_user_group_associations_list(self, group_id, targets, **kwargs): # noqa: E501 """List the associations of a User Group. # noqa: E501 This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_associations_list(group_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_user_group_associations_list(group_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"user_group\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_associations_list_with_http_info(group_id, content_type, accept, targets, **kwargs) # noqa: E501 + return self.graph_user_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_associations_list_with_http_info(group_id, content_type, accept, targets, **kwargs) # noqa: E501 + (data) = self.graph_user_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 return data - def graph_user_group_associations_list_with_http_info(self, group_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_user_group_associations_list_with_http_info(self, group_id, targets, **kwargs): # noqa: E501 """List the associations of a User Group. # noqa: E501 This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_associations_list_with_http_info(group_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_user_group_associations_list_with_http_info(group_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"user_group\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -6890,21 +7256,11 @@ def graph_user_group_associations_list_with_http_info(self, group_id, content_ty if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_associations_list`") # noqa: E501 # verify the required parameter 'targets' is set if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_user_group_associations_list`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -6912,19 +7268,15 @@ def graph_user_group_associations_list_with_http_info(self, group_id, content_ty path_params['group_id'] = params['group_id'] # noqa: E501 query_params = [] + if 'targets' in params: + query_params.append(('targets', params['targets'])) # noqa: E501 + collection_formats['targets'] = 'csv' # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 - if 'targets' in params: - query_params.append(('targets', params['targets'])) # noqa: E501 - collection_formats['targets'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -6936,10 +7288,6 @@ def graph_user_group_associations_list_with_http_info(self, group_id, content_ty header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -6959,53 +7307,49 @@ def graph_user_group_associations_list_with_http_info(self, group_id, content_ty _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_associations_post(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_associations_post(self, group_id, **kwargs): # noqa: E501 """Manage the associations of a User Group # noqa: E501 - This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 + This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_associations_post(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_associations_post(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGroupGraphManagementReq body: - :param str x_org_id: + :param GraphOperationUserGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_associations_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_associations_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_associations_post_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_associations_post_with_http_info(self, group_id, **kwargs): # noqa: E501 """Manage the associations of a User Group # noqa: E501 - This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 + This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_associations_post_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_associations_post_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGroupGraphManagementReq body: - :param str x_org_id: + :param GraphOperationUserGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -7024,14 +7368,6 @@ def graph_user_group_associations_post_with_http_info(self, group_id, content_ty if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_associations_post`") # noqa: E501 collection_formats = {} @@ -7042,10 +7378,6 @@ def graph_user_group_associations_post_with_http_info(self, group_id, content_ty query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -7055,10 +7387,6 @@ def graph_user_group_associations_post_with_http_info(self, group_id, content_ty body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -7082,194 +7410,51 @@ def graph_user_group_associations_post_with_http_info(self, group_id, content_ty _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_member_of(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the User Group's parents # noqa: E501 - - This endpoint returns all User Groups a User Group is a member of. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{group_id}/memberof ``` Not public yet, as the code is not finished, # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_member_of(group_id, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: - :return: list[GraphObjectWithPaths] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.graph_user_group_member_of_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 - else: - (data) = self.graph_user_group_member_of_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 - return data - - def graph_user_group_member_of_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the User Group's parents # noqa: E501 - - This endpoint returns all User Groups a User Group is a member of. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{group_id}/memberof ``` Not public yet, as the code is not finished, # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_member_of_with_http_info(group_id, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: - :return: list[GraphObjectWithPaths] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['group_id', 'content_type', 'accept', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method graph_user_group_member_of" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'group_id' is set - if ('group_id' not in params or - params['group_id'] is None): - raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_member_of`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_member_of`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_member_of`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_member_of`, must be a value greater than or equal to `0`") # noqa: E501 - collection_formats = {} - - path_params = {} - if 'group_id' in params: - path_params['group_id'] = params['group_id'] # noqa: E501 - - query_params = [] - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 - collection_formats['filter'] = 'csv' # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - collection_formats['sort'] = 'csv' # noqa: E501 - - header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - if 'x_org_id' in params: - header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/usergroups/{group_id}/memberof', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[GraphObjectWithPaths]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def graph_user_group_members_list(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_members_list(self, group_id, **kwargs): # noqa: E501 """List the members of a User Group # noqa: E501 This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_members_list(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_members_list(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_members_list_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_members_list_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_members_list_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_members_list_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the members of a User Group # noqa: E501 This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_members_list_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_members_list_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -7288,17 +7473,7 @@ def graph_user_group_members_list_with_http_info(self, group_id, content_type, a if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_members_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_members_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_members_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_members_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -7312,10 +7487,6 @@ def graph_user_group_members_list_with_http_info(self, group_id, content_type, a query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -7327,10 +7498,6 @@ def graph_user_group_members_list_with_http_info(self, group_id, content_type, a header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -7350,53 +7517,49 @@ def graph_user_group_members_list_with_http_info(self, group_id, content_type, a _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_members_post(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_members_post(self, group_id, **kwargs): # noqa: E501 """Manage the members of a User Group # noqa: E501 - This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_members_post(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_members_post(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGroupMembersReq body: - :param str x_org_id: + :param GraphOperationUserGroupMember body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_members_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_members_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_members_post_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_members_post_with_http_info(self, group_id, **kwargs): # noqa: E501 """Manage the members of a User Group # noqa: E501 - This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_members_post_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_members_post_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGroupMembersReq body: - :param str x_org_id: + :param GraphOperationUserGroupMember body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -7415,14 +7578,6 @@ def graph_user_group_members_post_with_http_info(self, group_id, content_type, a if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_members_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_members_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_members_post`") # noqa: E501 collection_formats = {} @@ -7433,10 +7588,6 @@ def graph_user_group_members_post_with_http_info(self, group_id, content_type, a query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -7446,10 +7597,6 @@ def graph_user_group_members_post_with_http_info(self, group_id, content_type, a body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -7473,59 +7620,55 @@ def graph_user_group_members_post_with_http_info(self, group_id, content_type, a _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_membership(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_membership(self, group_id, **kwargs): # noqa: E501 """List the User Group's membership # noqa: E501 This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_membership(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_membership(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_membership_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_membership_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_membership_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_membership_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the User Group's membership # noqa: E501 This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_membership_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_membership_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -7544,17 +7687,7 @@ def graph_user_group_membership_with_http_info(self, group_id, content_type, acc if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_membership`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_membership`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_membership`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_membership`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -7574,10 +7707,6 @@ def graph_user_group_membership_with_http_info(self, group_id, content_type, acc collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -7589,10 +7718,6 @@ def graph_user_group_membership_with_http_info(self, group_id, content_type, acc header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -7612,57 +7737,53 @@ def graph_user_group_membership_with_http_info(self, group_id, content_type, acc _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_active_directory(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_active_directory(self, group_id, **kwargs): # noqa: E501 """List the Active Directories bound to a User Group # noqa: E501 This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_active_directory(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_active_directory(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_active_directory_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_active_directory_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_active_directory_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_active_directory_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_active_directory_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_active_directory_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Active Directories bound to a User Group # noqa: E501 This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_active_directory_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_active_directory_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -7681,17 +7802,7 @@ def graph_user_group_traverse_active_directory_with_http_info(self, group_id, co if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_active_directory`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_active_directory`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_active_directory`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_active_directory`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -7710,10 +7821,6 @@ def graph_user_group_traverse_active_directory_with_http_info(self, group_id, co header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -7723,10 +7830,6 @@ def graph_user_group_traverse_active_directory_with_http_info(self, group_id, co header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -7746,57 +7849,53 @@ def graph_user_group_traverse_active_directory_with_http_info(self, group_id, co _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_application(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_application(self, group_id, **kwargs): # noqa: E501 """List the Applications bound to a User Group # noqa: E501 This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_application(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_application(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_application_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_application_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_application_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_application_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_application_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_application_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Applications bound to a User Group # noqa: E501 This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_application_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_application_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -7815,17 +7914,7 @@ def graph_user_group_traverse_application_with_http_info(self, group_id, content if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_application`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_application`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_application`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_application`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -7844,10 +7933,6 @@ def graph_user_group_traverse_application_with_http_info(self, group_id, content header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -7857,10 +7942,6 @@ def graph_user_group_traverse_application_with_http_info(self, group_id, content header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -7880,57 +7961,53 @@ def graph_user_group_traverse_application_with_http_info(self, group_id, content _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_directory(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_directory(self, group_id, **kwargs): # noqa: E501 """List the Directories bound to a User Group # noqa: E501 This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_directory(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_directory(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_directory_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_directory_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_directory_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_directory_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_directory_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_directory_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Directories bound to a User Group # noqa: E501 This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_directory_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_directory_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -7949,17 +8026,7 @@ def graph_user_group_traverse_directory_with_http_info(self, group_id, content_t if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_directory`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_directory`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_directory`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_directory`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -7978,10 +8045,6 @@ def graph_user_group_traverse_directory_with_http_info(self, group_id, content_t header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -7991,10 +8054,6 @@ def graph_user_group_traverse_directory_with_http_info(self, group_id, content_t header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -8014,57 +8073,53 @@ def graph_user_group_traverse_directory_with_http_info(self, group_id, content_t _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_g_suite(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_g_suite(self, group_id, **kwargs): # noqa: E501 """List the G Suite instances bound to a User Group # noqa: E501 This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_g_suite(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_g_suite(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_g_suite_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_g_suite_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_g_suite_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_g_suite_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_g_suite_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_g_suite_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the G Suite instances bound to a User Group # noqa: E501 This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_g_suite_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_g_suite_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -8083,17 +8138,7 @@ def graph_user_group_traverse_g_suite_with_http_info(self, group_id, content_typ if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_g_suite`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_g_suite`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_g_suite`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_g_suite`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -8112,10 +8157,6 @@ def graph_user_group_traverse_g_suite_with_http_info(self, group_id, content_typ header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -8125,10 +8166,6 @@ def graph_user_group_traverse_g_suite_with_http_info(self, group_id, content_typ header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -8148,57 +8185,53 @@ def graph_user_group_traverse_g_suite_with_http_info(self, group_id, content_typ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_ldap_server(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_ldap_server(self, group_id, **kwargs): # noqa: E501 """List the LDAP Servers bound to a User Group # noqa: E501 This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_ldap_server(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_ldap_server(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_ldap_server_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_ldap_server_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_ldap_server_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_ldap_server_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the LDAP Servers bound to a User Group # noqa: E501 This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_ldap_server_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_ldap_server_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -8217,17 +8250,7 @@ def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, content if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_ldap_server`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_ldap_server`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_ldap_server`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_ldap_server`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -8246,10 +8269,6 @@ def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, content header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -8259,10 +8278,6 @@ def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, content header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -8282,57 +8297,53 @@ def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, content _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_office365(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_office365(self, group_id, **kwargs): # noqa: E501 """List the Office 365 instances bound to a User Group # noqa: E501 This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_office365(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_office365(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_office365_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_office365_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_office365_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_office365_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_office365_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_office365_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Office 365 instances bound to a User Group # noqa: E501 This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_office365_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_office365_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -8351,17 +8362,7 @@ def graph_user_group_traverse_office365_with_http_info(self, group_id, content_t if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_office365`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_office365`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_office365`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_office365`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -8380,10 +8381,6 @@ def graph_user_group_traverse_office365_with_http_info(self, group_id, content_t header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -8393,10 +8390,6 @@ def graph_user_group_traverse_office365_with_http_info(self, group_id, content_t header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -8416,57 +8409,53 @@ def graph_user_group_traverse_office365_with_http_info(self, group_id, content_t _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_radius_server(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_radius_server(self, group_id, **kwargs): # noqa: E501 """List the RADIUS Servers bound to a User Group # noqa: E501 This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_radius_server(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_radius_server(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_radius_server_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_radius_server_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_radius_server_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_radius_server_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_radius_server_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_radius_server_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the RADIUS Servers bound to a User Group # noqa: E501 This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_radius_server_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_radius_server_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -8485,17 +8474,7 @@ def graph_user_group_traverse_radius_server_with_http_info(self, group_id, conte if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_radius_server`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_radius_server`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_radius_server`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_radius_server`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -8514,10 +8493,6 @@ def graph_user_group_traverse_radius_server_with_http_info(self, group_id, conte header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -8527,10 +8502,6 @@ def graph_user_group_traverse_radius_server_with_http_info(self, group_id, conte header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -8550,57 +8521,53 @@ def graph_user_group_traverse_radius_server_with_http_info(self, group_id, conte _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_system(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_system(self, group_id, **kwargs): # noqa: E501 """List the Systems bound to a User Group # noqa: E501 This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_system(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_system(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_system_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_system_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_system_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_system_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_system_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_system_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Systems bound to a User Group # noqa: E501 This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_system_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_system_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -8619,17 +8586,7 @@ def graph_user_group_traverse_system_with_http_info(self, group_id, content_type if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_system`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_system`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_system`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_system`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -8648,10 +8605,6 @@ def graph_user_group_traverse_system_with_http_info(self, group_id, content_type header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -8661,10 +8614,6 @@ def graph_user_group_traverse_system_with_http_info(self, group_id, content_type header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -8684,57 +8633,53 @@ def graph_user_group_traverse_system_with_http_info(self, group_id, content_type _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_system_group(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_system_group(self, group_id, **kwargs): # noqa: E501 """List the System Groups bound to User Groups # noqa: E501 This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_system_group(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_system_group(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_system_group_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_system_group_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_system_group_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_system_group_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_system_group_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_system_group_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the System Groups bound to User Groups # noqa: E501 This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_system_group_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_system_group_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -8753,17 +8698,7 @@ def graph_user_group_traverse_system_group_with_http_info(self, group_id, conten if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_system_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_system_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_system_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_system_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -8782,10 +8717,6 @@ def graph_user_group_traverse_system_group_with_http_info(self, group_id, conten header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -8795,10 +8726,6 @@ def graph_user_group_traverse_system_group_with_http_info(self, group_id, conten header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -8818,59 +8745,55 @@ def graph_user_group_traverse_system_group_with_http_info(self, group_id, conten _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_member_of(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_member_of(self, user_id, **kwargs): # noqa: E501 """List the parent Groups of a User # noqa: E501 This endpoint returns all the User Groups a User is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_member_of(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_member_of(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_member_of_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_member_of_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_member_of_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_member_of_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_member_of_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_member_of_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the parent Groups of a User # noqa: E501 This endpoint returns all the User Groups a User is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_member_of_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_member_of_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['user_id', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -8889,17 +8812,7 @@ def graph_user_member_of_with_http_info(self, user_id, content_type, accept, **k if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_member_of`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_member_of`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_member_of`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_member_of`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -8919,10 +8832,6 @@ def graph_user_member_of_with_http_info(self, user_id, content_type, accept, **k collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -8934,10 +8843,6 @@ def graph_user_member_of_with_http_info(self, user_id, content_type, accept, **k header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -8957,22 +8862,20 @@ def graph_user_member_of_with_http_info(self, user_id, content_type, accept, **k _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_traverse_active_directory(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_active_directory(self, user_id, **kwargs): # noqa: E501 """List the Active Directory instances bound to a User # noqa: E501 This endpoint will return all Active Directory Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Active Directory instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_active_directory(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_active_directory(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. :return: list[GraphObjectWithPaths] If the method is called asynchronously, @@ -8980,34 +8883,32 @@ def graph_user_traverse_active_directory(self, user_id, content_type, accept, ** """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_traverse_active_directory_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_traverse_active_directory_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_traverse_active_directory_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_traverse_active_directory_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_traverse_active_directory_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_active_directory_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the Active Directory instances bound to a User # noqa: E501 This endpoint will return all Active Directory Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Active Directory instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_active_directory_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_active_directory_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'filter', 'limit', 'x_org_id', 'skip'] # noqa: E501 + all_params = ['user_id', 'filter', 'limit', 'x_org_id', 'skip'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -9026,17 +8927,7 @@ def graph_user_traverse_active_directory_with_http_info(self, user_id, content_t if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_active_directory`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_traverse_active_directory`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_traverse_active_directory`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_traverse_active_directory`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -9055,10 +8946,6 @@ def graph_user_traverse_active_directory_with_http_info(self, user_id, content_t header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -9068,10 +8955,6 @@ def graph_user_traverse_active_directory_with_http_info(self, user_id, content_t header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -9091,57 +8974,53 @@ def graph_user_traverse_active_directory_with_http_info(self, user_id, content_t _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_traverse_application(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_application(self, user_id, **kwargs): # noqa: E501 """List the Applications bound to a User # noqa: E501 This endpoint will return all Applications bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_application(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_application(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_traverse_application_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_traverse_application_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_traverse_application_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_traverse_application_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_traverse_application_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_application_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the Applications bound to a User # noqa: E501 This endpoint will return all Applications bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_application_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_application_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['user_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -9160,17 +9039,7 @@ def graph_user_traverse_application_with_http_info(self, user_id, content_type, if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_application`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_traverse_application`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_traverse_application`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_traverse_application`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -9189,10 +9058,6 @@ def graph_user_traverse_application_with_http_info(self, user_id, content_type, header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -9202,10 +9067,6 @@ def graph_user_traverse_application_with_http_info(self, user_id, content_type, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -9225,57 +9086,53 @@ def graph_user_traverse_application_with_http_info(self, user_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_traverse_directory(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_directory(self, user_id, **kwargs): # noqa: E501 """List the Directories bound to a User # noqa: E501 This endpoint will return all Directories bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directory from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_directory(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_directory(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_traverse_directory_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_traverse_directory_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_traverse_directory_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_traverse_directory_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_traverse_directory_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_directory_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the Directories bound to a User # noqa: E501 This endpoint will return all Directories bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directory from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_directory_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_directory_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['user_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -9294,17 +9151,7 @@ def graph_user_traverse_directory_with_http_info(self, user_id, content_type, ac if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_directory`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_traverse_directory`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_traverse_directory`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_traverse_directory`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -9323,10 +9170,6 @@ def graph_user_traverse_directory_with_http_info(self, user_id, content_type, ac header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -9336,10 +9179,6 @@ def graph_user_traverse_directory_with_http_info(self, user_id, content_type, ac header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -9359,57 +9198,53 @@ def graph_user_traverse_directory_with_http_info(self, user_id, content_type, ac _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_traverse_g_suite(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_g_suite(self, user_id, **kwargs): # noqa: E501 """List the G Suite instances bound to a User # noqa: E501 This endpoint will return all G-Suite Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_g_suite(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_g_suite(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_traverse_g_suite_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_traverse_g_suite_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_traverse_g_suite_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_traverse_g_suite_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_traverse_g_suite_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_g_suite_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the G Suite instances bound to a User # noqa: E501 This endpoint will return all G-Suite Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_g_suite_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_g_suite_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['user_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -9428,17 +9263,7 @@ def graph_user_traverse_g_suite_with_http_info(self, user_id, content_type, acce if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_g_suite`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_traverse_g_suite`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_traverse_g_suite`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_traverse_g_suite`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -9457,10 +9282,6 @@ def graph_user_traverse_g_suite_with_http_info(self, user_id, content_type, acce header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -9470,10 +9291,6 @@ def graph_user_traverse_g_suite_with_http_info(self, user_id, content_type, acce header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -9493,57 +9310,53 @@ def graph_user_traverse_g_suite_with_http_info(self, user_id, content_type, acce _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_traverse_ldap_server(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_ldap_server(self, user_id, **kwargs): # noqa: E501 """List the LDAP servers bound to a User # noqa: E501 This endpoint will return all LDAP Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_ldap_server(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_ldap_server(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_traverse_ldap_server_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_traverse_ldap_server_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_traverse_ldap_server_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_traverse_ldap_server_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_traverse_ldap_server_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_ldap_server_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the LDAP servers bound to a User # noqa: E501 This endpoint will return all LDAP Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_ldap_server_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_ldap_server_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['user_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -9562,17 +9375,7 @@ def graph_user_traverse_ldap_server_with_http_info(self, user_id, content_type, if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_ldap_server`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_traverse_ldap_server`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_traverse_ldap_server`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_traverse_ldap_server`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -9591,10 +9394,6 @@ def graph_user_traverse_ldap_server_with_http_info(self, user_id, content_type, header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -9604,10 +9403,6 @@ def graph_user_traverse_ldap_server_with_http_info(self, user_id, content_type, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -9627,57 +9422,53 @@ def graph_user_traverse_ldap_server_with_http_info(self, user_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_traverse_office365(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_office365(self, user_id, **kwargs): # noqa: E501 """List the Office 365 instances bound to a User # noqa: E501 This endpoint will return all Office 365 Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_office365(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_office365(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_traverse_office365_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_traverse_office365_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_traverse_office365_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_traverse_office365_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_traverse_office365_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_office365_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the Office 365 instances bound to a User # noqa: E501 This endpoint will return all Office 365 Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_office365_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_office365_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['user_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -9696,17 +9487,7 @@ def graph_user_traverse_office365_with_http_info(self, user_id, content_type, ac if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_office365`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_traverse_office365`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_traverse_office365`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_traverse_office365`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -9725,10 +9506,6 @@ def graph_user_traverse_office365_with_http_info(self, user_id, content_type, ac header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -9738,10 +9515,6 @@ def graph_user_traverse_office365_with_http_info(self, user_id, content_type, ac header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -9761,57 +9534,53 @@ def graph_user_traverse_office365_with_http_info(self, user_id, content_type, ac _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_traverse_radius_server(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_radius_server(self, user_id, **kwargs): # noqa: E501 """List the RADIUS Servers bound to a User # noqa: E501 This endpoint will return all RADIUS Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_radius_server(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_radius_server(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_traverse_radius_server_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_traverse_radius_server_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_traverse_radius_server_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_traverse_radius_server_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_traverse_radius_server_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_radius_server_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the RADIUS Servers bound to a User # noqa: E501 This endpoint will return all RADIUS Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_radius_server_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_radius_server_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['user_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -9830,17 +9599,7 @@ def graph_user_traverse_radius_server_with_http_info(self, user_id, content_type if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_radius_server`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_traverse_radius_server`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_traverse_radius_server`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_traverse_radius_server`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -9859,10 +9618,6 @@ def graph_user_traverse_radius_server_with_http_info(self, user_id, content_type header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -9872,10 +9627,6 @@ def graph_user_traverse_radius_server_with_http_info(self, user_id, content_type header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -9895,57 +9646,53 @@ def graph_user_traverse_radius_server_with_http_info(self, user_id, content_type _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_traverse_system(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_system(self, user_id, **kwargs): # noqa: E501 """List the Systems bound to a User # noqa: E501 This endpoint will return all Systems bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systems\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_system(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_system(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_traverse_system_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_traverse_system_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_traverse_system_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_traverse_system_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_traverse_system_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_system_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the Systems bound to a User # noqa: E501 This endpoint will return all Systems bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systems\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_system_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_system_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['user_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -9964,17 +9711,7 @@ def graph_user_traverse_system_with_http_info(self, user_id, content_type, accep if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_system`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_traverse_system`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_traverse_system`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_traverse_system`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -9993,10 +9730,6 @@ def graph_user_traverse_system_with_http_info(self, user_id, content_type, accep header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -10006,10 +9739,6 @@ def graph_user_traverse_system_with_http_info(self, user_id, content_type, accep header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -10029,57 +9758,53 @@ def graph_user_traverse_system_with_http_info(self, user_id, content_type, accep _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_traverse_system_group(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_system_group(self, user_id, **kwargs): # noqa: E501 """List the System Groups bound to a User # noqa: E501 This endpoint will return all System Groups bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systemgroups\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_system_group(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_system_group(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_traverse_system_group_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_traverse_system_group_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_traverse_system_group_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_traverse_system_group_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_traverse_system_group_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_system_group_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the System Groups bound to a User # noqa: E501 This endpoint will return all System Groups bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systemgroups\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_system_group_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_system_group_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['user_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -10098,17 +9823,7 @@ def graph_user_traverse_system_group_with_http_info(self, user_id, content_type, if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_system_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_traverse_system_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_traverse_system_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_traverse_system_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -10127,10 +9842,6 @@ def graph_user_traverse_system_group_with_http_info(self, user_id, content_type, header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -10140,10 +9851,6 @@ def graph_user_traverse_system_group_with_http_info(self, user_id, content_type, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -10163,61 +9870,57 @@ def graph_user_traverse_system_group_with_http_info(self, user_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def policystatuses_list(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def policystatuses_systems_list(self, system_id, **kwargs): # noqa: E501 """List the policy statuses for a system # noqa: E501 This endpoint returns the policy results for a particular system. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policystatuses_list(system_id, content_type, accept, async_req=True) + >>> thread = api.policystatuses_systems_list(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[PolicyResult] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.policystatuses_list_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.policystatuses_systems_list_with_http_info(system_id, **kwargs) # noqa: E501 else: - (data) = self.policystatuses_list_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.policystatuses_systems_list_with_http_info(system_id, **kwargs) # noqa: E501 return data - def policystatuses_list_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def policystatuses_systems_list_with_http_info(self, system_id, **kwargs): # noqa: E501 """List the policy statuses for a system # noqa: E501 This endpoint returns the policy results for a particular system. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policystatuses_list_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.policystatuses_systems_list_with_http_info(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[PolicyResult] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['system_id', 'fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -10228,25 +9931,15 @@ def policystatuses_list_with_http_info(self, system_id, content_type, accept, ** if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method policystatuses_list" % key + " to method policystatuses_systems_list" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'system_id' is set if ('system_id' not in params or params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `policystatuses_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `policystatuses_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `policystatuses_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `policystatuses_list`, must be a value greater than or equal to `0`") # noqa: E501 + raise ValueError("Missing the required parameter `system_id` when calling `policystatuses_systems_list`") # noqa: E501 + collection_formats = {} path_params = {} @@ -10269,10 +9962,6 @@ def policystatuses_list_with_http_info(self, system_id, content_type, accept, ** collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -10284,10 +9973,6 @@ def policystatuses_list_with_http_info(self, system_id, content_type, accept, ** header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 diff --git a/jcapiv2/jcapiv2/api/groups_api.py b/jcapiv2/jcapiv2/api/groups_api.py index d476cae..0139277 100644 --- a/jcapiv2/jcapiv2/api/groups_api.py +++ b/jcapiv2/jcapiv2/api/groups_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,59 +32,57 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def groups_list(self, content_type, accept, **kwargs): # noqa: E501 + def groups_list(self, **kwargs): # noqa: E501 """List All Groups # noqa: E501 This endpoint returns all Groups that exist in your organization. #### Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/groups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_list(content_type, accept, async_req=True) + >>> thread = api.groups_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int x_unfiltered_total_count: If provided in the request with any non-empty value, this header will be returned on the response populated with the total count of objects without filters taken into account :return: list[Group] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.groups_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.groups_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.groups_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.groups_list_with_http_info(**kwargs) # noqa: E501 return data - def groups_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def groups_list_with_http_info(self, **kwargs): # noqa: E501 """List All Groups # noqa: E501 This endpoint returns all Groups that exist in your organization. #### Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/groups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.groups_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int x_unfiltered_total_count: If provided in the request with any non-empty value, this header will be returned on the response populated with the total count of objects without filters taken into account :return: list[Group] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id', 'x_unfiltered_total_count'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -100,17 +97,7 @@ def groups_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `groups_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `groups_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `groups_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -131,12 +118,10 @@ def groups_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + if 'x_unfiltered_total_count' in params: + header_params['x-unfiltered-total-count'] = params['x_unfiltered_total_count'] # noqa: E501 form_params = [] local_var_files = {} @@ -146,10 +131,6 @@ def groups_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 diff --git a/jcapiv2/jcapiv2/api/image_api.py b/jcapiv2/jcapiv2/api/image_api.py new file mode 100644 index 0000000..64af31e --- /dev/null +++ b/jcapiv2/jcapiv2/api/image_api.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv2.api_client import ApiClient + + +class ImageApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def applications_delete_logo(self, application_id, **kwargs): # noqa: E501 + """Delete application image # noqa: E501 + + Deletes the specified image from an application # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applications_delete_logo(application_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.applications_delete_logo_with_http_info(application_id, **kwargs) # noqa: E501 + else: + (data) = self.applications_delete_logo_with_http_info(application_id, **kwargs) # noqa: E501 + return data + + def applications_delete_logo_with_http_info(self, application_id, **kwargs): # noqa: E501 + """Delete application image # noqa: E501 + + Deletes the specified image from an application # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.applications_delete_logo_with_http_info(application_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['application_id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method applications_delete_logo" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'application_id' is set + if ('application_id' not in params or + params['application_id'] is None): + raise ValueError("Missing the required parameter `application_id` when calling `applications_delete_logo`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'application_id' in params: + path_params['application_id'] = params['application_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{application_id}/logo', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/ip_lists_api.py b/jcapiv2/jcapiv2/api/ip_lists_api.py new file mode 100644 index 0000000..7e1f020 --- /dev/null +++ b/jcapiv2/jcapiv2/api/ip_lists_api.py @@ -0,0 +1,657 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv2.api_client import ApiClient + + +class IPListsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def iplists_delete(self, id, **kwargs): # noqa: E501 + """Delete an IP list # noqa: E501 + + Delete a specific IP list. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.iplists_delete(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: IPList + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.iplists_delete_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.iplists_delete_with_http_info(id, **kwargs) # noqa: E501 + return data + + def iplists_delete_with_http_info(self, id, **kwargs): # noqa: E501 + """Delete an IP list # noqa: E501 + + Delete a specific IP list. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.iplists_delete_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: IPList + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method iplists_delete" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `iplists_delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/iplists/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='IPList', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def iplists_get(self, id, **kwargs): # noqa: E501 + """Get an IP list # noqa: E501 + + Return a specific IP list. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.iplists_get(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: IPList + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.iplists_get_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.iplists_get_with_http_info(id, **kwargs) # noqa: E501 + return data + + def iplists_get_with_http_info(self, id, **kwargs): # noqa: E501 + """Get an IP list # noqa: E501 + + Return a specific IP list. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.iplists_get_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: IPList + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method iplists_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `iplists_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/iplists/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='IPList', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def iplists_list(self, **kwargs): # noqa: E501 + """List IP Lists # noqa: E501 + + Retrieve all IP lists. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/iplists \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.iplists_list(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int x_total_count: + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: list[IPList] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.iplists_list_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.iplists_list_with_http_info(**kwargs) # noqa: E501 + return data + + def iplists_list_with_http_info(self, **kwargs): # noqa: E501 + """List IP Lists # noqa: E501 + + Retrieve all IP lists. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/iplists \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.iplists_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int x_total_count: + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: list[IPList] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['x_org_id', 'x_total_count', 'limit', 'skip', 'filter', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method iplists_list" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + if 'x_total_count' in params: + header_params['x-total-count'] = params['x_total_count'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/iplists', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[IPList]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def iplists_patch(self, id, **kwargs): # noqa: E501 + """Update an IP list # noqa: E501 + + Update a specific IP list. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"name\": \"New IP List Name\"}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.iplists_patch(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param IPListRequest body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: IPList + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.iplists_patch_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.iplists_patch_with_http_info(id, **kwargs) # noqa: E501 + return data + + def iplists_patch_with_http_info(self, id, **kwargs): # noqa: E501 + """Update an IP list # noqa: E501 + + Update a specific IP list. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"name\": \"New IP List Name\"}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.iplists_patch_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param IPListRequest body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: IPList + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method iplists_patch" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `iplists_patch`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/iplists/{id}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='IPList', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def iplists_post(self, **kwargs): # noqa: E501 + """Create IP List # noqa: E501 + + Create an IP list. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/iplists \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Sample IP List\", \"ips\": [ \"192.168.10.12\", \"192.168.10.20 - 192.168.10.30\", \"123.225.10.0/32\" ] }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.iplists_post(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param IPListRequest body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: IPList + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.iplists_post_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.iplists_post_with_http_info(**kwargs) # noqa: E501 + return data + + def iplists_post_with_http_info(self, **kwargs): # noqa: E501 + """Create IP List # noqa: E501 + + Create an IP list. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/iplists \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Sample IP List\", \"ips\": [ \"192.168.10.12\", \"192.168.10.20 - 192.168.10.30\", \"123.225.10.0/32\" ] }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.iplists_post_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param IPListRequest body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: IPList + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method iplists_post" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/iplists', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='IPList', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def iplists_put(self, id, **kwargs): # noqa: E501 + """Replace an IP list # noqa: E501 + + Replace a specific IP list. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Sample IP List\", \"ips\": [ \"192.168.10.10\" ] }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.iplists_put(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param IPListRequest body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: IPList + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.iplists_put_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.iplists_put_with_http_info(id, **kwargs) # noqa: E501 + return data + + def iplists_put_with_http_info(self, id, **kwargs): # noqa: E501 + """Replace an IP list # noqa: E501 + + Replace a specific IP list. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Sample IP List\", \"ips\": [ \"192.168.10.10\" ] }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.iplists_put_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param IPListRequest body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: IPList + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method iplists_put" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `iplists_put`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/iplists/{id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='IPList', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/knowledge_api.py b/jcapiv2/jcapiv2/api/knowledge_api.py deleted file mode 100644 index ee0a976..0000000 --- a/jcapiv2/jcapiv2/api/knowledge_api.py +++ /dev/null @@ -1,150 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from jcapiv2.api_client import ApiClient - - -class KnowledgeApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def knowledge_salesforce_list(self, **kwargs): # noqa: E501 - """List Knowledge Articles # noqa: E501 - - This endpoint returns a list of knowledge articles hosted in salesforce. ``` Sample Request curl -X GET https://console.jumpcloud.com/api/v2/knowledge/salesforce \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.knowledge_salesforce_list(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[str] fields: - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :return: SalesforceKnowledgeListOutput - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.knowledge_salesforce_list_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.knowledge_salesforce_list_with_http_info(**kwargs) # noqa: E501 - return data - - def knowledge_salesforce_list_with_http_info(self, **kwargs): # noqa: E501 - """List Knowledge Articles # noqa: E501 - - This endpoint returns a list of knowledge articles hosted in salesforce. ``` Sample Request curl -X GET https://console.jumpcloud.com/api/v2/knowledge/salesforce \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.knowledge_salesforce_list_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param list[str] fields: - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :return: SalesforceKnowledgeListOutput - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method knowledge_salesforce_list" % key - ) - params[key] = val - del params['kwargs'] - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `knowledge_salesforce_list`, must be a value greater than or equal to `0`") # noqa: E501 - collection_formats = {} - - path_params = {} - - query_params = [] - if 'fields' in params: - query_params.append(('fields', params['fields'])) # noqa: E501 - collection_formats['fields'] = 'csv' # noqa: E501 - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 - collection_formats['filter'] = 'csv' # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - collection_formats['sort'] = 'csv' # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/knowledge/salesforce', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='SalesforceKnowledgeListOutput', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/ldap_servers_api.py b/jcapiv2/jcapiv2/api/ldap_servers_api.py index 7f9025c..898ba02 100644 --- a/jcapiv2/jcapiv2/api/ldap_servers_api.py +++ b/jcapiv2/jcapiv2/api/ldap_servers_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,57 +32,53 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def graph_ldap_server_associations_list(self, ldapserver_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_ldap_server_associations_list(self, ldapserver_id, targets, **kwargs): # noqa: E501 """List the associations of a LDAP Server # noqa: E501 This endpoint returns the _direct_ associations of this LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_ldap_server_associations_list(ldapserver_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_ldap_server_associations_list(ldapserver_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str ldapserver_id: ObjectID of the LDAP Server. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"ldap_server\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_ldap_server_associations_list_with_http_info(ldapserver_id, targets, content_type, accept, **kwargs) # noqa: E501 + return self.graph_ldap_server_associations_list_with_http_info(ldapserver_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_ldap_server_associations_list_with_http_info(ldapserver_id, targets, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_ldap_server_associations_list_with_http_info(ldapserver_id, targets, **kwargs) # noqa: E501 return data - def graph_ldap_server_associations_list_with_http_info(self, ldapserver_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_ldap_server_associations_list_with_http_info(self, ldapserver_id, targets, **kwargs): # noqa: E501 """List the associations of a LDAP Server # noqa: E501 This endpoint returns the _direct_ associations of this LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_ldap_server_associations_list_with_http_info(ldapserver_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_ldap_server_associations_list_with_http_info(ldapserver_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str ldapserver_id: ObjectID of the LDAP Server. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"ldap_server\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['ldapserver_id', 'targets', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['ldapserver_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -106,17 +101,7 @@ def graph_ldap_server_associations_list_with_http_info(self, ldapserver_id, targ if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_ldap_server_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_ldap_server_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_ldap_server_associations_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_ldap_server_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -133,10 +118,6 @@ def graph_ldap_server_associations_list_with_http_info(self, ldapserver_id, targ query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -148,10 +129,6 @@ def graph_ldap_server_associations_list_with_http_info(self, ldapserver_id, targ header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -171,53 +148,49 @@ def graph_ldap_server_associations_list_with_http_info(self, ldapserver_id, targ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_ldap_server_associations_post(self, ldapserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_ldap_server_associations_post(self, ldapserver_id, **kwargs): # noqa: E501 """Manage the associations of a LDAP Server # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_ldap_server_associations_post(ldapserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_ldap_server_associations_post(ldapserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str ldapserver_id: ObjectID of the LDAP Server. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationLdapServer body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_ldap_server_associations_post_with_http_info(ldapserver_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_ldap_server_associations_post_with_http_info(ldapserver_id, **kwargs) # noqa: E501 else: - (data) = self.graph_ldap_server_associations_post_with_http_info(ldapserver_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_ldap_server_associations_post_with_http_info(ldapserver_id, **kwargs) # noqa: E501 return data - def graph_ldap_server_associations_post_with_http_info(self, ldapserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_ldap_server_associations_post_with_http_info(self, ldapserver_id, **kwargs): # noqa: E501 """Manage the associations of a LDAP Server # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_ldap_server_associations_post_with_http_info(ldapserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_ldap_server_associations_post_with_http_info(ldapserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str ldapserver_id: ObjectID of the LDAP Server. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationLdapServer body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['ldapserver_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['ldapserver_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -236,14 +209,6 @@ def graph_ldap_server_associations_post_with_http_info(self, ldapserver_id, cont if ('ldapserver_id' not in params or params['ldapserver_id'] is None): raise ValueError("Missing the required parameter `ldapserver_id` when calling `graph_ldap_server_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_ldap_server_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_ldap_server_associations_post`") # noqa: E501 collection_formats = {} @@ -254,10 +219,6 @@ def graph_ldap_server_associations_post_with_http_info(self, ldapserver_id, cont query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -267,10 +228,6 @@ def graph_ldap_server_associations_post_with_http_info(self, ldapserver_id, cont body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -294,57 +251,53 @@ def graph_ldap_server_associations_post_with_http_info(self, ldapserver_id, cont _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_ldap_server_traverse_user(self, ldapserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_ldap_server_traverse_user(self, ldapserver_id, **kwargs): # noqa: E501 """List the Users bound to a LDAP Server # noqa: E501 This endpoint will return all Users bound to an LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_ldap_server_traverse_user(ldapserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_ldap_server_traverse_user(ldapserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str ldapserver_id: ObjectID of the LDAP Server. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_ldap_server_traverse_user_with_http_info(ldapserver_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_ldap_server_traverse_user_with_http_info(ldapserver_id, **kwargs) # noqa: E501 else: - (data) = self.graph_ldap_server_traverse_user_with_http_info(ldapserver_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_ldap_server_traverse_user_with_http_info(ldapserver_id, **kwargs) # noqa: E501 return data - def graph_ldap_server_traverse_user_with_http_info(self, ldapserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_ldap_server_traverse_user_with_http_info(self, ldapserver_id, **kwargs): # noqa: E501 """List the Users bound to a LDAP Server # noqa: E501 This endpoint will return all Users bound to an LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_ldap_server_traverse_user_with_http_info(ldapserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_ldap_server_traverse_user_with_http_info(ldapserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str ldapserver_id: ObjectID of the LDAP Server. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['ldapserver_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['ldapserver_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -363,17 +316,7 @@ def graph_ldap_server_traverse_user_with_http_info(self, ldapserver_id, content_ if ('ldapserver_id' not in params or params['ldapserver_id'] is None): raise ValueError("Missing the required parameter `ldapserver_id` when calling `graph_ldap_server_traverse_user`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_ldap_server_traverse_user`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_ldap_server_traverse_user`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_ldap_server_traverse_user`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -392,10 +335,6 @@ def graph_ldap_server_traverse_user_with_http_info(self, ldapserver_id, content_ header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -405,10 +344,6 @@ def graph_ldap_server_traverse_user_with_http_info(self, ldapserver_id, content_ header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -428,57 +363,53 @@ def graph_ldap_server_traverse_user_with_http_info(self, ldapserver_id, content_ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_ldap_server_traverse_user_group(self, ldapserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_ldap_server_traverse_user_group(self, ldapserver_id, **kwargs): # noqa: E501 """List the User Groups bound to a LDAP Server # noqa: E501 This endpoint will return all Users Groups bound to a LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_ldap_server_traverse_user_group(ldapserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_ldap_server_traverse_user_group(ldapserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str ldapserver_id: ObjectID of the LDAP Server. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_ldap_server_traverse_user_group_with_http_info(ldapserver_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_ldap_server_traverse_user_group_with_http_info(ldapserver_id, **kwargs) # noqa: E501 else: - (data) = self.graph_ldap_server_traverse_user_group_with_http_info(ldapserver_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_ldap_server_traverse_user_group_with_http_info(ldapserver_id, **kwargs) # noqa: E501 return data - def graph_ldap_server_traverse_user_group_with_http_info(self, ldapserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_ldap_server_traverse_user_group_with_http_info(self, ldapserver_id, **kwargs): # noqa: E501 """List the User Groups bound to a LDAP Server # noqa: E501 This endpoint will return all Users Groups bound to a LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_ldap_server_traverse_user_group_with_http_info(ldapserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_ldap_server_traverse_user_group_with_http_info(ldapserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str ldapserver_id: ObjectID of the LDAP Server. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['ldapserver_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['ldapserver_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -497,17 +428,7 @@ def graph_ldap_server_traverse_user_group_with_http_info(self, ldapserver_id, co if ('ldapserver_id' not in params or params['ldapserver_id'] is None): raise ValueError("Missing the required parameter `ldapserver_id` when calling `graph_ldap_server_traverse_user_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_ldap_server_traverse_user_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_ldap_server_traverse_user_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_ldap_server_traverse_user_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -526,10 +447,6 @@ def graph_ldap_server_traverse_user_group_with_http_info(self, ldapserver_id, co header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -539,10 +456,6 @@ def graph_ldap_server_traverse_user_group_with_http_info(self, ldapserver_id, co header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -562,51 +475,47 @@ def graph_ldap_server_traverse_user_group_with_http_info(self, ldapserver_id, co _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def ldapservers_get(self, id, content_type, accept, **kwargs): # noqa: E501 + def ldapservers_get(self, id, **kwargs): # noqa: E501 """Get LDAP Server # noqa: E501 This endpoint returns a specific LDAP server. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.ldapservers_get(id, content_type, accept, async_req=True) + >>> thread = api.ldapservers_get(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: Unique identifier of the LDAP server. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: LdapServerOutput If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.ldapservers_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.ldapservers_get_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.ldapservers_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.ldapservers_get_with_http_info(id, **kwargs) # noqa: E501 return data - def ldapservers_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def ldapservers_get_with_http_info(self, id, **kwargs): # noqa: E501 """Get LDAP Server # noqa: E501 This endpoint returns a specific LDAP server. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.ldapservers_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.ldapservers_get_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: Unique identifier of the LDAP server. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: LdapServerOutput If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -625,14 +534,6 @@ def ldapservers_get_with_http_info(self, id, content_type, accept, **kwargs): # if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `ldapservers_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `ldapservers_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `ldapservers_get`") # noqa: E501 collection_formats = {} @@ -643,10 +544,6 @@ def ldapservers_get_with_http_info(self, id, content_type, accept, **kwargs): # query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -658,10 +555,6 @@ def ldapservers_get_with_http_info(self, id, content_type, accept, **kwargs): # header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -681,59 +574,55 @@ def ldapservers_get_with_http_info(self, id, content_type, accept, **kwargs): # _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def ldapservers_list(self, content_type, accept, **kwargs): # noqa: E501 + def ldapservers_list(self, **kwargs): # noqa: E501 """List LDAP Servers # noqa: E501 This endpoint returns the object IDs of your LDAP servers. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.ldapservers_list(content_type, accept, async_req=True) + >>> thread = api.ldapservers_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[LdapServerOutput] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.ldapservers_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.ldapservers_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.ldapservers_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.ldapservers_list_with_http_info(**kwargs) # noqa: E501 return data - def ldapservers_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def ldapservers_list_with_http_info(self, **kwargs): # noqa: E501 """List LDAP Servers # noqa: E501 This endpoint returns the object IDs of your LDAP servers. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.ldapservers_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.ldapservers_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[LdapServerOutput] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -748,17 +637,7 @@ def ldapservers_list_with_http_info(self, content_type, accept, **kwargs): # no ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `ldapservers_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `ldapservers_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `ldapservers_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -779,10 +658,6 @@ def ldapservers_list_with_http_info(self, content_type, accept, **kwargs): # no collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -794,10 +669,6 @@ def ldapservers_list_with_http_info(self, content_type, accept, **kwargs): # no header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -817,55 +688,49 @@ def ldapservers_list_with_http_info(self, content_type, accept, **kwargs): # no _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def ldapservers_patch(self, id, content_type, accept, **kwargs): # noqa: E501 + def ldapservers_patch(self, id, **kwargs): # noqa: E501 """Update existing LDAP server # noqa: E501 This endpoint allows updating some attributes of an LDAP server. Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"remove\", \"userPasswordExpirationAction\": \"disable\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.ldapservers_patch(id, content_type, accept, async_req=True) + >>> thread = api.ldapservers_patch(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: Unique identifier of the LDAP server. (required) - :param str content_type: (required) - :param str accept: (required) - :param Body3 body: - :param str x_api_key: - :param str x_org_id: - :return: InlineResponse200 + :param LdapserversIdBody body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: InlineResponse20010 If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.ldapservers_patch_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.ldapservers_patch_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.ldapservers_patch_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.ldapservers_patch_with_http_info(id, **kwargs) # noqa: E501 return data - def ldapservers_patch_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def ldapservers_patch_with_http_info(self, id, **kwargs): # noqa: E501 """Update existing LDAP server # noqa: E501 This endpoint allows updating some attributes of an LDAP server. Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"remove\", \"userPasswordExpirationAction\": \"disable\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.ldapservers_patch_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.ldapservers_patch_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: Unique identifier of the LDAP server. (required) - :param str content_type: (required) - :param str accept: (required) - :param Body3 body: - :param str x_api_key: - :param str x_org_id: - :return: InlineResponse200 + :param LdapserversIdBody body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: InlineResponse20010 If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'body', 'x_api_key', 'x_org_id'] # noqa: E501 + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -884,14 +749,6 @@ def ldapservers_patch_with_http_info(self, id, content_type, accept, **kwargs): if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `ldapservers_patch`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `ldapservers_patch`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `ldapservers_patch`") # noqa: E501 collection_formats = {} @@ -902,14 +759,8 @@ def ldapservers_patch_with_http_info(self, id, content_type, accept, **kwargs): query_params = [] header_params = {} - if 'x_api_key' in params: - header_params['x-api-key'] = params['x_api_key'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -936,7 +787,7 @@ def ldapservers_patch_with_http_info(self, id, content_type, accept, **kwargs): body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse200', # noqa: E501 + response_type='InlineResponse20010', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/jcapiv2/jcapiv2/api/logos_api.py b/jcapiv2/jcapiv2/api/logos_api.py new file mode 100644 index 0000000..8cf113b --- /dev/null +++ b/jcapiv2/jcapiv2/api/logos_api.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv2.api_client import ApiClient + + +class LogosApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def logos_get(self, id, **kwargs): # noqa: E501 + """Get the logo associated with the specified id # noqa: E501 + + Return the logo image associated with the specified id # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.logos_get(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.logos_get_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.logos_get_with_http_info(id, **kwargs) # noqa: E501 + return data + + def logos_get_with_http_info(self, id, **kwargs): # noqa: E501 + """Get the logo associated with the specified id # noqa: E501 + + Return the logo image associated with the specified id # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.logos_get_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method logos_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `logos_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['image/gif', 'image/jpeg', 'image/png']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/logos/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/managed_service_provider_api.py b/jcapiv2/jcapiv2/api/managed_service_provider_api.py new file mode 100644 index 0000000..6f660b3 --- /dev/null +++ b/jcapiv2/jcapiv2/api/managed_service_provider_api.py @@ -0,0 +1,1206 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv2.api_client import ApiClient + + +class ManagedServiceProviderApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def administrator_organizations_create_by_administrator(self, id, **kwargs): # noqa: E501 + """Allow Adminstrator access to an Organization. # noqa: E501 + + This endpoint allows you to grant Administrator access to an Organization. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_create_by_administrator(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param AdministratorOrganizationLinkReq body: + :return: AdministratorOrganizationLink + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.administrator_organizations_create_by_administrator_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.administrator_organizations_create_by_administrator_with_http_info(id, **kwargs) # noqa: E501 + return data + + def administrator_organizations_create_by_administrator_with_http_info(self, id, **kwargs): # noqa: E501 + """Allow Adminstrator access to an Organization. # noqa: E501 + + This endpoint allows you to grant Administrator access to an Organization. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_create_by_administrator_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param AdministratorOrganizationLinkReq body: + :return: AdministratorOrganizationLink + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method administrator_organizations_create_by_administrator" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `administrator_organizations_create_by_administrator`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/administrators/{id}/organizationlinks', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AdministratorOrganizationLink', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def administrator_organizations_list_by_administrator(self, id, **kwargs): # noqa: E501 + """List the association links between an Administrator and Organizations. # noqa: E501 + + This endpoint returns the association links between an Administrator and Organizations. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_list_by_administrator(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: list[AdministratorOrganizationLink] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.administrator_organizations_list_by_administrator_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.administrator_organizations_list_by_administrator_with_http_info(id, **kwargs) # noqa: E501 + return data + + def administrator_organizations_list_by_administrator_with_http_info(self, id, **kwargs): # noqa: E501 + """List the association links between an Administrator and Organizations. # noqa: E501 + + This endpoint returns the association links between an Administrator and Organizations. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_list_by_administrator_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: list[AdministratorOrganizationLink] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'limit', 'skip'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method administrator_organizations_list_by_administrator" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `administrator_organizations_list_by_administrator`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/administrators/{id}/organizationlinks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[AdministratorOrganizationLink]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def administrator_organizations_list_by_organization(self, id, **kwargs): # noqa: E501 + """List the association links between an Organization and Administrators. # noqa: E501 + + This endpoint returns the association links between an Organization and Administrators. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_list_by_organization(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: list[AdministratorOrganizationLink] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.administrator_organizations_list_by_organization_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.administrator_organizations_list_by_organization_with_http_info(id, **kwargs) # noqa: E501 + return data + + def administrator_organizations_list_by_organization_with_http_info(self, id, **kwargs): # noqa: E501 + """List the association links between an Organization and Administrators. # noqa: E501 + + This endpoint returns the association links between an Organization and Administrators. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_list_by_organization_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: list[AdministratorOrganizationLink] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'limit', 'skip'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method administrator_organizations_list_by_organization" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `administrator_organizations_list_by_organization`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/organizations/{id}/administratorlinks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[AdministratorOrganizationLink]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def administrator_organizations_remove_by_administrator(self, administrator_id, id, **kwargs): # noqa: E501 + """Remove association between an Administrator and an Organization. # noqa: E501 + + This endpoint removes the association link between an Administrator and an Organization. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_remove_by_administrator(administrator_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str administrator_id: (required) + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.administrator_organizations_remove_by_administrator_with_http_info(administrator_id, id, **kwargs) # noqa: E501 + else: + (data) = self.administrator_organizations_remove_by_administrator_with_http_info(administrator_id, id, **kwargs) # noqa: E501 + return data + + def administrator_organizations_remove_by_administrator_with_http_info(self, administrator_id, id, **kwargs): # noqa: E501 + """Remove association between an Administrator and an Organization. # noqa: E501 + + This endpoint removes the association link between an Administrator and an Organization. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_remove_by_administrator_with_http_info(administrator_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str administrator_id: (required) + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['administrator_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method administrator_organizations_remove_by_administrator" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'administrator_id' is set + if ('administrator_id' not in params or + params['administrator_id'] is None): + raise ValueError("Missing the required parameter `administrator_id` when calling `administrator_organizations_remove_by_administrator`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `administrator_organizations_remove_by_administrator`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'administrator_id' in params: + path_params['administrator_id'] = params['administrator_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/administrators/{administrator_id}/organizationlinks/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def provider_organizations_update_org(self, provider_id, id, **kwargs): # noqa: E501 + """Update Provider Organization # noqa: E501 + + This endpoint updates a provider's organization # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.provider_organizations_update_org(provider_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param str id: (required) + :param Organization body: + :return: Organization + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.provider_organizations_update_org_with_http_info(provider_id, id, **kwargs) # noqa: E501 + else: + (data) = self.provider_organizations_update_org_with_http_info(provider_id, id, **kwargs) # noqa: E501 + return data + + def provider_organizations_update_org_with_http_info(self, provider_id, id, **kwargs): # noqa: E501 + """Update Provider Organization # noqa: E501 + + This endpoint updates a provider's organization # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.provider_organizations_update_org_with_http_info(provider_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param str id: (required) + :param Organization body: + :return: Organization + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method provider_organizations_update_org" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `provider_organizations_update_org`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `provider_organizations_update_org`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/organizations/{id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Organization', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def providers_get_provider(self, provider_id, **kwargs): # noqa: E501 + """Retrieve Provider # noqa: E501 + + This endpoint returns details about a provider # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_get_provider(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :return: Provider + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.providers_get_provider_with_http_info(provider_id, **kwargs) # noqa: E501 + else: + (data) = self.providers_get_provider_with_http_info(provider_id, **kwargs) # noqa: E501 + return data + + def providers_get_provider_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """Retrieve Provider # noqa: E501 + + This endpoint returns details about a provider # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_get_provider_with_http_info(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :return: Provider + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method providers_get_provider" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `providers_get_provider`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + collection_formats['fields'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Provider', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def providers_list_administrators(self, provider_id, **kwargs): # noqa: E501 + """List Provider Administrators # noqa: E501 + + This endpoint returns a list of the Administrators associated with the Provider. You must be associated with the provider to use this route. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_list_administrators(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse20012 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.providers_list_administrators_with_http_info(provider_id, **kwargs) # noqa: E501 + else: + (data) = self.providers_list_administrators_with_http_info(provider_id, **kwargs) # noqa: E501 + return data + + def providers_list_administrators_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """List Provider Administrators # noqa: E501 + + This endpoint returns a list of the Administrators associated with the Provider. You must be associated with the provider to use this route. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_list_administrators_with_http_info(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse20012 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method providers_list_administrators" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `providers_list_administrators`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + collection_formats['fields'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/administrators', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse20012', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def providers_list_organizations(self, provider_id, **kwargs): # noqa: E501 + """List Provider Organizations # noqa: E501 + + This endpoint returns a list of the Organizations associated with the Provider. You must be associated with the provider to use this route. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_list_organizations(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse20013 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.providers_list_organizations_with_http_info(provider_id, **kwargs) # noqa: E501 + else: + (data) = self.providers_list_organizations_with_http_info(provider_id, **kwargs) # noqa: E501 + return data + + def providers_list_organizations_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """List Provider Organizations # noqa: E501 + + This endpoint returns a list of the Organizations associated with the Provider. You must be associated with the provider to use this route. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_list_organizations_with_http_info(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse20013 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method providers_list_organizations" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `providers_list_organizations`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + collection_formats['fields'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/organizations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse20013', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def providers_post_admins(self, provider_id, **kwargs): # noqa: E501 + """Create a new Provider Administrator # noqa: E501 + + This endpoint allows you to create a provider administrator. You must be associated with the provider to use this route. You must provide either `role` or `roleName`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_post_admins(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param ProviderAdminReq body: + :return: Administrator + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.providers_post_admins_with_http_info(provider_id, **kwargs) # noqa: E501 + else: + (data) = self.providers_post_admins_with_http_info(provider_id, **kwargs) # noqa: E501 + return data + + def providers_post_admins_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """Create a new Provider Administrator # noqa: E501 + + This endpoint allows you to create a provider administrator. You must be associated with the provider to use this route. You must provide either `role` or `roleName`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_post_admins_with_http_info(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param ProviderAdminReq body: + :return: Administrator + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method providers_post_admins" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `providers_post_admins`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/administrators', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Administrator', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def providers_retrieve_invoice(self, provider_id, id, **kwargs): # noqa: E501 + """Download a provider's invoice. # noqa: E501 + + Retrieves an invoice for this provider. You must be associated to the provider to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_retrieve_invoice(provider_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param str id: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.providers_retrieve_invoice_with_http_info(provider_id, id, **kwargs) # noqa: E501 + else: + (data) = self.providers_retrieve_invoice_with_http_info(provider_id, id, **kwargs) # noqa: E501 + return data + + def providers_retrieve_invoice_with_http_info(self, provider_id, id, **kwargs): # noqa: E501 + """Download a provider's invoice. # noqa: E501 + + Retrieves an invoice for this provider. You must be associated to the provider to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_retrieve_invoice_with_http_info(provider_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param str id: (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method providers_retrieve_invoice" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `providers_retrieve_invoice`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `providers_retrieve_invoice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + if 'id' in params: + path_params['ID'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/pdf']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/invoices/{ID}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def providers_retrieve_invoices(self, provider_id, **kwargs): # noqa: E501 + """List a provider's invoices. # noqa: E501 + + Retrieves a list of invoices for this provider. You must be associated to the provider to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_retrieve_invoices(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param int limit: The number of records to return at once. Limited to 100. + :return: ProviderInvoiceResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.providers_retrieve_invoices_with_http_info(provider_id, **kwargs) # noqa: E501 + else: + (data) = self.providers_retrieve_invoices_with_http_info(provider_id, **kwargs) # noqa: E501 + return data + + def providers_retrieve_invoices_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """List a provider's invoices. # noqa: E501 + + Retrieves a list of invoices for this provider. You must be associated to the provider to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_retrieve_invoices_with_http_info(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param int limit: The number of records to return at once. Limited to 100. + :return: ProviderInvoiceResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'skip', 'sort', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method providers_retrieve_invoices" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `providers_retrieve_invoices`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + + query_params = [] + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/invoices', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProviderInvoiceResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/office_365_api.py b/jcapiv2/jcapiv2/api/office_365_api.py index 84cb345..dc49843 100644 --- a/jcapiv2/jcapiv2/api/office_365_api.py +++ b/jcapiv2/jcapiv2/api/office_365_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,57 +32,53 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def graph_office365_associations_list(self, office365_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_office365_associations_list(self, office365_id, targets, **kwargs): # noqa: E501 """List the associations of an Office 365 instance # noqa: E501 - This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations?targets=user_group' \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_office365_associations_list(office365_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_office365_associations_list(office365_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: ObjectID of the Office 365 instance. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"office_365\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_office365_associations_list_with_http_info(office365_id, targets, content_type, accept, **kwargs) # noqa: E501 + return self.graph_office365_associations_list_with_http_info(office365_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_office365_associations_list_with_http_info(office365_id, targets, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_office365_associations_list_with_http_info(office365_id, targets, **kwargs) # noqa: E501 return data - def graph_office365_associations_list_with_http_info(self, office365_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_office365_associations_list_with_http_info(self, office365_id, targets, **kwargs): # noqa: E501 """List the associations of an Office 365 instance # noqa: E501 - This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations?targets=user_group' \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_office365_associations_list_with_http_info(office365_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_office365_associations_list_with_http_info(office365_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: ObjectID of the Office 365 instance. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"office_365\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['office365_id', 'targets', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['office365_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -106,17 +101,7 @@ def graph_office365_associations_list_with_http_info(self, office365_id, targets if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_office365_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_office365_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_office365_associations_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_office365_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -133,10 +118,6 @@ def graph_office365_associations_list_with_http_info(self, office365_id, targets query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -148,10 +129,6 @@ def graph_office365_associations_list_with_http_info(self, office365_id, targets header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -171,53 +148,49 @@ def graph_office365_associations_list_with_http_info(self, office365_id, targets _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_office365_associations_post(self, office365_id, content_type, accept, **kwargs): # noqa: E501 + def graph_office365_associations_post(self, office365_id, **kwargs): # noqa: E501 """Manage the associations of an Office 365 instance # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_office365_associations_post(office365_id, content_type, accept, async_req=True) + >>> thread = api.graph_office365_associations_post(office365_id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: ObjectID of the Office 365 instance. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationOffice365 body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_office365_associations_post_with_http_info(office365_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_office365_associations_post_with_http_info(office365_id, **kwargs) # noqa: E501 else: - (data) = self.graph_office365_associations_post_with_http_info(office365_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_office365_associations_post_with_http_info(office365_id, **kwargs) # noqa: E501 return data - def graph_office365_associations_post_with_http_info(self, office365_id, content_type, accept, **kwargs): # noqa: E501 + def graph_office365_associations_post_with_http_info(self, office365_id, **kwargs): # noqa: E501 """Manage the associations of an Office 365 instance # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_office365_associations_post_with_http_info(office365_id, content_type, accept, async_req=True) + >>> thread = api.graph_office365_associations_post_with_http_info(office365_id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: ObjectID of the Office 365 instance. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationOffice365 body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['office365_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['office365_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -236,14 +209,6 @@ def graph_office365_associations_post_with_http_info(self, office365_id, content if ('office365_id' not in params or params['office365_id'] is None): raise ValueError("Missing the required parameter `office365_id` when calling `graph_office365_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_office365_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_office365_associations_post`") # noqa: E501 collection_formats = {} @@ -254,10 +219,6 @@ def graph_office365_associations_post_with_http_info(self, office365_id, content query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -267,10 +228,6 @@ def graph_office365_associations_post_with_http_info(self, office365_id, content body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -294,57 +251,53 @@ def graph_office365_associations_post_with_http_info(self, office365_id, content _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_office365_traverse_user(self, office365_id, content_type, accept, **kwargs): # noqa: E501 + def graph_office365_traverse_user(self, office365_id, **kwargs): # noqa: E501 """List the Users bound to an Office 365 instance # noqa: E501 - This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_office365_traverse_user(office365_id, content_type, accept, async_req=True) + >>> thread = api.graph_office365_traverse_user(office365_id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: ObjectID of the Office 365 suite. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_office365_traverse_user_with_http_info(office365_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_office365_traverse_user_with_http_info(office365_id, **kwargs) # noqa: E501 else: - (data) = self.graph_office365_traverse_user_with_http_info(office365_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_office365_traverse_user_with_http_info(office365_id, **kwargs) # noqa: E501 return data - def graph_office365_traverse_user_with_http_info(self, office365_id, content_type, accept, **kwargs): # noqa: E501 + def graph_office365_traverse_user_with_http_info(self, office365_id, **kwargs): # noqa: E501 """List the Users bound to an Office 365 instance # noqa: E501 - This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_office365_traverse_user_with_http_info(office365_id, content_type, accept, async_req=True) + >>> thread = api.graph_office365_traverse_user_with_http_info(office365_id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: ObjectID of the Office 365 suite. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['office365_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['office365_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -363,17 +316,7 @@ def graph_office365_traverse_user_with_http_info(self, office365_id, content_typ if ('office365_id' not in params or params['office365_id'] is None): raise ValueError("Missing the required parameter `office365_id` when calling `graph_office365_traverse_user`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_office365_traverse_user`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_office365_traverse_user`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_office365_traverse_user`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -392,10 +335,6 @@ def graph_office365_traverse_user_with_http_info(self, office365_id, content_typ header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -405,10 +344,6 @@ def graph_office365_traverse_user_with_http_info(self, office365_id, content_typ header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -428,57 +363,53 @@ def graph_office365_traverse_user_with_http_info(self, office365_id, content_typ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_office365_traverse_user_group(self, office365_id, content_type, accept, **kwargs): # noqa: E501 + def graph_office365_traverse_user_group(self, office365_id, **kwargs): # noqa: E501 """List the User Groups bound to an Office 365 instance # noqa: E501 - This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_office365_traverse_user_group(office365_id, content_type, accept, async_req=True) + >>> thread = api.graph_office365_traverse_user_group(office365_id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: ObjectID of the Office 365 suite. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_office365_traverse_user_group_with_http_info(office365_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_office365_traverse_user_group_with_http_info(office365_id, **kwargs) # noqa: E501 else: - (data) = self.graph_office365_traverse_user_group_with_http_info(office365_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_office365_traverse_user_group_with_http_info(office365_id, **kwargs) # noqa: E501 return data - def graph_office365_traverse_user_group_with_http_info(self, office365_id, content_type, accept, **kwargs): # noqa: E501 + def graph_office365_traverse_user_group_with_http_info(self, office365_id, **kwargs): # noqa: E501 """List the User Groups bound to an Office 365 instance # noqa: E501 - This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_office365_traverse_user_group_with_http_info(office365_id, content_type, accept, async_req=True) + >>> thread = api.graph_office365_traverse_user_group_with_http_info(office365_id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: ObjectID of the Office 365 suite. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['office365_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['office365_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -497,17 +428,7 @@ def graph_office365_traverse_user_group_with_http_info(self, office365_id, conte if ('office365_id' not in params or params['office365_id'] is None): raise ValueError("Missing the required parameter `office365_id` when calling `graph_office365_traverse_user_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_office365_traverse_user_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_office365_traverse_user_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_office365_traverse_user_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -526,10 +447,6 @@ def graph_office365_traverse_user_group_with_http_info(self, office365_id, conte header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -539,6 +456,331 @@ def graph_office365_traverse_user_group_with_http_info(self, office365_id, conte header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/office365s/{office365_id}/usergroups', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def office365s_get(self, office365_id, **kwargs): # noqa: E501 + """Get Office 365 instance # noqa: E501 + + This endpoint returns a specific Office 365 instance. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.office365s_get(office365_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str office365_id: ObjectID of the Office 365 instance. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: Office365Output + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.office365s_get_with_http_info(office365_id, **kwargs) # noqa: E501 + else: + (data) = self.office365s_get_with_http_info(office365_id, **kwargs) # noqa: E501 + return data + + def office365s_get_with_http_info(self, office365_id, **kwargs): # noqa: E501 + """Get Office 365 instance # noqa: E501 + + This endpoint returns a specific Office 365 instance. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.office365s_get_with_http_info(office365_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str office365_id: ObjectID of the Office 365 instance. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: Office365Output + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['office365_id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method office365s_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'office365_id' is set + if ('office365_id' not in params or + params['office365_id'] is None): + raise ValueError("Missing the required parameter `office365_id` when calling `office365s_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'office365_id' in params: + path_params['office365_id'] = params['office365_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/office365s/{office365_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Office365Output', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def office365s_list_import_users(self, office365_id, **kwargs): # noqa: E501 + """Get a list of users to import from an Office 365 instance # noqa: E501 + + Lists Office 365 users available for import. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.office365s_list_import_users(office365_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str office365_id: (required) + :param str consistency_level: Defines the consistency header for O365 requests. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#request-headers + :param int top: Office 365 API maximum number of results per page. See https://docs.microsoft.com/en-us/graph/paging. + :param str skip_token: Office 365 API token used to access the next page of results. See https://docs.microsoft.com/en-us/graph/paging. + :param str filter: Office 365 API filter parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + :param str search: Office 365 API search parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + :param str orderby: Office 365 API orderby parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + :param bool count: Office 365 API count parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + :return: InlineResponse20011 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.office365s_list_import_users_with_http_info(office365_id, **kwargs) # noqa: E501 + else: + (data) = self.office365s_list_import_users_with_http_info(office365_id, **kwargs) # noqa: E501 + return data + + def office365s_list_import_users_with_http_info(self, office365_id, **kwargs): # noqa: E501 + """Get a list of users to import from an Office 365 instance # noqa: E501 + + Lists Office 365 users available for import. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.office365s_list_import_users_with_http_info(office365_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str office365_id: (required) + :param str consistency_level: Defines the consistency header for O365 requests. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#request-headers + :param int top: Office 365 API maximum number of results per page. See https://docs.microsoft.com/en-us/graph/paging. + :param str skip_token: Office 365 API token used to access the next page of results. See https://docs.microsoft.com/en-us/graph/paging. + :param str filter: Office 365 API filter parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + :param str search: Office 365 API search parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + :param str orderby: Office 365 API orderby parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + :param bool count: Office 365 API count parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + :return: InlineResponse20011 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['office365_id', 'consistency_level', 'top', 'skip_token', 'filter', 'search', 'orderby', 'count'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method office365s_list_import_users" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'office365_id' is set + if ('office365_id' not in params or + params['office365_id'] is None): + raise ValueError("Missing the required parameter `office365_id` when calling `office365s_list_import_users`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'office365_id' in params: + path_params['office365_id'] = params['office365_id'] # noqa: E501 + + query_params = [] + if 'top' in params: + query_params.append(('top', params['top'])) # noqa: E501 + if 'skip_token' in params: + query_params.append(('skipToken', params['skip_token'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + if 'search' in params: + query_params.append(('search', params['search'])) # noqa: E501 + if 'orderby' in params: + query_params.append(('orderby', params['orderby'])) # noqa: E501 + if 'count' in params: + query_params.append(('count', params['count'])) # noqa: E501 + + header_params = {} + if 'consistency_level' in params: + header_params['ConsistencyLevel'] = params['consistency_level'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/office365s/{office365_id}/import/users', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse20011', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def office365s_patch(self, office365_id, **kwargs): # noqa: E501 + """Update existing Office 365 instance. # noqa: E501 + + This endpoint allows updating some attributes of an Office 365 instance. ##### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"maintain\", \"userPasswordExpirationAction\": \"suspend\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.office365s_patch(office365_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str office365_id: ObjectID of the Office 365 instance. (required) + :param Office365PatchInput body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: Office365Output + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.office365s_patch_with_http_info(office365_id, **kwargs) # noqa: E501 + else: + (data) = self.office365s_patch_with_http_info(office365_id, **kwargs) # noqa: E501 + return data + + def office365s_patch_with_http_info(self, office365_id, **kwargs): # noqa: E501 + """Update existing Office 365 instance. # noqa: E501 + + This endpoint allows updating some attributes of an Office 365 instance. ##### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"maintain\", \"userPasswordExpirationAction\": \"suspend\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.office365s_patch_with_http_info(office365_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str office365_id: ObjectID of the Office 365 instance. (required) + :param Office365PatchInput body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: Office365Output + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['office365_id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method office365s_patch" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'office365_id' is set + if ('office365_id' not in params or + params['office365_id'] is None): + raise ValueError("Missing the required parameter `office365_id` when calling `office365s_patch`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'office365_id' in params: + path_params['office365_id'] = params['office365_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -547,14 +789,14 @@ def graph_office365_traverse_user_group_with_http_info(self, office365_id, conte auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/office365s/{office365_id}/usergroups', 'GET', + '/office365s/{office365_id}', 'PATCH', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[GraphObjectWithPaths]', # noqa: E501 + response_type='Office365Output', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -562,51 +804,47 @@ def graph_office365_traverse_user_group_with_http_info(self, office365_id, conte _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def translation_rules_office365_delete(self, office365_id, id, content_type, accept, **kwargs): # noqa: E501 + def translation_rules_office365_delete(self, office365_id, id, **kwargs): # noqa: E501 """Deletes a Office 365 translation rule # noqa: E501 This endpoint allows you to delete a translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.translation_rules_office365_delete(office365_id, id, content_type, accept, async_req=True) + >>> thread = api.translation_rules_office365_delete(office365_id, id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: (required) :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.translation_rules_office365_delete_with_http_info(office365_id, id, content_type, accept, **kwargs) # noqa: E501 + return self.translation_rules_office365_delete_with_http_info(office365_id, id, **kwargs) # noqa: E501 else: - (data) = self.translation_rules_office365_delete_with_http_info(office365_id, id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.translation_rules_office365_delete_with_http_info(office365_id, id, **kwargs) # noqa: E501 return data - def translation_rules_office365_delete_with_http_info(self, office365_id, id, content_type, accept, **kwargs): # noqa: E501 + def translation_rules_office365_delete_with_http_info(self, office365_id, id, **kwargs): # noqa: E501 """Deletes a Office 365 translation rule # noqa: E501 This endpoint allows you to delete a translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.translation_rules_office365_delete_with_http_info(office365_id, id, content_type, accept, async_req=True) + >>> thread = api.translation_rules_office365_delete_with_http_info(office365_id, id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: (required) :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['office365_id', 'id', 'content_type', 'accept'] # noqa: E501 + all_params = ['office365_id', 'id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -629,14 +867,6 @@ def translation_rules_office365_delete_with_http_info(self, office365_id, id, co if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `translation_rules_office365_delete`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `translation_rules_office365_delete`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `translation_rules_office365_delete`") # noqa: E501 collection_formats = {} @@ -649,23 +879,11 @@ def translation_rules_office365_delete_with_http_info(self, office365_id, id, co query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -685,51 +903,47 @@ def translation_rules_office365_delete_with_http_info(self, office365_id, id, co _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def translation_rules_office365_get(self, office365_id, id, content_type, accept, **kwargs): # noqa: E501 + def translation_rules_office365_get(self, office365_id, id, **kwargs): # noqa: E501 """Gets a specific Office 365 translation rule # noqa: E501 This endpoint returns a specific translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.translation_rules_office365_get(office365_id, id, content_type, accept, async_req=True) + >>> thread = api.translation_rules_office365_get(office365_id, id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: (required) :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :return: Office365TranslationRule If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.translation_rules_office365_get_with_http_info(office365_id, id, content_type, accept, **kwargs) # noqa: E501 + return self.translation_rules_office365_get_with_http_info(office365_id, id, **kwargs) # noqa: E501 else: - (data) = self.translation_rules_office365_get_with_http_info(office365_id, id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.translation_rules_office365_get_with_http_info(office365_id, id, **kwargs) # noqa: E501 return data - def translation_rules_office365_get_with_http_info(self, office365_id, id, content_type, accept, **kwargs): # noqa: E501 + def translation_rules_office365_get_with_http_info(self, office365_id, id, **kwargs): # noqa: E501 """Gets a specific Office 365 translation rule # noqa: E501 This endpoint returns a specific translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.translation_rules_office365_get_with_http_info(office365_id, id, content_type, accept, async_req=True) + >>> thread = api.translation_rules_office365_get_with_http_info(office365_id, id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: (required) :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :return: Office365TranslationRule If the method is called asynchronously, returns the request thread. """ - all_params = ['office365_id', 'id', 'content_type', 'accept'] # noqa: E501 + all_params = ['office365_id', 'id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -752,14 +966,6 @@ def translation_rules_office365_get_with_http_info(self, office365_id, id, conte if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `translation_rules_office365_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `translation_rules_office365_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `translation_rules_office365_get`") # noqa: E501 collection_formats = {} @@ -772,10 +978,6 @@ def translation_rules_office365_get_with_http_info(self, office365_id, id, conte query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -785,10 +987,6 @@ def translation_rules_office365_get_with_http_info(self, office365_id, id, conte header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -808,21 +1006,19 @@ def translation_rules_office365_get_with_http_info(self, office365_id, id, conte _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def translation_rules_office365_list(self, office365_id, content_type, accept, **kwargs): # noqa: E501 + def translation_rules_office365_list(self, office365_id, **kwargs): # noqa: E501 """List all the Office 365 Translation Rules # noqa: E501 This endpoint returns all translation rules for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.translation_rules_office365_list(office365_id, content_type, accept, async_req=True) + >>> thread = api.translation_rules_office365_list(office365_id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: (required) - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. @@ -832,26 +1028,24 @@ def translation_rules_office365_list(self, office365_id, content_type, accept, * """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.translation_rules_office365_list_with_http_info(office365_id, content_type, accept, **kwargs) # noqa: E501 + return self.translation_rules_office365_list_with_http_info(office365_id, **kwargs) # noqa: E501 else: - (data) = self.translation_rules_office365_list_with_http_info(office365_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.translation_rules_office365_list_with_http_info(office365_id, **kwargs) # noqa: E501 return data - def translation_rules_office365_list_with_http_info(self, office365_id, content_type, accept, **kwargs): # noqa: E501 + def translation_rules_office365_list_with_http_info(self, office365_id, **kwargs): # noqa: E501 """List all the Office 365 Translation Rules # noqa: E501 This endpoint returns all translation rules for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.translation_rules_office365_list_with_http_info(office365_id, content_type, accept, async_req=True) + >>> thread = api.translation_rules_office365_list_with_http_info(office365_id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: (required) - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. @@ -860,7 +1054,7 @@ def translation_rules_office365_list_with_http_info(self, office365_id, content_ returns the request thread. """ - all_params = ['office365_id', 'content_type', 'accept', 'fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params = ['office365_id', 'fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -879,17 +1073,7 @@ def translation_rules_office365_list_with_http_info(self, office365_id, content_ if ('office365_id' not in params or params['office365_id'] is None): raise ValueError("Missing the required parameter `office365_id` when calling `translation_rules_office365_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `translation_rules_office365_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `translation_rules_office365_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `translation_rules_office365_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -912,10 +1096,6 @@ def translation_rules_office365_list_with_http_info(self, office365_id, content_ collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -925,10 +1105,6 @@ def translation_rules_office365_list_with_http_info(self, office365_id, content_ header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -948,19 +1124,17 @@ def translation_rules_office365_list_with_http_info(self, office365_id, content_ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def translation_rules_office365_post(self, office365_id, content_type, accept, **kwargs): # noqa: E501 + def translation_rules_office365_post(self, office365_id, **kwargs): # noqa: E501 """Create a new Office 365 Translation Rule # noqa: E501 - This endpoint allows you to create a translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` # noqa: E501 + This endpoint allows you to create a translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.translation_rules_office365_post(office365_id, content_type, accept, async_req=True) + >>> thread = api.translation_rules_office365_post(office365_id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: (required) - :param str content_type: (required) - :param str accept: (required) :param Office365TranslationRuleRequest body: :return: Office365TranslationRule If the method is called asynchronously, @@ -968,31 +1142,29 @@ def translation_rules_office365_post(self, office365_id, content_type, accept, * """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.translation_rules_office365_post_with_http_info(office365_id, content_type, accept, **kwargs) # noqa: E501 + return self.translation_rules_office365_post_with_http_info(office365_id, **kwargs) # noqa: E501 else: - (data) = self.translation_rules_office365_post_with_http_info(office365_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.translation_rules_office365_post_with_http_info(office365_id, **kwargs) # noqa: E501 return data - def translation_rules_office365_post_with_http_info(self, office365_id, content_type, accept, **kwargs): # noqa: E501 + def translation_rules_office365_post_with_http_info(self, office365_id, **kwargs): # noqa: E501 """Create a new Office 365 Translation Rule # noqa: E501 - This endpoint allows you to create a translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` # noqa: E501 + This endpoint allows you to create a translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.translation_rules_office365_post_with_http_info(office365_id, content_type, accept, async_req=True) + >>> thread = api.translation_rules_office365_post_with_http_info(office365_id, async_req=True) >>> result = thread.get() :param async_req bool :param str office365_id: (required) - :param str content_type: (required) - :param str accept: (required) :param Office365TranslationRuleRequest body: :return: Office365TranslationRule If the method is called asynchronously, returns the request thread. """ - all_params = ['office365_id', 'content_type', 'accept', 'body'] # noqa: E501 + all_params = ['office365_id', 'body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1011,14 +1183,6 @@ def translation_rules_office365_post_with_http_info(self, office365_id, content_ if ('office365_id' not in params or params['office365_id'] is None): raise ValueError("Missing the required parameter `office365_id` when calling `translation_rules_office365_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `translation_rules_office365_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `translation_rules_office365_post`") # noqa: E501 collection_formats = {} @@ -1029,10 +1193,6 @@ def translation_rules_office365_post_with_http_info(self, office365_id, content_ query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} diff --git a/jcapiv2/jcapiv2/api/office_365_import_api.py b/jcapiv2/jcapiv2/api/office_365_import_api.py new file mode 100644 index 0000000..e4e7ed4 --- /dev/null +++ b/jcapiv2/jcapiv2/api/office_365_import_api.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv2.api_client import ApiClient + + +class Office365ImportApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def office365s_list_import_users(self, office365_id, **kwargs): # noqa: E501 + """Get a list of users to import from an Office 365 instance # noqa: E501 + + Lists Office 365 users available for import. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.office365s_list_import_users(office365_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str office365_id: (required) + :param str consistency_level: Defines the consistency header for O365 requests. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#request-headers + :param int top: Office 365 API maximum number of results per page. See https://docs.microsoft.com/en-us/graph/paging. + :param str skip_token: Office 365 API token used to access the next page of results. See https://docs.microsoft.com/en-us/graph/paging. + :param str filter: Office 365 API filter parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + :param str search: Office 365 API search parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + :param str orderby: Office 365 API orderby parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + :param bool count: Office 365 API count parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + :return: InlineResponse20011 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.office365s_list_import_users_with_http_info(office365_id, **kwargs) # noqa: E501 + else: + (data) = self.office365s_list_import_users_with_http_info(office365_id, **kwargs) # noqa: E501 + return data + + def office365s_list_import_users_with_http_info(self, office365_id, **kwargs): # noqa: E501 + """Get a list of users to import from an Office 365 instance # noqa: E501 + + Lists Office 365 users available for import. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.office365s_list_import_users_with_http_info(office365_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str office365_id: (required) + :param str consistency_level: Defines the consistency header for O365 requests. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#request-headers + :param int top: Office 365 API maximum number of results per page. See https://docs.microsoft.com/en-us/graph/paging. + :param str skip_token: Office 365 API token used to access the next page of results. See https://docs.microsoft.com/en-us/graph/paging. + :param str filter: Office 365 API filter parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + :param str search: Office 365 API search parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + :param str orderby: Office 365 API orderby parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + :param bool count: Office 365 API count parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + :return: InlineResponse20011 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['office365_id', 'consistency_level', 'top', 'skip_token', 'filter', 'search', 'orderby', 'count'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method office365s_list_import_users" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'office365_id' is set + if ('office365_id' not in params or + params['office365_id'] is None): + raise ValueError("Missing the required parameter `office365_id` when calling `office365s_list_import_users`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'office365_id' in params: + path_params['office365_id'] = params['office365_id'] # noqa: E501 + + query_params = [] + if 'top' in params: + query_params.append(('top', params['top'])) # noqa: E501 + if 'skip_token' in params: + query_params.append(('skipToken', params['skip_token'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + if 'search' in params: + query_params.append(('search', params['search'])) # noqa: E501 + if 'orderby' in params: + query_params.append(('orderby', params['orderby'])) # noqa: E501 + if 'count' in params: + query_params.append(('count', params['count'])) # noqa: E501 + + header_params = {} + if 'consistency_level' in params: + header_params['ConsistencyLevel'] = params['consistency_level'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/office365s/{office365_id}/import/users', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse20011', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/organizations_api.py b/jcapiv2/jcapiv2/api/organizations_api.py index 7afebf0..5654c25 100644 --- a/jcapiv2/jcapiv2/api/organizations_api.py +++ b/jcapiv2/jcapiv2/api/organizations_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,59 +32,47 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def org_crypto_get(self, id, content_type, accept, **kwargs): # noqa: E501 - """Get Crypto Settings # noqa: E501 + def administrator_organizations_create_by_administrator(self, id, **kwargs): # noqa: E501 + """Allow Adminstrator access to an Organization. # noqa: E501 + This endpoint allows you to grant Administrator access to an Organization. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.org_crypto_get(id, content_type, accept, async_req=True) + >>> thread = api.administrator_organizations_create_by_administrator(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param str x_org_id: - :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param int limit: The number of records to return at once. Limited to 100. - :return: OrgCryptoSettings + :param AdministratorOrganizationLinkReq body: + :return: AdministratorOrganizationLink If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.org_crypto_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.administrator_organizations_create_by_administrator_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.org_crypto_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.administrator_organizations_create_by_administrator_with_http_info(id, **kwargs) # noqa: E501 return data - def org_crypto_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """Get Crypto Settings # noqa: E501 + def administrator_organizations_create_by_administrator_with_http_info(self, id, **kwargs): # noqa: E501 + """Allow Adminstrator access to an Organization. # noqa: E501 + This endpoint allows you to grant Administrator access to an Organization. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.org_crypto_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.administrator_organizations_create_by_administrator_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param str x_org_id: - :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param int limit: The number of records to return at once. Limited to 100. - :return: OrgCryptoSettings + :param AdministratorOrganizationLinkReq body: + :return: AdministratorOrganizationLink If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'fields', 'filter', 'x_org_id', 'skip', 'sort', 'limit'] # noqa: E501 + all_params = ['id', 'body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -96,25 +83,15 @@ def org_crypto_get_with_http_info(self, id, content_type, accept, **kwargs): # if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method org_crypto_get" % key + " to method administrator_organizations_create_by_administrator" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `org_crypto_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `org_crypto_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `org_crypto_get`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `org_crypto_get`, must be a value greater than or equal to `0`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `administrator_organizations_create_by_administrator`") # noqa: E501 + collection_formats = {} path_params = {} @@ -122,32 +99,15 @@ def org_crypto_get_with_http_info(self, id, content_type, accept, **kwargs): # path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'fields' in params: - query_params.append(('fields', params['fields'])) # noqa: E501 - collection_formats['fields'] = 'csv' # noqa: E501 - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 - collection_formats['filter'] = 'csv' # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - collection_formats['sort'] = 'csv' # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} - if 'x_org_id' in params: - header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} body_params = None + if 'body' in params: + body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 @@ -160,14 +120,14 @@ def org_crypto_get_with_http_info(self, id, content_type, accept, **kwargs): # auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/organizations/{id}/crypto', 'GET', + '/administrators/{id}/organizationlinks', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='OrgCryptoSettings', # noqa: E501 + response_type='AdministratorOrganizationLink', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -175,61 +135,152 @@ def org_crypto_get_with_http_info(self, id, content_type, accept, **kwargs): # _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def org_crypto_put(self, id, content_type, accept, **kwargs): # noqa: E501 - """Edit Crypto Settings # noqa: E501 + def administrator_organizations_list_by_administrator(self, id, **kwargs): # noqa: E501 + """List the association links between an Administrator and Organizations. # noqa: E501 + This endpoint returns the association links between an Administrator and Organizations. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.org_crypto_put(id, content_type, accept, async_req=True) + >>> thread = api.administrator_organizations_list_by_administrator(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param OrgCryptoSettings body: - :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param str x_org_id: - :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. :param int limit: The number of records to return at once. Limited to 100. - :return: object + :param int skip: The offset into the records to return. + :return: list[AdministratorOrganizationLink] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.org_crypto_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.administrator_organizations_list_by_administrator_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.org_crypto_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.administrator_organizations_list_by_administrator_with_http_info(id, **kwargs) # noqa: E501 return data - def org_crypto_put_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """Edit Crypto Settings # noqa: E501 + def administrator_organizations_list_by_administrator_with_http_info(self, id, **kwargs): # noqa: E501 + """List the association links between an Administrator and Organizations. # noqa: E501 + This endpoint returns the association links between an Administrator and Organizations. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.org_crypto_put_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.administrator_organizations_list_by_administrator_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param OrgCryptoSettings body: - :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param str x_org_id: + :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: list[AdministratorOrganizationLink] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'limit', 'skip'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method administrator_organizations_list_by_administrator" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `administrator_organizations_list_by_administrator`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/administrators/{id}/organizationlinks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[AdministratorOrganizationLink]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def administrator_organizations_list_by_organization(self, id, **kwargs): # noqa: E501 + """List the association links between an Organization and Administrators. # noqa: E501 + + This endpoint returns the association links between an Organization and Administrators. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_list_by_organization(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: list[AdministratorOrganizationLink] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.administrator_organizations_list_by_organization_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.administrator_organizations_list_by_organization_with_http_info(id, **kwargs) # noqa: E501 + return data + + def administrator_organizations_list_by_organization_with_http_info(self, id, **kwargs): # noqa: E501 + """List the association links between an Organization and Administrators. # noqa: E501 + + This endpoint returns the association links between an Organization and Administrators. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_list_by_organization_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) :param int limit: The number of records to return at once. Limited to 100. - :return: object + :param int skip: The offset into the records to return. + :return: list[AdministratorOrganizationLink] If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'body', 'fields', 'filter', 'x_org_id', 'skip', 'sort', 'limit'] # noqa: E501 + all_params = ['id', 'limit', 'skip'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -240,25 +291,15 @@ def org_crypto_put_with_http_info(self, id, content_type, accept, **kwargs): # if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method org_crypto_put" % key + " to method administrator_organizations_list_by_organization" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `org_crypto_put`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `org_crypto_put`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `org_crypto_put`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `org_crypto_put`, must be a value greater than or equal to `0`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `administrator_organizations_list_by_organization`") # noqa: E501 + collection_formats = {} path_params = {} @@ -266,12 +307,206 @@ def org_crypto_put_with_http_info(self, id, content_type, accept, **kwargs): # path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'fields' in params: - query_params.append(('fields', params['fields'])) # noqa: E501 - collection_formats['fields'] = 'csv' # noqa: E501 - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 - collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/organizations/{id}/administratorlinks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[AdministratorOrganizationLink]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def administrator_organizations_remove_by_administrator(self, administrator_id, id, **kwargs): # noqa: E501 + """Remove association between an Administrator and an Organization. # noqa: E501 + + This endpoint removes the association link between an Administrator and an Organization. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_remove_by_administrator(administrator_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str administrator_id: (required) + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.administrator_organizations_remove_by_administrator_with_http_info(administrator_id, id, **kwargs) # noqa: E501 + else: + (data) = self.administrator_organizations_remove_by_administrator_with_http_info(administrator_id, id, **kwargs) # noqa: E501 + return data + + def administrator_organizations_remove_by_administrator_with_http_info(self, administrator_id, id, **kwargs): # noqa: E501 + """Remove association between an Administrator and an Organization. # noqa: E501 + + This endpoint removes the association link between an Administrator and an Organization. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.administrator_organizations_remove_by_administrator_with_http_info(administrator_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str administrator_id: (required) + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['administrator_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method administrator_organizations_remove_by_administrator" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'administrator_id' is set + if ('administrator_id' not in params or + params['administrator_id'] is None): + raise ValueError("Missing the required parameter `administrator_id` when calling `administrator_organizations_remove_by_administrator`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `administrator_organizations_remove_by_administrator`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'administrator_id' in params: + path_params['administrator_id'] = params['administrator_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/administrators/{administrator_id}/organizationlinks/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def organizations_list_cases(self, **kwargs): # noqa: E501 + """Get all cases (Support/Feature requests) for organization # noqa: E501 + + This endpoint returns the cases (Support/Feature requests) for the organization # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.organizations_list_cases(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param int limit: The number of records to return at once. Limited to 100. + :return: OrganizationCasesResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.organizations_list_cases_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.organizations_list_cases_with_http_info(**kwargs) # noqa: E501 + return data + + def organizations_list_cases_with_http_info(self, **kwargs): # noqa: E501 + """Get all cases (Support/Feature requests) for organization # noqa: E501 + + This endpoint returns the cases (Support/Feature requests) for the organization # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.organizations_list_cases_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param int limit: The number of records to return at once. Limited to 100. + :return: OrganizationCasesResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['skip', 'sort', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method organizations_list_cases" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 if 'sort' in params: @@ -281,39 +516,27 @@ def org_crypto_put_with_http_info(self, id, content_type, accept, **kwargs): # query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} - if 'x_org_id' in params: - header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} body_params = None - if 'body' in params: - body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/organizations/{id}/crypto', 'PUT', + '/organizations/cases', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='object', # noqa: E501 + response_type='OrganizationCasesResponse', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/jcapiv2/jcapiv2/api/policies_api.py b/jcapiv2/jcapiv2/api/policies_api.py index 64f2acc..9d946d0 100644 --- a/jcapiv2/jcapiv2/api/policies_api.py +++ b/jcapiv2/jcapiv2/api/policies_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,57 +32,53 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def graph_policy_associations_list(self, policy_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_policy_associations_list(self, policy_id, targets, **kwargs): # noqa: E501 """List the associations of a Policy # noqa: E501 This endpoint returns the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_policy_associations_list(policy_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_policy_associations_list(policy_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str policy_id: ObjectID of the Policy. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"policy\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_policy_associations_list_with_http_info(policy_id, targets, content_type, accept, **kwargs) # noqa: E501 + return self.graph_policy_associations_list_with_http_info(policy_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_policy_associations_list_with_http_info(policy_id, targets, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_policy_associations_list_with_http_info(policy_id, targets, **kwargs) # noqa: E501 return data - def graph_policy_associations_list_with_http_info(self, policy_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_policy_associations_list_with_http_info(self, policy_id, targets, **kwargs): # noqa: E501 """List the associations of a Policy # noqa: E501 This endpoint returns the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_policy_associations_list_with_http_info(policy_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_policy_associations_list_with_http_info(policy_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str policy_id: ObjectID of the Policy. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"policy\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['policy_id', 'targets', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['policy_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -106,17 +101,7 @@ def graph_policy_associations_list_with_http_info(self, policy_id, targets, cont if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_policy_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_policy_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_policy_associations_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_policy_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -133,10 +118,6 @@ def graph_policy_associations_list_with_http_info(self, policy_id, targets, cont query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -148,10 +129,6 @@ def graph_policy_associations_list_with_http_info(self, policy_id, targets, cont header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -171,53 +148,49 @@ def graph_policy_associations_list_with_http_info(self, policy_id, targets, cont _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_policy_associations_post(self, policy_id, content_type, accept, **kwargs): # noqa: E501 + def graph_policy_associations_post(self, policy_id, **kwargs): # noqa: E501 """Manage the associations of a Policy # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_policy_associations_post(policy_id, content_type, accept, async_req=True) + >>> thread = api.graph_policy_associations_post(policy_id, async_req=True) >>> result = thread.get() :param async_req bool :param str policy_id: ObjectID of the Policy. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationPolicy body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_policy_associations_post_with_http_info(policy_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_policy_associations_post_with_http_info(policy_id, **kwargs) # noqa: E501 else: - (data) = self.graph_policy_associations_post_with_http_info(policy_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_policy_associations_post_with_http_info(policy_id, **kwargs) # noqa: E501 return data - def graph_policy_associations_post_with_http_info(self, policy_id, content_type, accept, **kwargs): # noqa: E501 + def graph_policy_associations_post_with_http_info(self, policy_id, **kwargs): # noqa: E501 """Manage the associations of a Policy # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_policy_associations_post_with_http_info(policy_id, content_type, accept, async_req=True) + >>> thread = api.graph_policy_associations_post_with_http_info(policy_id, async_req=True) >>> result = thread.get() :param async_req bool :param str policy_id: ObjectID of the Policy. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationPolicy body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['policy_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['policy_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -236,14 +209,6 @@ def graph_policy_associations_post_with_http_info(self, policy_id, content_type, if ('policy_id' not in params or params['policy_id'] is None): raise ValueError("Missing the required parameter `policy_id` when calling `graph_policy_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_policy_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_policy_associations_post`") # noqa: E501 collection_formats = {} @@ -254,10 +219,6 @@ def graph_policy_associations_post_with_http_info(self, policy_id, content_type, query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -267,10 +228,6 @@ def graph_policy_associations_post_with_http_info(self, policy_id, content_type, body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -294,57 +251,178 @@ def graph_policy_associations_post_with_http_info(self, policy_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_policy_traverse_system(self, policy_id, content_type, accept, **kwargs): # noqa: E501 + def graph_policy_member_of(self, policy_id, **kwargs): # noqa: E501 + """List the parent Groups of a Policy # noqa: E501 + + This endpoint returns all the Policy Groups a Policy is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_member_of(policy_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str policy_id: ObjectID of the Policy. (required) + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str _date: Current date header for the System Context API + :param str authorization: Authorization header for the System Context API + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_member_of_with_http_info(policy_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_member_of_with_http_info(policy_id, **kwargs) # noqa: E501 + return data + + def graph_policy_member_of_with_http_info(self, policy_id, **kwargs): # noqa: E501 + """List the parent Groups of a Policy # noqa: E501 + + This endpoint returns all the Policy Groups a Policy is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_member_of_with_http_info(policy_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str policy_id: ObjectID of the Policy. (required) + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str _date: Current date header for the System Context API + :param str authorization: Authorization header for the System Context API + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['policy_id', 'filter', 'limit', 'skip', '_date', 'authorization', 'sort', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_member_of" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'policy_id' is set + if ('policy_id' not in params or + params['policy_id'] is None): + raise ValueError("Missing the required parameter `policy_id` when calling `graph_policy_member_of`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'policy_id' in params: + path_params['policy_id'] = params['policy_id'] # noqa: E501 + + query_params = [] + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + if '_date' in params: + header_params['Date'] = params['_date'] # noqa: E501 + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policies/{policy_id}/memberof', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_traverse_system(self, policy_id, **kwargs): # noqa: E501 """List the Systems bound to a Policy # noqa: E501 This endpoint will return all Systems bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_policy_traverse_system(policy_id, content_type, accept, async_req=True) + >>> thread = api.graph_policy_traverse_system(policy_id, async_req=True) >>> result = thread.get() :param async_req bool :param str policy_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_policy_traverse_system_with_http_info(policy_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_policy_traverse_system_with_http_info(policy_id, **kwargs) # noqa: E501 else: - (data) = self.graph_policy_traverse_system_with_http_info(policy_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_policy_traverse_system_with_http_info(policy_id, **kwargs) # noqa: E501 return data - def graph_policy_traverse_system_with_http_info(self, policy_id, content_type, accept, **kwargs): # noqa: E501 + def graph_policy_traverse_system_with_http_info(self, policy_id, **kwargs): # noqa: E501 """List the Systems bound to a Policy # noqa: E501 This endpoint will return all Systems bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_policy_traverse_system_with_http_info(policy_id, content_type, accept, async_req=True) + >>> thread = api.graph_policy_traverse_system_with_http_info(policy_id, async_req=True) >>> result = thread.get() :param async_req bool :param str policy_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['policy_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['policy_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -363,17 +441,7 @@ def graph_policy_traverse_system_with_http_info(self, policy_id, content_type, a if ('policy_id' not in params or params['policy_id'] is None): raise ValueError("Missing the required parameter `policy_id` when calling `graph_policy_traverse_system`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_policy_traverse_system`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_policy_traverse_system`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_policy_traverse_system`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -392,10 +460,6 @@ def graph_policy_traverse_system_with_http_info(self, policy_id, content_type, a header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -405,10 +469,6 @@ def graph_policy_traverse_system_with_http_info(self, policy_id, content_type, a header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -428,57 +488,53 @@ def graph_policy_traverse_system_with_http_info(self, policy_id, content_type, a _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_policy_traverse_system_group(self, policy_id, content_type, accept, **kwargs): # noqa: E501 + def graph_policy_traverse_system_group(self, policy_id, **kwargs): # noqa: E501 """List the System Groups bound to a Policy # noqa: E501 This endpoint will return all Systems Groups bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_policy_traverse_system_group(policy_id, content_type, accept, async_req=True) + >>> thread = api.graph_policy_traverse_system_group(policy_id, async_req=True) >>> result = thread.get() :param async_req bool :param str policy_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_policy_traverse_system_group_with_http_info(policy_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_policy_traverse_system_group_with_http_info(policy_id, **kwargs) # noqa: E501 else: - (data) = self.graph_policy_traverse_system_group_with_http_info(policy_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_policy_traverse_system_group_with_http_info(policy_id, **kwargs) # noqa: E501 return data - def graph_policy_traverse_system_group_with_http_info(self, policy_id, content_type, accept, **kwargs): # noqa: E501 + def graph_policy_traverse_system_group_with_http_info(self, policy_id, **kwargs): # noqa: E501 """List the System Groups bound to a Policy # noqa: E501 This endpoint will return all Systems Groups bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_policy_traverse_system_group_with_http_info(policy_id, content_type, accept, async_req=True) + >>> thread = api.graph_policy_traverse_system_group_with_http_info(policy_id, async_req=True) >>> result = thread.get() :param async_req bool :param str policy_id: ObjectID of the Command. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['policy_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['policy_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -497,17 +553,7 @@ def graph_policy_traverse_system_group_with_http_info(self, policy_id, content_t if ('policy_id' not in params or params['policy_id'] is None): raise ValueError("Missing the required parameter `policy_id` when calling `graph_policy_traverse_system_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_policy_traverse_system_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_policy_traverse_system_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_policy_traverse_system_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -526,10 +572,6 @@ def graph_policy_traverse_system_group_with_http_info(self, policy_id, content_t header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -539,10 +581,6 @@ def graph_policy_traverse_system_group_with_http_info(self, policy_id, content_t header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -562,51 +600,47 @@ def graph_policy_traverse_system_group_with_http_info(self, policy_id, content_t _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def policies_delete(self, id, content_type, accept, **kwargs): # noqa: E501 + def policies_delete(self, id, **kwargs): # noqa: E501 """Deletes a Policy # noqa: E501 This endpoint allows you to delete a policy. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/policies/5a837ecd232e110d4291e6b9 \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policies_delete(id, content_type, accept, async_req=True) + >>> thread = api.policies_delete(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the Policy object. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.policies_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.policies_delete_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.policies_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.policies_delete_with_http_info(id, **kwargs) # noqa: E501 return data - def policies_delete_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def policies_delete_with_http_info(self, id, **kwargs): # noqa: E501 """Deletes a Policy # noqa: E501 This endpoint allows you to delete a policy. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/policies/5a837ecd232e110d4291e6b9 \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policies_delete_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.policies_delete_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the Policy object. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -625,14 +659,6 @@ def policies_delete_with_http_info(self, id, content_type, accept, **kwargs): # if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `policies_delete`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `policies_delete`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `policies_delete`") # noqa: E501 collection_formats = {} @@ -643,10 +669,6 @@ def policies_delete_with_http_info(self, id, content_type, accept, **kwargs): # query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -654,14 +676,6 @@ def policies_delete_with_http_info(self, id, content_type, accept, **kwargs): # local_var_files = {} body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -681,51 +695,47 @@ def policies_delete_with_http_info(self, id, content_type, accept, **kwargs): # _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def policies_get(self, id, content_type, accept, **kwargs): # noqa: E501 + def policies_get(self, id, **kwargs): # noqa: E501 """Gets a specific Policy. # noqa: E501 This endpoint returns a specific policy. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{PolicyID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policies_get(id, content_type, accept, async_req=True) + >>> thread = api.policies_get(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the Policy object. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: PolicyWithDetails If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.policies_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.policies_get_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.policies_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.policies_get_with_http_info(id, **kwargs) # noqa: E501 return data - def policies_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def policies_get_with_http_info(self, id, **kwargs): # noqa: E501 """Gets a specific Policy. # noqa: E501 This endpoint returns a specific policy. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{PolicyID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policies_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.policies_get_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the Policy object. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: PolicyWithDetails If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -744,14 +754,6 @@ def policies_get_with_http_info(self, id, content_type, accept, **kwargs): # no if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `policies_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `policies_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `policies_get`") # noqa: E501 collection_formats = {} @@ -762,10 +764,6 @@ def policies_get_with_http_info(self, id, content_type, accept, **kwargs): # no query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -777,10 +775,6 @@ def policies_get_with_http_info(self, id, content_type, accept, **kwargs): # no header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -800,59 +794,55 @@ def policies_get_with_http_info(self, id, content_type, accept, **kwargs): # no _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def policies_list(self, content_type, accept, **kwargs): # noqa: E501 + def policies_list(self, **kwargs): # noqa: E501 """Lists all the Policies # noqa: E501 This endpoint returns all policies. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policies_list(content_type, accept, async_req=True) + >>> thread = api.policies_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[Policy] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.policies_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.policies_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.policies_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.policies_list_with_http_info(**kwargs) # noqa: E501 return data - def policies_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def policies_list_with_http_info(self, **kwargs): # noqa: E501 """Lists all the Policies # noqa: E501 This endpoint returns all policies. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policies_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.policies_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[Policy] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -867,17 +857,7 @@ def policies_list_with_http_info(self, content_type, accept, **kwargs): # noqa: ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `policies_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `policies_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `policies_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -898,10 +878,6 @@ def policies_list_with_http_info(self, content_type, accept, **kwargs): # noqa: collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -913,10 +889,6 @@ def policies_list_with_http_info(self, content_type, accept, **kwargs): # noqa: header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -936,51 +908,47 @@ def policies_list_with_http_info(self, content_type, accept, **kwargs): # noqa: _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def policies_post(self, content_type, accept, **kwargs): # noqa: E501 + def policies_post(self, **kwargs): # noqa: E501 """Create a new Policy # noqa: E501 - This endpoint allows you to create a policy. Given the amount of configurable parameters required to create a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Policy_Parameters} }' ``` # noqa: E501 + This endpoint allows you to create a policy. Given the amount of configurable parameters required to create a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Policy_Parameters} }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policies_post(content_type, accept, async_req=True) + >>> thread = api.policies_post(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param PolicyRequest body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: PolicyWithDetails If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.policies_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.policies_post_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.policies_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.policies_post_with_http_info(**kwargs) # noqa: E501 return data - def policies_post_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def policies_post_with_http_info(self, **kwargs): # noqa: E501 """Create a new Policy # noqa: E501 - This endpoint allows you to create a policy. Given the amount of configurable parameters required to create a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Policy_Parameters} }' ``` # noqa: E501 + This endpoint allows you to create a policy. Given the amount of configurable parameters required to create a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Policy_Parameters} }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policies_post_with_http_info(content_type, accept, async_req=True) + >>> thread = api.policies_post_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param PolicyRequest body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: PolicyWithDetails If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -995,14 +963,6 @@ def policies_post_with_http_info(self, content_type, accept, **kwargs): # noqa: ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `policies_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `policies_post`") # noqa: E501 collection_formats = {} @@ -1011,10 +971,6 @@ def policies_post_with_http_info(self, content_type, accept, **kwargs): # noqa: query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1054,7 +1010,7 @@ def policies_post_with_http_info(self, content_type, accept, **kwargs): # noqa: def policies_put(self, id, **kwargs): # noqa: E501 """Update an existing Policy # noqa: E501 - This endpoint allows you to update a policy. Given the amount of configurable parameters required to update a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/policies/59fced45c9118022172547ff \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY' \\ -d '{ {Policy_Parameters} }' ``` # noqa: E501 + This endpoint allows you to update a policy. Given the amount of configurable parameters required to update a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/policies/59fced45c9118022172547ff \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Policy_Parameters} }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.policies_put(id, async_req=True) @@ -1063,7 +1019,7 @@ def policies_put(self, id, **kwargs): # noqa: E501 :param async_req bool :param str id: ObjectID of the Policy object. (required) :param PolicyRequest body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: Policy If the method is called asynchronously, returns the request thread. @@ -1078,7 +1034,7 @@ def policies_put(self, id, **kwargs): # noqa: E501 def policies_put_with_http_info(self, id, **kwargs): # noqa: E501 """Update an existing Policy # noqa: E501 - This endpoint allows you to update a policy. Given the amount of configurable parameters required to update a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/policies/59fced45c9118022172547ff \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY' \\ -d '{ {Policy_Parameters} }' ``` # noqa: E501 + This endpoint allows you to update a policy. Given the amount of configurable parameters required to update a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/policies/59fced45c9118022172547ff \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Policy_Parameters} }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.policies_put_with_http_info(id, async_req=True) @@ -1087,7 +1043,7 @@ def policies_put_with_http_info(self, id, **kwargs): # noqa: E501 :param async_req bool :param str id: ObjectID of the Policy object. (required) :param PolicyRequest body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: Policy If the method is called asynchronously, returns the request thread. @@ -1158,51 +1114,47 @@ def policies_put_with_http_info(self, id, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def policyresults_get(self, id, content_type, accept, **kwargs): # noqa: E501 + def policyresults_get(self, id, **kwargs): # noqa: E501 """Get a specific Policy Result. # noqa: E501 This endpoint will return the policy results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policyresults/{Policy_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policyresults_get(id, content_type, accept, async_req=True) + >>> thread = api.policyresults_get(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the Policy Result. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: PolicyResult If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.policyresults_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.policyresults_get_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.policyresults_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.policyresults_get_with_http_info(id, **kwargs) # noqa: E501 return data - def policyresults_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def policyresults_get_with_http_info(self, id, **kwargs): # noqa: E501 """Get a specific Policy Result. # noqa: E501 This endpoint will return the policy results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policyresults/{Policy_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policyresults_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.policyresults_get_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the Policy Result. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: PolicyResult If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1221,14 +1173,6 @@ def policyresults_get_with_http_info(self, id, content_type, accept, **kwargs): if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `policyresults_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `policyresults_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `policyresults_get`") # noqa: E501 collection_formats = {} @@ -1239,10 +1183,6 @@ def policyresults_get_with_http_info(self, id, content_type, accept, **kwargs): query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1254,10 +1194,6 @@ def policyresults_get_with_http_info(self, id, content_type, accept, **kwargs): header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1277,23 +1213,21 @@ def policyresults_get_with_http_info(self, id, content_type, accept, **kwargs): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def policyresults_list(self, policy_id, content_type, accept, **kwargs): # noqa: E501 + def policyresults_list(self, policy_id, **kwargs): # noqa: E501 """Lists all the policy results of a policy. # noqa: E501 This endpoint returns all policies results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policyresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policyresults_list(policy_id, content_type, accept, async_req=True) + >>> thread = api.policyresults_list(policy_id, async_req=True) >>> result = thread.get() :param async_req bool :param str policy_id: (required) - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. :return: list[PolicyResult] @@ -1302,28 +1236,26 @@ def policyresults_list(self, policy_id, content_type, accept, **kwargs): # noqa """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.policyresults_list_with_http_info(policy_id, content_type, accept, **kwargs) # noqa: E501 + return self.policyresults_list_with_http_info(policy_id, **kwargs) # noqa: E501 else: - (data) = self.policyresults_list_with_http_info(policy_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.policyresults_list_with_http_info(policy_id, **kwargs) # noqa: E501 return data - def policyresults_list_with_http_info(self, policy_id, content_type, accept, **kwargs): # noqa: E501 + def policyresults_list_with_http_info(self, policy_id, **kwargs): # noqa: E501 """Lists all the policy results of a policy. # noqa: E501 This endpoint returns all policies results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policyresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policyresults_list_with_http_info(policy_id, content_type, accept, async_req=True) + >>> thread = api.policyresults_list_with_http_info(policy_id, async_req=True) >>> result = thread.get() :param async_req bool :param str policy_id: (required) - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. :return: list[PolicyResult] @@ -1331,7 +1263,7 @@ def policyresults_list_with_http_info(self, policy_id, content_type, accept, **k returns the request thread. """ - all_params = ['policy_id', 'content_type', 'accept', 'fields', 'filter', 'limit', 'x_org_id', 'skip', 'sort'] # noqa: E501 + all_params = ['policy_id', 'fields', 'filter', 'limit', 'x_org_id', 'skip', 'sort'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1350,17 +1282,7 @@ def policyresults_list_with_http_info(self, policy_id, content_type, accept, **k if ('policy_id' not in params or params['policy_id'] is None): raise ValueError("Missing the required parameter `policy_id` when calling `policyresults_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `policyresults_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `policyresults_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `policyresults_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1385,10 +1307,6 @@ def policyresults_list_with_http_info(self, policy_id, content_type, accept, **k header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1398,10 +1316,6 @@ def policyresults_list_with_http_info(self, policy_id, content_type, accept, **k header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1421,22 +1335,20 @@ def policyresults_list_with_http_info(self, policy_id, content_type, accept, **k _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def policyresults_org_list(self, content_type, accept, **kwargs): # noqa: E501 - """Lists all the policy results for an organization. # noqa: E501 + def policyresults_org_list(self, **kwargs): # noqa: E501 + """Lists all of the policy results for an organization. # noqa: E501 - This endpoint returns all policies results for an organization. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policyresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns all policy results for an organization. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policyresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policyresults_org_list(content_type, accept, async_req=True) + >>> thread = api.policyresults_org_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. :return: list[PolicyResult] @@ -1445,27 +1357,25 @@ def policyresults_org_list(self, content_type, accept, **kwargs): # noqa: E501 """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.policyresults_org_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.policyresults_org_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.policyresults_org_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.policyresults_org_list_with_http_info(**kwargs) # noqa: E501 return data - def policyresults_org_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """Lists all the policy results for an organization. # noqa: E501 + def policyresults_org_list_with_http_info(self, **kwargs): # noqa: E501 + """Lists all of the policy results for an organization. # noqa: E501 - This endpoint returns all policies results for an organization. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policyresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns all policy results for an organization. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policyresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policyresults_org_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.policyresults_org_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. :return: list[PolicyResult] @@ -1473,7 +1383,7 @@ def policyresults_org_list_with_http_info(self, content_type, accept, **kwargs): returns the request thread. """ - all_params = ['content_type', 'accept', 'fields', 'filter', 'limit', 'x_org_id', 'skip', 'sort'] # noqa: E501 + all_params = ['fields', 'filter', 'limit', 'x_org_id', 'skip', 'sort'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1488,17 +1398,7 @@ def policyresults_org_list_with_http_info(self, content_type, accept, **kwargs): ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `policyresults_org_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `policyresults_org_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `policyresults_org_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1521,10 +1421,6 @@ def policyresults_org_list_with_http_info(self, content_type, accept, **kwargs): header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1534,10 +1430,6 @@ def policyresults_org_list_with_http_info(self, content_type, accept, **kwargs): header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1557,61 +1449,57 @@ def policyresults_org_list_with_http_info(self, content_type, accept, **kwargs): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def policystatuses_list(self, policy_id, content_type, accept, **kwargs): # noqa: E501 + def policystatuses_policies_list(self, policy_id, **kwargs): # noqa: E501 """Lists the latest policy results of a policy. # noqa: E501 - This endpoint returns the latest policies results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns the latest policy results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policystatuses_list(policy_id, content_type, accept, async_req=True) + >>> thread = api.policystatuses_policies_list(policy_id, async_req=True) >>> result = thread.get() :param async_req bool :param str policy_id: (required) - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[PolicyResult] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.policystatuses_list_with_http_info(policy_id, content_type, accept, **kwargs) # noqa: E501 + return self.policystatuses_policies_list_with_http_info(policy_id, **kwargs) # noqa: E501 else: - (data) = self.policystatuses_list_with_http_info(policy_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.policystatuses_policies_list_with_http_info(policy_id, **kwargs) # noqa: E501 return data - def policystatuses_list_with_http_info(self, policy_id, content_type, accept, **kwargs): # noqa: E501 + def policystatuses_policies_list_with_http_info(self, policy_id, **kwargs): # noqa: E501 """Lists the latest policy results of a policy. # noqa: E501 - This endpoint returns the latest policies results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns the latest policy results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policystatuses_list_with_http_info(policy_id, content_type, accept, async_req=True) + >>> thread = api.policystatuses_policies_list_with_http_info(policy_id, async_req=True) >>> result = thread.get() :param async_req bool :param str policy_id: (required) - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[PolicyResult] If the method is called asynchronously, returns the request thread. """ - all_params = ['policy_id', 'content_type', 'accept', 'fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['policy_id', 'fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1622,25 +1510,15 @@ def policystatuses_list_with_http_info(self, policy_id, content_type, accept, ** if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method policystatuses_list" % key + " to method policystatuses_policies_list" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'policy_id' is set if ('policy_id' not in params or params['policy_id'] is None): - raise ValueError("Missing the required parameter `policy_id` when calling `policystatuses_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `policystatuses_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `policystatuses_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `policystatuses_list`, must be a value greater than or equal to `0`") # noqa: E501 + raise ValueError("Missing the required parameter `policy_id` when calling `policystatuses_policies_list`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1663,10 +1541,6 @@ def policystatuses_list_with_http_info(self, policy_id, content_type, accept, ** collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1678,10 +1552,6 @@ def policystatuses_list_with_http_info(self, policy_id, content_type, accept, ** header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1701,61 +1571,57 @@ def policystatuses_list_with_http_info(self, policy_id, content_type, accept, ** _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def policystatuses_list_0(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def policystatuses_systems_list(self, system_id, **kwargs): # noqa: E501 """List the policy statuses for a system # noqa: E501 This endpoint returns the policy results for a particular system. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policystatuses_list_0(system_id, content_type, accept, async_req=True) + >>> thread = api.policystatuses_systems_list(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[PolicyResult] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.policystatuses_list_0_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.policystatuses_systems_list_with_http_info(system_id, **kwargs) # noqa: E501 else: - (data) = self.policystatuses_list_0_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.policystatuses_systems_list_with_http_info(system_id, **kwargs) # noqa: E501 return data - def policystatuses_list_0_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def policystatuses_systems_list_with_http_info(self, system_id, **kwargs): # noqa: E501 """List the policy statuses for a system # noqa: E501 This endpoint returns the policy results for a particular system. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policystatuses_list_0_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.policystatuses_systems_list_with_http_info(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[PolicyResult] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['system_id', 'fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1766,25 +1632,15 @@ def policystatuses_list_0_with_http_info(self, system_id, content_type, accept, if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method policystatuses_list_0" % key + " to method policystatuses_systems_list" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'system_id' is set if ('system_id' not in params or params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `policystatuses_list_0`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `policystatuses_list_0`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `policystatuses_list_0`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `policystatuses_list_0`, must be a value greater than or equal to `0`") # noqa: E501 + raise ValueError("Missing the required parameter `system_id` when calling `policystatuses_systems_list`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1807,10 +1663,6 @@ def policystatuses_list_0_with_http_info(self, system_id, content_type, accept, collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1822,10 +1674,6 @@ def policystatuses_list_0_with_http_info(self, system_id, content_type, accept, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1845,51 +1693,47 @@ def policystatuses_list_0_with_http_info(self, system_id, content_type, accept, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def policytemplates_get(self, id, content_type, accept, **kwargs): # noqa: E501 + def policytemplates_get(self, id, **kwargs): # noqa: E501 """Get a specific Policy Template # noqa: E501 - This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates/{Policy_Template_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policytemplates_get(id, content_type, accept, async_req=True) + >>> thread = api.policytemplates_get(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the Policy Template. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: PolicyTemplateWithDetails If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.policytemplates_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.policytemplates_get_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.policytemplates_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.policytemplates_get_with_http_info(id, **kwargs) # noqa: E501 return data - def policytemplates_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def policytemplates_get_with_http_info(self, id, **kwargs): # noqa: E501 """Get a specific Policy Template # noqa: E501 - This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates/{Policy_Template_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policytemplates_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.policytemplates_get_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the Policy Template. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: PolicyTemplateWithDetails If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1908,14 +1752,6 @@ def policytemplates_get_with_http_info(self, id, content_type, accept, **kwargs) if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `policytemplates_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `policytemplates_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `policytemplates_get`") # noqa: E501 collection_formats = {} @@ -1926,10 +1762,6 @@ def policytemplates_get_with_http_info(self, id, content_type, accept, **kwargs) query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1941,10 +1773,6 @@ def policytemplates_get_with_http_info(self, id, content_type, accept, **kwargs) header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1964,59 +1792,55 @@ def policytemplates_get_with_http_info(self, id, content_type, accept, **kwargs) _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def policytemplates_list(self, content_type, accept, **kwargs): # noqa: E501 + def policytemplates_list(self, **kwargs): # noqa: E501 """Lists all of the Policy Templates # noqa: E501 This endpoint returns all policy templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policytemplates_list(content_type, accept, async_req=True) + >>> thread = api.policytemplates_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[PolicyTemplate] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.policytemplates_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.policytemplates_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.policytemplates_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.policytemplates_list_with_http_info(**kwargs) # noqa: E501 return data - def policytemplates_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def policytemplates_list_with_http_info(self, **kwargs): # noqa: E501 """Lists all of the Policy Templates # noqa: E501 This endpoint returns all policy templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policytemplates_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.policytemplates_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[PolicyTemplate] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2031,17 +1855,7 @@ def policytemplates_list_with_http_info(self, content_type, accept, **kwargs): ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `policytemplates_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `policytemplates_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `policytemplates_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -2062,10 +1876,6 @@ def policytemplates_list_with_http_info(self, content_type, accept, **kwargs): collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -2077,10 +1887,6 @@ def policytemplates_list_with_http_info(self, content_type, accept, **kwargs): header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 diff --git a/jcapiv2/jcapiv2/api/policy_group_associations_api.py b/jcapiv2/jcapiv2/api/policy_group_associations_api.py new file mode 100644 index 0000000..2b8d803 --- /dev/null +++ b/jcapiv2/jcapiv2/api/policy_group_associations_api.py @@ -0,0 +1,476 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv2.api_client import ApiClient + + +class PolicyGroupAssociationsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def graph_policy_group_associations_list(self, group_id, targets, **kwargs): # noqa: E501 + """List the associations of a Policy Group. # noqa: E501 + + This endpoint returns the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_associations_list(group_id, targets, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param list[str] targets: Targets which a \"policy_group\" can be associated to. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 + return data + + def graph_policy_group_associations_list_with_http_info(self, group_id, targets, **kwargs): # noqa: E501 + """List the associations of a Policy Group. # noqa: E501 + + This endpoint returns the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_associations_list_with_http_info(group_id, targets, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param list[str] targets: Targets which a \"policy_group\" can be associated to. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_group_associations_list" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_associations_list`") # noqa: E501 + # verify the required parameter 'targets' is set + if ('targets' not in params or + params['targets'] is None): + raise ValueError("Missing the required parameter `targets` when calling `graph_policy_group_associations_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + if 'targets' in params: + query_params.append(('targets', params['targets'])) # noqa: E501 + collection_formats['targets'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/associations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphConnection]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_group_associations_post(self, group_id, **kwargs): # noqa: E501 + """Manage the associations of a Policy Group # noqa: E501 + + This endpoint manages the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_associations_post(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param GraphOperationPolicyGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def graph_policy_group_associations_post_with_http_info(self, group_id, **kwargs): # noqa: E501 + """Manage the associations of a Policy Group # noqa: E501 + + This endpoint manages the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_associations_post_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param GraphOperationPolicyGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_group_associations_post" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_associations_post`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/associations', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_group_traverse_system(self, group_id, **kwargs): # noqa: E501 + """List the Systems bound to a Policy Group # noqa: E501 + + This endpoint will return all Systems bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_traverse_system(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_group_traverse_system_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_group_traverse_system_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def graph_policy_group_traverse_system_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the Systems bound to a Policy Group # noqa: E501 + + This endpoint will return all Systems bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_traverse_system_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_group_traverse_system" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_traverse_system`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/systems', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_group_traverse_system_group(self, group_id, **kwargs): # noqa: E501 + """List the System Groups bound to Policy Groups # noqa: E501 + + This endpoint will return all System Groups bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_traverse_system_group(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_group_traverse_system_group_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_group_traverse_system_group_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def graph_policy_group_traverse_system_group_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the System Groups bound to Policy Groups # noqa: E501 + + This endpoint will return all System Groups bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_traverse_system_group_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_group_traverse_system_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_traverse_system_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/systemgroups', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/policy_group_members__membership_api.py b/jcapiv2/jcapiv2/api/policy_group_members__membership_api.py new file mode 100644 index 0000000..ec9fc55 --- /dev/null +++ b/jcapiv2/jcapiv2/api/policy_group_members__membership_api.py @@ -0,0 +1,360 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv2.api_client import ApiClient + + +class PolicyGroupMembersMembershipApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def graph_policy_group_members_list(self, group_id, **kwargs): # noqa: E501 + """List the members of a Policy Group # noqa: E501 + + This endpoint returns the Policy members of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_members_list(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def graph_policy_group_members_list_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the members of a Policy Group # noqa: E501 + + This endpoint returns the Policy members of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_members_list_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_group_members_list" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_members_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/members', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphConnection]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_group_members_post(self, group_id, **kwargs): # noqa: E501 + """Manage the members of a Policy Group # noqa: E501 + + This endpoint allows you to manage the Policy members of a Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"policy\", \"id\": \"{Policy_ID}\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_members_post(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param GraphOperationPolicyGroupMember body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def graph_policy_group_members_post_with_http_info(self, group_id, **kwargs): # noqa: E501 + """Manage the members of a Policy Group # noqa: E501 + + This endpoint allows you to manage the Policy members of a Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"policy\", \"id\": \"{Policy_ID}\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_members_post_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param GraphOperationPolicyGroupMember body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_group_members_post" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_members_post`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/members', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_group_membership(self, group_id, **kwargs): # noqa: E501 + """List the Policy Group's membership # noqa: E501 + + This endpoint returns all Policy members that are a member of this Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_membership(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def graph_policy_group_membership_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the Policy Group's membership # noqa: E501 + + This endpoint returns all Policy members that are a member of this Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_membership_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_group_membership" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_membership`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/membership', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/policy_groups_api.py b/jcapiv2/jcapiv2/api/policy_groups_api.py new file mode 100644 index 0000000..6a7488d --- /dev/null +++ b/jcapiv2/jcapiv2/api/policy_groups_api.py @@ -0,0 +1,1321 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv2.api_client import ApiClient + + +class PolicyGroupsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def graph_policy_group_associations_list(self, group_id, targets, **kwargs): # noqa: E501 + """List the associations of a Policy Group. # noqa: E501 + + This endpoint returns the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_associations_list(group_id, targets, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param list[str] targets: Targets which a \"policy_group\" can be associated to. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 + return data + + def graph_policy_group_associations_list_with_http_info(self, group_id, targets, **kwargs): # noqa: E501 + """List the associations of a Policy Group. # noqa: E501 + + This endpoint returns the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_associations_list_with_http_info(group_id, targets, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param list[str] targets: Targets which a \"policy_group\" can be associated to. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_group_associations_list" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_associations_list`") # noqa: E501 + # verify the required parameter 'targets' is set + if ('targets' not in params or + params['targets'] is None): + raise ValueError("Missing the required parameter `targets` when calling `graph_policy_group_associations_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + if 'targets' in params: + query_params.append(('targets', params['targets'])) # noqa: E501 + collection_formats['targets'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/associations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphConnection]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_group_associations_post(self, group_id, **kwargs): # noqa: E501 + """Manage the associations of a Policy Group # noqa: E501 + + This endpoint manages the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_associations_post(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param GraphOperationPolicyGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def graph_policy_group_associations_post_with_http_info(self, group_id, **kwargs): # noqa: E501 + """Manage the associations of a Policy Group # noqa: E501 + + This endpoint manages the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_associations_post_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param GraphOperationPolicyGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_group_associations_post" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_associations_post`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/associations', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_group_members_list(self, group_id, **kwargs): # noqa: E501 + """List the members of a Policy Group # noqa: E501 + + This endpoint returns the Policy members of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_members_list(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def graph_policy_group_members_list_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the members of a Policy Group # noqa: E501 + + This endpoint returns the Policy members of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_members_list_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_group_members_list" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_members_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/members', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphConnection]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_group_members_post(self, group_id, **kwargs): # noqa: E501 + """Manage the members of a Policy Group # noqa: E501 + + This endpoint allows you to manage the Policy members of a Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"policy\", \"id\": \"{Policy_ID}\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_members_post(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param GraphOperationPolicyGroupMember body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def graph_policy_group_members_post_with_http_info(self, group_id, **kwargs): # noqa: E501 + """Manage the members of a Policy Group # noqa: E501 + + This endpoint allows you to manage the Policy members of a Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"policy\", \"id\": \"{Policy_ID}\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_members_post_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param GraphOperationPolicyGroupMember body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_group_members_post" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_members_post`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/members', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_group_membership(self, group_id, **kwargs): # noqa: E501 + """List the Policy Group's membership # noqa: E501 + + This endpoint returns all Policy members that are a member of this Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_membership(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def graph_policy_group_membership_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the Policy Group's membership # noqa: E501 + + This endpoint returns all Policy members that are a member of this Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_membership_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_group_membership" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_membership`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/membership', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_group_traverse_system(self, group_id, **kwargs): # noqa: E501 + """List the Systems bound to a Policy Group # noqa: E501 + + This endpoint will return all Systems bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_traverse_system(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_group_traverse_system_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_group_traverse_system_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def graph_policy_group_traverse_system_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the Systems bound to a Policy Group # noqa: E501 + + This endpoint will return all Systems bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_traverse_system_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_group_traverse_system" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_traverse_system`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/systems', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_policy_group_traverse_system_group(self, group_id, **kwargs): # noqa: E501 + """List the System Groups bound to Policy Groups # noqa: E501 + + This endpoint will return all System Groups bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_traverse_system_group(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_policy_group_traverse_system_group_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_policy_group_traverse_system_group_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def graph_policy_group_traverse_system_group_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the System Groups bound to Policy Groups # noqa: E501 + + This endpoint will return all System Groups bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_policy_group_traverse_system_group_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the Policy Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_policy_group_traverse_system_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_policy_group_traverse_system_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{group_id}/systemgroups', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def groups_policy_delete(self, id, **kwargs): # noqa: E501 + """Delete a Policy Group # noqa: E501 + + This endpoint allows you to delete a Policy Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/policygroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.groups_policy_delete(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: ObjectID of the Policy Group. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: PolicyGroup + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.groups_policy_delete_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.groups_policy_delete_with_http_info(id, **kwargs) # noqa: E501 + return data + + def groups_policy_delete_with_http_info(self, id, **kwargs): # noqa: E501 + """Delete a Policy Group # noqa: E501 + + This endpoint allows you to delete a Policy Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/policygroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.groups_policy_delete_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: ObjectID of the Policy Group. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: PolicyGroup + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method groups_policy_delete" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `groups_policy_delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PolicyGroup', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def groups_policy_get(self, id, **kwargs): # noqa: E501 + """View an individual Policy Group details # noqa: E501 + + This endpoint returns the details of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.groups_policy_get(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: ObjectID of the Policy Group. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: PolicyGroup + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.groups_policy_get_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.groups_policy_get_with_http_info(id, **kwargs) # noqa: E501 + return data + + def groups_policy_get_with_http_info(self, id, **kwargs): # noqa: E501 + """View an individual Policy Group details # noqa: E501 + + This endpoint returns the details of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.groups_policy_get_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: ObjectID of the Policy Group. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: PolicyGroup + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method groups_policy_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `groups_policy_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PolicyGroup', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def groups_policy_list(self, **kwargs): # noqa: E501 + """List all Policy Groups # noqa: E501 + + This endpoint returns all Policy Groups. Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.groups_policy_list(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[PolicyGroup] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.groups_policy_list_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.groups_policy_list_with_http_info(**kwargs) # noqa: E501 + return data + + def groups_policy_list_with_http_info(self, **kwargs): # noqa: E501 + """List all Policy Groups # noqa: E501 + + This endpoint returns all Policy Groups. Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.groups_policy_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[PolicyGroup] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method groups_policy_list" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + collection_formats['fields'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[PolicyGroup]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def groups_policy_post(self, **kwargs): # noqa: E501 + """Create a new Policy Group # noqa: E501 + + This endpoint allows you to create a new Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.groups_policy_post(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PolicyGroupData body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: PolicyGroup + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.groups_policy_post_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.groups_policy_post_with_http_info(**kwargs) # noqa: E501 + return data + + def groups_policy_post_with_http_info(self, **kwargs): # noqa: E501 + """Create a new Policy Group # noqa: E501 + + This endpoint allows you to create a new Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.groups_policy_post_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param PolicyGroupData body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: PolicyGroup + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method groups_policy_post" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PolicyGroup', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def groups_policy_put(self, id, **kwargs): # noqa: E501 + """Update a Policy Group # noqa: E501 + + This endpoint allows you to do a full update of the Policy Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/policygroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"group_update\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.groups_policy_put(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: ObjectID of the Policy Group. (required) + :param PolicyGroupData body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: PolicyGroup + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.groups_policy_put_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.groups_policy_put_with_http_info(id, **kwargs) # noqa: E501 + return data + + def groups_policy_put_with_http_info(self, id, **kwargs): # noqa: E501 + """Update a Policy Group # noqa: E501 + + This endpoint allows you to do a full update of the Policy Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/policygroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"group_update\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.groups_policy_put_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: ObjectID of the Policy Group. (required) + :param PolicyGroupData body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: PolicyGroup + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method groups_policy_put" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `groups_policy_put`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/policygroups/{id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PolicyGroup', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/policytemplates_api.py b/jcapiv2/jcapiv2/api/policytemplates_api.py index ea8bbe5..cdc95e5 100644 --- a/jcapiv2/jcapiv2/api/policytemplates_api.py +++ b/jcapiv2/jcapiv2/api/policytemplates_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,51 +32,47 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def policytemplates_get(self, id, content_type, accept, **kwargs): # noqa: E501 + def policytemplates_get(self, id, **kwargs): # noqa: E501 """Get a specific Policy Template # noqa: E501 - This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates/{Policy_Template_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policytemplates_get(id, content_type, accept, async_req=True) + >>> thread = api.policytemplates_get(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the Policy Template. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: PolicyTemplateWithDetails If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.policytemplates_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.policytemplates_get_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.policytemplates_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.policytemplates_get_with_http_info(id, **kwargs) # noqa: E501 return data - def policytemplates_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def policytemplates_get_with_http_info(self, id, **kwargs): # noqa: E501 """Get a specific Policy Template # noqa: E501 - This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates/{Policy_Template_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policytemplates_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.policytemplates_get_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the Policy Template. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: PolicyTemplateWithDetails If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -96,14 +91,6 @@ def policytemplates_get_with_http_info(self, id, content_type, accept, **kwargs) if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `policytemplates_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `policytemplates_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `policytemplates_get`") # noqa: E501 collection_formats = {} @@ -114,10 +101,6 @@ def policytemplates_get_with_http_info(self, id, content_type, accept, **kwargs) query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -129,10 +112,6 @@ def policytemplates_get_with_http_info(self, id, content_type, accept, **kwargs) header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -152,59 +131,55 @@ def policytemplates_get_with_http_info(self, id, content_type, accept, **kwargs) _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def policytemplates_list(self, content_type, accept, **kwargs): # noqa: E501 + def policytemplates_list(self, **kwargs): # noqa: E501 """Lists all of the Policy Templates # noqa: E501 This endpoint returns all policy templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policytemplates_list(content_type, accept, async_req=True) + >>> thread = api.policytemplates_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[PolicyTemplate] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.policytemplates_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.policytemplates_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.policytemplates_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.policytemplates_list_with_http_info(**kwargs) # noqa: E501 return data - def policytemplates_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def policytemplates_list_with_http_info(self, **kwargs): # noqa: E501 """Lists all of the Policy Templates # noqa: E501 This endpoint returns all policy templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.policytemplates_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.policytemplates_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[PolicyTemplate] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -219,17 +194,7 @@ def policytemplates_list_with_http_info(self, content_type, accept, **kwargs): ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `policytemplates_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `policytemplates_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `policytemplates_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -250,10 +215,6 @@ def policytemplates_list_with_http_info(self, content_type, accept, **kwargs): collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -265,10 +226,6 @@ def policytemplates_list_with_http_info(self, content_type, accept, **kwargs): header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 diff --git a/jcapiv2/jcapiv2/api/providers_api.py b/jcapiv2/jcapiv2/api/providers_api.py index a18307c..3c90200 100644 --- a/jcapiv2/jcapiv2/api/providers_api.py +++ b/jcapiv2/jcapiv2/api/providers_api.py @@ -1,91 +1,4168 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv2.api_client import ApiClient + + +class ProvidersApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def autotask_create_configuration(self, provider_id, **kwargs): # noqa: E501 + """Creates a new Autotask integration for the provider # noqa: E501 + + Creates a new Autotask integration for the provider. You must be associated with the provider to use this route. A 422 Unprocessable Entity response means the server failed to validate with Autotask. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_create_configuration(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param AutotaskIntegrationReq body: + :return: InlineResponse201 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.autotask_create_configuration_with_http_info(provider_id, **kwargs) # noqa: E501 + else: + (data) = self.autotask_create_configuration_with_http_info(provider_id, **kwargs) # noqa: E501 + return data + + def autotask_create_configuration_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """Creates a new Autotask integration for the provider # noqa: E501 + + Creates a new Autotask integration for the provider. You must be associated with the provider to use this route. A 422 Unprocessable Entity response means the server failed to validate with Autotask. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_create_configuration_with_http_info(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param AutotaskIntegrationReq body: + :return: InlineResponse201 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method autotask_create_configuration" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `autotask_create_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/integrations/autotask', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse201', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def autotask_delete_configuration(self, uuid, **kwargs): # noqa: E501 + """Delete Autotask Integration # noqa: E501 + + Removes a Autotask integration. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_delete_configuration(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.autotask_delete_configuration_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.autotask_delete_configuration_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def autotask_delete_configuration_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Delete Autotask Integration # noqa: E501 + + Removes a Autotask integration. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_delete_configuration_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method autotask_delete_configuration" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `autotask_delete_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/autotask/{UUID}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def autotask_get_configuration(self, uuid, **kwargs): # noqa: E501 + """Retrieve Autotask Integration Configuration # noqa: E501 + + Retrieves configuration for given Autotask integration id. You must be associated to the provider the integration is tied to in order to use this api. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_get_configuration(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: AutotaskIntegration + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.autotask_get_configuration_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.autotask_get_configuration_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def autotask_get_configuration_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Retrieve Autotask Integration Configuration # noqa: E501 + + Retrieves configuration for given Autotask integration id. You must be associated to the provider the integration is tied to in order to use this api. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_get_configuration_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: AutotaskIntegration + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method autotask_get_configuration" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `autotask_get_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/autotask/{UUID}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AutotaskIntegration', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def autotask_patch_mappings(self, uuid, **kwargs): # noqa: E501 + """Create, edit, and/or delete Autotask Mappings # noqa: E501 + + Create, edit, and/or delete mappings between Jumpcloud organizations and Autotask companies/contracts/services. You must be associated to the same provider as the Autotask integration to use this api. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_patch_mappings(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param AutotaskMappingRequest body: + :return: AutotaskMappingResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.autotask_patch_mappings_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.autotask_patch_mappings_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def autotask_patch_mappings_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Create, edit, and/or delete Autotask Mappings # noqa: E501 + + Create, edit, and/or delete mappings between Jumpcloud organizations and Autotask companies/contracts/services. You must be associated to the same provider as the Autotask integration to use this api. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_patch_mappings_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param AutotaskMappingRequest body: + :return: AutotaskMappingResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method autotask_patch_mappings" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `autotask_patch_mappings`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/autotask/{UUID}/mappings', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AutotaskMappingResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def autotask_patch_settings(self, uuid, **kwargs): # noqa: E501 + """Create, edit, and/or delete Autotask Integration settings # noqa: E501 + + Create, edit, and/or delete Autotask settings. You must be associated to the same provider as the Autotask integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_patch_settings(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param AutotaskSettingsPatchReq body: + :return: AutotaskSettings + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.autotask_patch_settings_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.autotask_patch_settings_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def autotask_patch_settings_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Create, edit, and/or delete Autotask Integration settings # noqa: E501 + + Create, edit, and/or delete Autotask settings. You must be associated to the same provider as the Autotask integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_patch_settings_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param AutotaskSettingsPatchReq body: + :return: AutotaskSettings + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method autotask_patch_settings" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `autotask_patch_settings`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/autotask/{UUID}/settings', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AutotaskSettings', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def autotask_retrieve_all_alert_configuration_options(self, provider_id, **kwargs): # noqa: E501 + """Get all Autotask ticketing alert configuration options for a provider # noqa: E501 + + Get all Autotask ticketing alert configuration options for a provider. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_all_alert_configuration_options(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :return: AutotaskTicketingAlertConfigurationOptions + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.autotask_retrieve_all_alert_configuration_options_with_http_info(provider_id, **kwargs) # noqa: E501 + else: + (data) = self.autotask_retrieve_all_alert_configuration_options_with_http_info(provider_id, **kwargs) # noqa: E501 + return data + + def autotask_retrieve_all_alert_configuration_options_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """Get all Autotask ticketing alert configuration options for a provider # noqa: E501 + + Get all Autotask ticketing alert configuration options for a provider. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_all_alert_configuration_options_with_http_info(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :return: AutotaskTicketingAlertConfigurationOptions + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method autotask_retrieve_all_alert_configuration_options" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `autotask_retrieve_all_alert_configuration_options`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/integrations/autotask/alerts/configuration/options', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AutotaskTicketingAlertConfigurationOptions', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def autotask_retrieve_all_alert_configurations(self, provider_id, **kwargs): # noqa: E501 + """Get all Autotask ticketing alert configurations for a provider # noqa: E501 + + Get all Autotask ticketing alert configurations for a provider. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_all_alert_configurations(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :return: AutotaskTicketingAlertConfigurationList + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.autotask_retrieve_all_alert_configurations_with_http_info(provider_id, **kwargs) # noqa: E501 + else: + (data) = self.autotask_retrieve_all_alert_configurations_with_http_info(provider_id, **kwargs) # noqa: E501 + return data + + def autotask_retrieve_all_alert_configurations_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """Get all Autotask ticketing alert configurations for a provider # noqa: E501 + + Get all Autotask ticketing alert configurations for a provider. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_all_alert_configurations_with_http_info(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :return: AutotaskTicketingAlertConfigurationList + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method autotask_retrieve_all_alert_configurations" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `autotask_retrieve_all_alert_configurations`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/integrations/autotask/alerts/configuration', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AutotaskTicketingAlertConfigurationList', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def autotask_retrieve_companies(self, uuid, **kwargs): # noqa: E501 + """Retrieve Autotask Companies # noqa: E501 + + Retrieves a list of Autotask companies for the given Autotask id. You must be associated to the same provider as the Autotask integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_companies(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: AutotaskCompanyResp + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.autotask_retrieve_companies_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.autotask_retrieve_companies_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def autotask_retrieve_companies_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Retrieve Autotask Companies # noqa: E501 + + Retrieves a list of Autotask companies for the given Autotask id. You must be associated to the same provider as the Autotask integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_companies_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: AutotaskCompanyResp + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid', 'fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method autotask_retrieve_companies" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `autotask_retrieve_companies`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + collection_formats['fields'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/autotask/{UUID}/companies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AutotaskCompanyResp', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def autotask_retrieve_company_types(self, uuid, **kwargs): # noqa: E501 + """Retrieve Autotask Company Types # noqa: E501 + + Retrieves a list of user defined company types from Autotask for the given Autotask id. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_company_types(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: AutotaskCompanyTypeResp + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.autotask_retrieve_company_types_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.autotask_retrieve_company_types_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def autotask_retrieve_company_types_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Retrieve Autotask Company Types # noqa: E501 + + Retrieves a list of user defined company types from Autotask for the given Autotask id. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_company_types_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: AutotaskCompanyTypeResp + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method autotask_retrieve_company_types" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `autotask_retrieve_company_types`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/autotask/{UUID}/companytypes', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AutotaskCompanyTypeResp', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def autotask_retrieve_contracts(self, uuid, **kwargs): # noqa: E501 + """Retrieve Autotask Contracts # noqa: E501 + + Retrieves a list of Autotask contracts for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_contracts(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse2003 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.autotask_retrieve_contracts_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.autotask_retrieve_contracts_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def autotask_retrieve_contracts_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Retrieve Autotask Contracts # noqa: E501 + + Retrieves a list of Autotask contracts for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_contracts_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse2003 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid', 'fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method autotask_retrieve_contracts" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `autotask_retrieve_contracts`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + collection_formats['fields'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/autotask/{UUID}/contracts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse2003', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def autotask_retrieve_contracts_fields(self, uuid, **kwargs): # noqa: E501 + """Retrieve Autotask Contract Fields # noqa: E501 + + Retrieves a list of Autotask contract fields for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_contracts_fields(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: InlineResponse2004 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.autotask_retrieve_contracts_fields_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.autotask_retrieve_contracts_fields_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def autotask_retrieve_contracts_fields_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Retrieve Autotask Contract Fields # noqa: E501 + + Retrieves a list of Autotask contract fields for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_contracts_fields_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: InlineResponse2004 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method autotask_retrieve_contracts_fields" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `autotask_retrieve_contracts_fields`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/autotask/{UUID}/contracts/fields', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse2004', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def autotask_retrieve_mappings(self, uuid, **kwargs): # noqa: E501 + """Retrieve Autotask mappings # noqa: E501 + + Retrieves the list of mappings for this Autotask integration. You must be associated to the same provider as the Autotask integration to use this api. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_mappings(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse2006 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.autotask_retrieve_mappings_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.autotask_retrieve_mappings_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def autotask_retrieve_mappings_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Retrieve Autotask mappings # noqa: E501 + + Retrieves the list of mappings for this Autotask integration. You must be associated to the same provider as the Autotask integration to use this api. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_mappings_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse2006 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid', 'fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method autotask_retrieve_mappings" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `autotask_retrieve_mappings`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + collection_formats['fields'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/autotask/{UUID}/mappings', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse2006', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def autotask_retrieve_services(self, uuid, **kwargs): # noqa: E501 + """Retrieve Autotask Contract Services # noqa: E501 + + Retrieves a list of Autotask contract services for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_services(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse2005 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.autotask_retrieve_services_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.autotask_retrieve_services_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def autotask_retrieve_services_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Retrieve Autotask Contract Services # noqa: E501 + + Retrieves a list of Autotask contract services for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_services_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse2005 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid', 'fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method autotask_retrieve_services" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `autotask_retrieve_services`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + collection_formats['fields'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/autotask/{UUID}/contracts/services', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse2005', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def autotask_retrieve_settings(self, uuid, **kwargs): # noqa: E501 + """Retrieve Autotask Integration settings # noqa: E501 + + Retrieve the Autotask integration settings. You must be associated to the same provider as the Autotask integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_settings(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: AutotaskSettings + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.autotask_retrieve_settings_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.autotask_retrieve_settings_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def autotask_retrieve_settings_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Retrieve Autotask Integration settings # noqa: E501 + + Retrieve the Autotask integration settings. You must be associated to the same provider as the Autotask integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_retrieve_settings_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: AutotaskSettings + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method autotask_retrieve_settings" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `autotask_retrieve_settings`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/autotask/{UUID}/settings', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AutotaskSettings', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def autotask_update_alert_configuration(self, provider_id, alert_uuid, **kwargs): # noqa: E501 + """Update an Autotask ticketing alert's configuration # noqa: E501 + + Update an Autotask ticketing alert's configuration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_update_alert_configuration(provider_id, alert_uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param str alert_uuid: (required) + :param AutotaskTicketingAlertConfigurationRequest body: + :return: AutotaskTicketingAlertConfiguration + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.autotask_update_alert_configuration_with_http_info(provider_id, alert_uuid, **kwargs) # noqa: E501 + else: + (data) = self.autotask_update_alert_configuration_with_http_info(provider_id, alert_uuid, **kwargs) # noqa: E501 + return data + + def autotask_update_alert_configuration_with_http_info(self, provider_id, alert_uuid, **kwargs): # noqa: E501 + """Update an Autotask ticketing alert's configuration # noqa: E501 + + Update an Autotask ticketing alert's configuration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_update_alert_configuration_with_http_info(provider_id, alert_uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param str alert_uuid: (required) + :param AutotaskTicketingAlertConfigurationRequest body: + :return: AutotaskTicketingAlertConfiguration + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'alert_uuid', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method autotask_update_alert_configuration" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `autotask_update_alert_configuration`") # noqa: E501 + # verify the required parameter 'alert_uuid' is set + if ('alert_uuid' not in params or + params['alert_uuid'] is None): + raise ValueError("Missing the required parameter `alert_uuid` when calling `autotask_update_alert_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + if 'alert_uuid' in params: + path_params['alert_UUID'] = params['alert_uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/integrations/autotask/alerts/{alert_UUID}/configuration', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AutotaskTicketingAlertConfiguration', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def autotask_update_configuration(self, uuid, **kwargs): # noqa: E501 + """Update Autotask Integration configuration # noqa: E501 + + Update the Autotask integration configuration. A 422 Unprocessable Entity response means the server failed to validate with Autotask. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_update_configuration(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param AutotaskIntegrationPatchReq body: + :return: AutotaskIntegration + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.autotask_update_configuration_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.autotask_update_configuration_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def autotask_update_configuration_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Update Autotask Integration configuration # noqa: E501 + + Update the Autotask integration configuration. A 422 Unprocessable Entity response means the server failed to validate with Autotask. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.autotask_update_configuration_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param AutotaskIntegrationPatchReq body: + :return: AutotaskIntegration + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method autotask_update_configuration" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `autotask_update_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/autotask/{UUID}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AutotaskIntegration', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def connectwise_create_configuration(self, provider_id, **kwargs): # noqa: E501 + """Creates a new ConnectWise integration for the provider # noqa: E501 + + Creates a new ConnectWise integration for the provider. You must be associated with the provider to use this route. A 422 Unprocessable Entity response means the server failed to validate with ConnectWise. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_create_configuration(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param ConnectwiseIntegrationReq body: + :return: InlineResponse201 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.connectwise_create_configuration_with_http_info(provider_id, **kwargs) # noqa: E501 + else: + (data) = self.connectwise_create_configuration_with_http_info(provider_id, **kwargs) # noqa: E501 + return data + + def connectwise_create_configuration_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """Creates a new ConnectWise integration for the provider # noqa: E501 + + Creates a new ConnectWise integration for the provider. You must be associated with the provider to use this route. A 422 Unprocessable Entity response means the server failed to validate with ConnectWise. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_create_configuration_with_http_info(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param ConnectwiseIntegrationReq body: + :return: InlineResponse201 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method connectwise_create_configuration" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `connectwise_create_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/integrations/connectwise', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse201', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def connectwise_delete_configuration(self, uuid, **kwargs): # noqa: E501 + """Delete ConnectWise Integration # noqa: E501 + + Removes a ConnectWise integration. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_delete_configuration(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.connectwise_delete_configuration_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.connectwise_delete_configuration_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def connectwise_delete_configuration_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Delete ConnectWise Integration # noqa: E501 + + Removes a ConnectWise integration. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_delete_configuration_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method connectwise_delete_configuration" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `connectwise_delete_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/connectwise/{UUID}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def connectwise_get_configuration(self, uuid, **kwargs): # noqa: E501 + """Retrieve ConnectWise Integration Configuration # noqa: E501 + + Retrieves configuration for given ConnectWise integration id. You must be associated to the provider the integration is tied to in order to use this api. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_get_configuration(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: ConnectwiseIntegration + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.connectwise_get_configuration_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.connectwise_get_configuration_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def connectwise_get_configuration_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Retrieve ConnectWise Integration Configuration # noqa: E501 + + Retrieves configuration for given ConnectWise integration id. You must be associated to the provider the integration is tied to in order to use this api. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_get_configuration_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: ConnectwiseIntegration + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method connectwise_get_configuration" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `connectwise_get_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/connectwise/{UUID}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ConnectwiseIntegration', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def connectwise_patch_mappings(self, uuid, **kwargs): # noqa: E501 + """Create, edit, and/or delete ConnectWise Mappings # noqa: E501 + + Create, edit, and/or delete mappings between Jumpcloud organizations and ConnectWise companies/agreements/additions. You must be associated to the same provider as the ConnectWise integration to use this api. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_patch_mappings(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param ConnectWiseMappingRequest body: + :return: ConnectWiseMappingRequest + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.connectwise_patch_mappings_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.connectwise_patch_mappings_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def connectwise_patch_mappings_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Create, edit, and/or delete ConnectWise Mappings # noqa: E501 + + Create, edit, and/or delete mappings between Jumpcloud organizations and ConnectWise companies/agreements/additions. You must be associated to the same provider as the ConnectWise integration to use this api. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_patch_mappings_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param ConnectWiseMappingRequest body: + :return: ConnectWiseMappingRequest + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method connectwise_patch_mappings" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `connectwise_patch_mappings`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/connectwise/{UUID}/mappings', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ConnectWiseMappingRequest', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def connectwise_patch_settings(self, uuid, **kwargs): # noqa: E501 + """Create, edit, and/or delete ConnectWise Integration settings # noqa: E501 + + Create, edit, and/or delete ConnectWiseIntegration settings. You must be associated to the same provider as the ConnectWise integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_patch_settings(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param ConnectWiseSettingsPatchReq body: + :return: ConnectWiseSettings + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.connectwise_patch_settings_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.connectwise_patch_settings_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def connectwise_patch_settings_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Create, edit, and/or delete ConnectWise Integration settings # noqa: E501 + + Create, edit, and/or delete ConnectWiseIntegration settings. You must be associated to the same provider as the ConnectWise integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_patch_settings_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param ConnectWiseSettingsPatchReq body: + :return: ConnectWiseSettings + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method connectwise_patch_settings" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `connectwise_patch_settings`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/connectwise/{UUID}/settings', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ConnectWiseSettings', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def connectwise_retrieve_additions(self, uuid, agreement_id, **kwargs): # noqa: E501 + """Retrieve ConnectWise Additions # noqa: E501 + + Retrieves a list of ConnectWise additions for the given ConnectWise id and Agreement id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_retrieve_additions(uuid, agreement_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param str agreement_id: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse2008 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.connectwise_retrieve_additions_with_http_info(uuid, agreement_id, **kwargs) # noqa: E501 + else: + (data) = self.connectwise_retrieve_additions_with_http_info(uuid, agreement_id, **kwargs) # noqa: E501 + return data + + def connectwise_retrieve_additions_with_http_info(self, uuid, agreement_id, **kwargs): # noqa: E501 + """Retrieve ConnectWise Additions # noqa: E501 + + Retrieves a list of ConnectWise additions for the given ConnectWise id and Agreement id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_retrieve_additions_with_http_info(uuid, agreement_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param str agreement_id: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse2008 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid', 'agreement_id', 'fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method connectwise_retrieve_additions" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `connectwise_retrieve_additions`") # noqa: E501 + # verify the required parameter 'agreement_id' is set + if ('agreement_id' not in params or + params['agreement_id'] is None): + raise ValueError("Missing the required parameter `agreement_id` when calling `connectwise_retrieve_additions`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + if 'agreement_id' in params: + path_params['agreement_ID'] = params['agreement_id'] # noqa: E501 + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + collection_formats['fields'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/connectwise/{UUID}/agreements/{agreement_ID}/additions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse2008', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def connectwise_retrieve_agreements(self, uuid, **kwargs): # noqa: E501 + """Retrieve ConnectWise Agreements # noqa: E501 + + Retrieves a list of ConnectWise agreements for the given ConnectWise id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_retrieve_agreements(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse2007 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.connectwise_retrieve_agreements_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.connectwise_retrieve_agreements_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def connectwise_retrieve_agreements_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Retrieve ConnectWise Agreements # noqa: E501 + + Retrieves a list of ConnectWise agreements for the given ConnectWise id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_retrieve_agreements_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse2007 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid', 'fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method connectwise_retrieve_agreements" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `connectwise_retrieve_agreements`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + collection_formats['fields'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/connectwise/{UUID}/agreements', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse2007', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def connectwise_retrieve_all_alert_configuration_options(self, provider_id, **kwargs): # noqa: E501 + """Get all ConnectWise ticketing alert configuration options for a provider # noqa: E501 + + Get all ConnectWise ticketing alert configuration options for a provider. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_retrieve_all_alert_configuration_options(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :return: ConnectWiseTicketingAlertConfigurationOptions + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.connectwise_retrieve_all_alert_configuration_options_with_http_info(provider_id, **kwargs) # noqa: E501 + else: + (data) = self.connectwise_retrieve_all_alert_configuration_options_with_http_info(provider_id, **kwargs) # noqa: E501 + return data + + def connectwise_retrieve_all_alert_configuration_options_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """Get all ConnectWise ticketing alert configuration options for a provider # noqa: E501 + + Get all ConnectWise ticketing alert configuration options for a provider. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_retrieve_all_alert_configuration_options_with_http_info(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :return: ConnectWiseTicketingAlertConfigurationOptions + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method connectwise_retrieve_all_alert_configuration_options" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `connectwise_retrieve_all_alert_configuration_options`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/integrations/connectwise/alerts/configuration/options', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ConnectWiseTicketingAlertConfigurationOptions', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def connectwise_retrieve_all_alert_configurations(self, provider_id, **kwargs): # noqa: E501 + """Get all ConnectWise ticketing alert configurations for a provider # noqa: E501 + + Get all ConnectWise ticketing alert configurations for a provider. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_retrieve_all_alert_configurations(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :return: ConnectWiseTicketingAlertConfigurationList + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.connectwise_retrieve_all_alert_configurations_with_http_info(provider_id, **kwargs) # noqa: E501 + else: + (data) = self.connectwise_retrieve_all_alert_configurations_with_http_info(provider_id, **kwargs) # noqa: E501 + return data + + def connectwise_retrieve_all_alert_configurations_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """Get all ConnectWise ticketing alert configurations for a provider # noqa: E501 + + Get all ConnectWise ticketing alert configurations for a provider. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_retrieve_all_alert_configurations_with_http_info(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :return: ConnectWiseTicketingAlertConfigurationList + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method connectwise_retrieve_all_alert_configurations" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `connectwise_retrieve_all_alert_configurations`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/integrations/connectwise/alerts/configuration', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ConnectWiseTicketingAlertConfigurationList', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def connectwise_retrieve_companies(self, uuid, **kwargs): # noqa: E501 + """Retrieve ConnectWise Companies # noqa: E501 + + Retrieves a list of ConnectWise companies for the given ConnectWise id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_retrieve_companies(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: ConnectwiseCompanyResp + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.connectwise_retrieve_companies_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.connectwise_retrieve_companies_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def connectwise_retrieve_companies_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Retrieve ConnectWise Companies # noqa: E501 + + Retrieves a list of ConnectWise companies for the given ConnectWise id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_retrieve_companies_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: ConnectwiseCompanyResp + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid', 'fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method connectwise_retrieve_companies" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `connectwise_retrieve_companies`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + collection_formats['fields'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/connectwise/{UUID}/companies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ConnectwiseCompanyResp', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def connectwise_retrieve_company_types(self, uuid, **kwargs): # noqa: E501 + """Retrieve ConnectWise Company Types # noqa: E501 + + Retrieves a list of user defined company types from ConnectWise for the given ConnectWise id. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_retrieve_company_types(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: ConnectwiseCompanyTypeResp + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.connectwise_retrieve_company_types_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.connectwise_retrieve_company_types_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def connectwise_retrieve_company_types_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Retrieve ConnectWise Company Types # noqa: E501 + + Retrieves a list of user defined company types from ConnectWise for the given ConnectWise id. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_retrieve_company_types_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: ConnectwiseCompanyTypeResp + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method connectwise_retrieve_company_types" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `connectwise_retrieve_company_types`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/connectwise/{UUID}/companytypes', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ConnectwiseCompanyTypeResp', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def connectwise_retrieve_mappings(self, uuid, **kwargs): # noqa: E501 + """Retrieve ConnectWise mappings # noqa: E501 + + Retrieves the list of mappings for this ConnectWise integration. You must be associated to the same provider as the ConnectWise integration to use this api. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_retrieve_mappings(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse2009 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.connectwise_retrieve_mappings_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.connectwise_retrieve_mappings_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def connectwise_retrieve_mappings_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Retrieve ConnectWise mappings # noqa: E501 + + Retrieves the list of mappings for this ConnectWise integration. You must be associated to the same provider as the ConnectWise integration to use this api. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_retrieve_mappings_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse2009 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid', 'fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method connectwise_retrieve_mappings" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `connectwise_retrieve_mappings`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + collection_formats['fields'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/connectwise/{UUID}/mappings', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse2009', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def connectwise_retrieve_settings(self, uuid, **kwargs): # noqa: E501 + """Retrieve ConnectWise Integration settings # noqa: E501 + + Retrieve the ConnectWise integration settings. You must be associated to the same provider as the ConnectWise integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_retrieve_settings(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: ConnectWiseSettings + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.connectwise_retrieve_settings_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.connectwise_retrieve_settings_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def connectwise_retrieve_settings_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Retrieve ConnectWise Integration settings # noqa: E501 + + Retrieve the ConnectWise integration settings. You must be associated to the same provider as the ConnectWise integration to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_retrieve_settings_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :return: ConnectWiseSettings + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method connectwise_retrieve_settings" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `connectwise_retrieve_settings`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/connectwise/{UUID}/settings', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ConnectWiseSettings', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def connectwise_update_alert_configuration(self, provider_id, alert_uuid, **kwargs): # noqa: E501 + """Update a ConnectWise ticketing alert's configuration # noqa: E501 + + Update a ConnectWise ticketing alert's configuration. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_update_alert_configuration(provider_id, alert_uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param str alert_uuid: (required) + :param ConnectWiseTicketingAlertConfigurationRequest body: + :return: ConnectWiseTicketingAlertConfiguration + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.connectwise_update_alert_configuration_with_http_info(provider_id, alert_uuid, **kwargs) # noqa: E501 + else: + (data) = self.connectwise_update_alert_configuration_with_http_info(provider_id, alert_uuid, **kwargs) # noqa: E501 + return data + + def connectwise_update_alert_configuration_with_http_info(self, provider_id, alert_uuid, **kwargs): # noqa: E501 + """Update a ConnectWise ticketing alert's configuration # noqa: E501 + + Update a ConnectWise ticketing alert's configuration. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_update_alert_configuration_with_http_info(provider_id, alert_uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param str alert_uuid: (required) + :param ConnectWiseTicketingAlertConfigurationRequest body: + :return: ConnectWiseTicketingAlertConfiguration + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'alert_uuid', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method connectwise_update_alert_configuration" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `connectwise_update_alert_configuration`") # noqa: E501 + # verify the required parameter 'alert_uuid' is set + if ('alert_uuid' not in params or + params['alert_uuid'] is None): + raise ValueError("Missing the required parameter `alert_uuid` when calling `connectwise_update_alert_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + if 'alert_uuid' in params: + path_params['alert_UUID'] = params['alert_uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/integrations/connectwise/alerts/{alert_UUID}/configuration', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ConnectWiseTicketingAlertConfiguration', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def connectwise_update_configuration(self, uuid, **kwargs): # noqa: E501 + """Update ConnectWise Integration configuration # noqa: E501 + + Update the ConnectWise integration configuration. A 422 Unprocessable Entity response means the server failed to validate with ConnectWise. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_update_configuration(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param ConnectwiseIntegrationPatchReq body: + :return: ConnectwiseIntegration + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.connectwise_update_configuration_with_http_info(uuid, **kwargs) # noqa: E501 + else: + (data) = self.connectwise_update_configuration_with_http_info(uuid, **kwargs) # noqa: E501 + return data + + def connectwise_update_configuration_with_http_info(self, uuid, **kwargs): # noqa: E501 + """Update ConnectWise Integration configuration # noqa: E501 + + Update the ConnectWise integration configuration. A 422 Unprocessable Entity response means the server failed to validate with ConnectWise. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.connectwise_update_configuration_with_http_info(uuid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param ConnectwiseIntegrationPatchReq body: + :return: ConnectwiseIntegration + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method connectwise_update_configuration" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `connectwise_update_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/connectwise/{UUID}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ConnectwiseIntegration', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def mtp_integration_retrieve_alerts(self, provider_id, **kwargs): # noqa: E501 + """Get all ticketing alerts available for a provider's ticketing integration. # noqa: E501 + + Get all ticketing alerts available for a provider's ticketing integration. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.mtp_integration_retrieve_alerts(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :return: TicketingIntegrationAlertsResp + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.mtp_integration_retrieve_alerts_with_http_info(provider_id, **kwargs) # noqa: E501 + else: + (data) = self.mtp_integration_retrieve_alerts_with_http_info(provider_id, **kwargs) # noqa: E501 + return data + + def mtp_integration_retrieve_alerts_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """Get all ticketing alerts available for a provider's ticketing integration. # noqa: E501 + + Get all ticketing alerts available for a provider's ticketing integration. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.mtp_integration_retrieve_alerts_with_http_info(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :return: TicketingIntegrationAlertsResp + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method mtp_integration_retrieve_alerts" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `mtp_integration_retrieve_alerts`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/integrations/ticketing/alerts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='TicketingIntegrationAlertsResp', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def mtp_integration_retrieve_sync_errors(self, uuid, integration_type, **kwargs): # noqa: E501 + """Retrieve Recent Integration Sync Errors # noqa: E501 + + Retrieves recent sync errors for given integration type and integration id. You must be associated to the provider the integration is tied to in order to use this api. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.mtp_integration_retrieve_sync_errors(uuid, integration_type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param str integration_type: (required) + :return: IntegrationSyncErrorResp + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.mtp_integration_retrieve_sync_errors_with_http_info(uuid, integration_type, **kwargs) # noqa: E501 + else: + (data) = self.mtp_integration_retrieve_sync_errors_with_http_info(uuid, integration_type, **kwargs) # noqa: E501 + return data + + def mtp_integration_retrieve_sync_errors_with_http_info(self, uuid, integration_type, **kwargs): # noqa: E501 + """Retrieve Recent Integration Sync Errors # noqa: E501 + + Retrieves recent sync errors for given integration type and integration id. You must be associated to the provider the integration is tied to in order to use this api. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.mtp_integration_retrieve_sync_errors_with_http_info(uuid, integration_type, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str uuid: (required) + :param str integration_type: (required) + :return: IntegrationSyncErrorResp + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['uuid', 'integration_type'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method mtp_integration_retrieve_sync_errors" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'uuid' is set + if ('uuid' not in params or + params['uuid'] is None): + raise ValueError("Missing the required parameter `uuid` when calling `mtp_integration_retrieve_sync_errors`") # noqa: E501 + # verify the required parameter 'integration_type' is set + if ('integration_type' not in params or + params['integration_type'] is None): + raise ValueError("Missing the required parameter `integration_type` when calling `mtp_integration_retrieve_sync_errors`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'uuid' in params: + path_params['UUID'] = params['uuid'] # noqa: E501 + if 'integration_type' in params: + path_params['integration_type'] = params['integration_type'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/integrations/{integration_type}/{UUID}/errors', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='IntegrationSyncErrorResp', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def provider_organizations_update_org(self, provider_id, id, **kwargs): # noqa: E501 + """Update Provider Organization # noqa: E501 + + This endpoint updates a provider's organization # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.provider_organizations_update_org(provider_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param str id: (required) + :param Organization body: + :return: Organization + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.provider_organizations_update_org_with_http_info(provider_id, id, **kwargs) # noqa: E501 + else: + (data) = self.provider_organizations_update_org_with_http_info(provider_id, id, **kwargs) # noqa: E501 + return data + + def provider_organizations_update_org_with_http_info(self, provider_id, id, **kwargs): # noqa: E501 + """Update Provider Organization # noqa: E501 + + This endpoint updates a provider's organization # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.provider_organizations_update_org_with_http_info(provider_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param str id: (required) + :param Organization body: + :return: Organization + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method provider_organizations_update_org" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `provider_organizations_update_org`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `provider_organizations_update_org`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/organizations/{id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Organization', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def providers_get_provider(self, provider_id, **kwargs): # noqa: E501 + """Retrieve Provider # noqa: E501 + + This endpoint returns details about a provider # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_get_provider(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :return: Provider + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.providers_get_provider_with_http_info(provider_id, **kwargs) # noqa: E501 + else: + (data) = self.providers_get_provider_with_http_info(provider_id, **kwargs) # noqa: E501 + return data + + def providers_get_provider_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """Retrieve Provider # noqa: E501 + + This endpoint returns details about a provider # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_get_provider_with_http_info(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :return: Provider + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'fields'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method providers_get_provider" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `providers_get_provider`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + collection_formats['fields'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Provider', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def providers_list_administrators(self, provider_id, **kwargs): # noqa: E501 + """List Provider Administrators # noqa: E501 + + This endpoint returns a list of the Administrators associated with the Provider. You must be associated with the provider to use this route. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_list_administrators(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse20012 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.providers_list_administrators_with_http_info(provider_id, **kwargs) # noqa: E501 + else: + (data) = self.providers_list_administrators_with_http_info(provider_id, **kwargs) # noqa: E501 + return data + + def providers_list_administrators_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """List Provider Administrators # noqa: E501 + + This endpoint returns a list of the Administrators associated with the Provider. You must be associated with the provider to use this route. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_list_administrators_with_http_info(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse20012 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method providers_list_administrators" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `providers_list_administrators`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + collection_formats['fields'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/administrators', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse20012', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def providers_list_organizations(self, provider_id, **kwargs): # noqa: E501 + """List Provider Organizations # noqa: E501 + + This endpoint returns a list of the Organizations associated with the Provider. You must be associated with the provider to use this route. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_list_organizations(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse20013 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.providers_list_organizations_with_http_info(provider_id, **kwargs) # noqa: E501 + else: + (data) = self.providers_list_organizations_with_http_info(provider_id, **kwargs) # noqa: E501 + return data + + def providers_list_organizations_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """List Provider Organizations # noqa: E501 + + This endpoint returns a list of the Organizations associated with the Provider. You must be associated with the provider to use this route. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_list_organizations_with_http_info(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: InlineResponse20013 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method providers_list_organizations" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `providers_list_organizations`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + collection_formats['fields'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/organizations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse20013', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def providers_post_admins(self, provider_id, **kwargs): # noqa: E501 + """Create a new Provider Administrator # noqa: E501 + + This endpoint allows you to create a provider administrator. You must be associated with the provider to use this route. You must provide either `role` or `roleName`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_post_admins(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param ProviderAdminReq body: + :return: Administrator + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.providers_post_admins_with_http_info(provider_id, **kwargs) # noqa: E501 + else: + (data) = self.providers_post_admins_with_http_info(provider_id, **kwargs) # noqa: E501 + return data + + def providers_post_admins_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """Create a new Provider Administrator # noqa: E501 + + This endpoint allows you to create a provider administrator. You must be associated with the provider to use this route. You must provide either `role` or `roleName`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_post_admins_with_http_info(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param ProviderAdminReq body: + :return: Administrator + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method providers_post_admins" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `providers_post_admins`") # noqa: E501 -from __future__ import absolute_import + collection_formats = {} -import re # noqa: F401 + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 -# python 2 and python 3 compatibility library -import six + query_params = [] -from jcapiv2.api_client import ApiClient + header_params = {} + form_params = [] + local_var_files = {} -class ProvidersApi(object): - """NOTE: This class is auto generated by the swagger code generator program. + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 - def providers_list_administrators(self, provider_id, content_type, accept, **kwargs): # noqa: E501 - """List Provider Administrators # noqa: E501 + return self.api_client.call_api( + '/providers/{provider_id}/administrators', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Administrator', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) - This endpoint returns a list of the Administrators associated with the Provider. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/providers/{ProviderID}/administrators \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + def providers_remove_administrator(self, provider_id, id, **kwargs): # noqa: E501 + """Delete Provider Administrator # noqa: E501 + + This endpoint removes an Administrator associated with the Provider. You must be associated with the provider to use this route. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.providers_list_administrators(provider_id, content_type, accept, async_req=True) + >>> thread = api.providers_remove_administrator(provider_id, id, async_req=True) >>> result = thread.get() :param async_req bool :param str provider_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.providers_remove_administrator_with_http_info(provider_id, id, **kwargs) # noqa: E501 + else: + (data) = self.providers_remove_administrator_with_http_info(provider_id, id, **kwargs) # noqa: E501 + return data + + def providers_remove_administrator_with_http_info(self, provider_id, id, **kwargs): # noqa: E501 + """Delete Provider Administrator # noqa: E501 + + This endpoint removes an Administrator associated with the Provider. You must be associated with the provider to use this route. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_remove_administrator_with_http_info(provider_id, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param str id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method providers_remove_administrator" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `providers_remove_administrator`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `providers_remove_administrator`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/administrators/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def providers_retrieve_integrations(self, provider_id, **kwargs): # noqa: E501 + """Retrieve Integrations for Provider # noqa: E501 + + Retrieves a list of integrations this provider has configured. You must be associated to the provider to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_retrieve_integrations(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :return: InlineResponse2001 + :return: IntegrationsResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.providers_list_administrators_with_http_info(provider_id, content_type, accept, **kwargs) # noqa: E501 + return self.providers_retrieve_integrations_with_http_info(provider_id, **kwargs) # noqa: E501 else: - (data) = self.providers_list_administrators_with_http_info(provider_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.providers_retrieve_integrations_with_http_info(provider_id, **kwargs) # noqa: E501 return data - def providers_list_administrators_with_http_info(self, provider_id, content_type, accept, **kwargs): # noqa: E501 - """List Provider Administrators # noqa: E501 + def providers_retrieve_integrations_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """Retrieve Integrations for Provider # noqa: E501 - This endpoint returns a list of the Administrators associated with the Provider. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/providers/{ProviderID}/administrators \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + Retrieves a list of integrations this provider has configured. You must be associated to the provider to use this endpoint. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.providers_list_administrators_with_http_info(provider_id, content_type, accept, async_req=True) + >>> thread = api.providers_retrieve_integrations_with_http_info(provider_id, async_req=True) >>> result = thread.get() :param async_req bool :param str provider_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :return: InlineResponse2001 + :return: IntegrationsResponse If the method is called asynchronously, returns the request thread. """ - all_params = ['provider_id', 'content_type', 'accept', 'fields', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params = ['provider_id', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -96,25 +4173,15 @@ def providers_list_administrators_with_http_info(self, provider_id, content_type if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method providers_list_administrators" % key + " to method providers_retrieve_integrations" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'provider_id' is set if ('provider_id' not in params or params['provider_id'] is None): - raise ValueError("Missing the required parameter `provider_id` when calling `providers_list_administrators`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `providers_list_administrators`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `providers_list_administrators`") # noqa: E501 + raise ValueError("Missing the required parameter `provider_id` when calling `providers_retrieve_integrations`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `providers_list_administrators`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -122,9 +4189,6 @@ def providers_list_administrators_with_http_info(self, provider_id, content_type path_params['provider_id'] = params['provider_id'] # noqa: E501 query_params = [] - if 'fields' in params: - query_params.append(('fields', params['fields'])) # noqa: E501 - collection_formats['fields'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 @@ -137,10 +4201,6 @@ def providers_list_administrators_with_http_info(self, provider_id, content_type collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -150,22 +4210,18 @@ def providers_list_administrators_with_http_info(self, provider_id, content_type header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/providers/{provider_id}/administrators', 'GET', + '/providers/{provider_id}/integrations', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse2001', # noqa: E501 + response_type='IntegrationsResponse', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -173,51 +4229,47 @@ def providers_list_administrators_with_http_info(self, provider_id, content_type _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def providers_post_admins(self, provider_id, content_type, accept, **kwargs): # noqa: E501 - """Create a new Provider Administrator # noqa: E501 + def providers_retrieve_invoice(self, provider_id, id, **kwargs): # noqa: E501 + """Download a provider's invoice. # noqa: E501 - This endpoint allows you to create a provider administrator. You must be associated to the provider to use this route. **Sample Request** ``` curl -X POST https://console.jumpcloud.com/api/v2/providers/{ProviderID}/administrators \\ -H 'Accept: application/json' \\ -H 'Context-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"email\":\"{ADMIN_EMAIL}\" }' ``` # noqa: E501 + Retrieves an invoice for this provider. You must be associated to the provider to use this endpoint. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.providers_post_admins(provider_id, content_type, accept, async_req=True) + >>> thread = api.providers_retrieve_invoice(provider_id, id, async_req=True) >>> result = thread.get() :param async_req bool :param str provider_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param ProviderAdminReq body: - :return: Administrator + :param str id: (required) + :return: str If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.providers_post_admins_with_http_info(provider_id, content_type, accept, **kwargs) # noqa: E501 + return self.providers_retrieve_invoice_with_http_info(provider_id, id, **kwargs) # noqa: E501 else: - (data) = self.providers_post_admins_with_http_info(provider_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.providers_retrieve_invoice_with_http_info(provider_id, id, **kwargs) # noqa: E501 return data - def providers_post_admins_with_http_info(self, provider_id, content_type, accept, **kwargs): # noqa: E501 - """Create a new Provider Administrator # noqa: E501 + def providers_retrieve_invoice_with_http_info(self, provider_id, id, **kwargs): # noqa: E501 + """Download a provider's invoice. # noqa: E501 - This endpoint allows you to create a provider administrator. You must be associated to the provider to use this route. **Sample Request** ``` curl -X POST https://console.jumpcloud.com/api/v2/providers/{ProviderID}/administrators \\ -H 'Accept: application/json' \\ -H 'Context-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"email\":\"{ADMIN_EMAIL}\" }' ``` # noqa: E501 + Retrieves an invoice for this provider. You must be associated to the provider to use this endpoint. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.providers_post_admins_with_http_info(provider_id, content_type, accept, async_req=True) + >>> thread = api.providers_retrieve_invoice_with_http_info(provider_id, id, async_req=True) >>> result = thread.get() :param async_req bool :param str provider_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param ProviderAdminReq body: - :return: Administrator + :param str id: (required) + :return: str If the method is called asynchronously, returns the request thread. """ - all_params = ['provider_id', 'content_type', 'accept', 'body'] # noqa: E501 + all_params = ['provider_id', 'id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -228,63 +4280,159 @@ def providers_post_admins_with_http_info(self, provider_id, content_type, accept if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method providers_post_admins" % key + " to method providers_retrieve_invoice" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'provider_id' is set if ('provider_id' not in params or params['provider_id'] is None): - raise ValueError("Missing the required parameter `provider_id` when calling `providers_post_admins`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `providers_post_admins`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `providers_post_admins`") # noqa: E501 + raise ValueError("Missing the required parameter `provider_id` when calling `providers_retrieve_invoice`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `providers_retrieve_invoice`") # noqa: E501 collection_formats = {} path_params = {} if 'provider_id' in params: path_params['provider_id'] = params['provider_id'] # noqa: E501 + if 'id' in params: + path_params['ID'] = params['id'] # noqa: E501 query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} body_params = None - if 'body' in params: - body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + ['application/pdf']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/providers/{provider_id}/invoices/{ID}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def providers_retrieve_invoices(self, provider_id, **kwargs): # noqa: E501 + """List a provider's invoices. # noqa: E501 + + Retrieves a list of invoices for this provider. You must be associated to the provider to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_retrieve_invoices(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param int limit: The number of records to return at once. Limited to 100. + :return: ProviderInvoiceResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.providers_retrieve_invoices_with_http_info(provider_id, **kwargs) # noqa: E501 + else: + (data) = self.providers_retrieve_invoices_with_http_info(provider_id, **kwargs) # noqa: E501 + return data + + def providers_retrieve_invoices_with_http_info(self, provider_id, **kwargs): # noqa: E501 + """List a provider's invoices. # noqa: E501 + + Retrieves a list of invoices for this provider. You must be associated to the provider to use this endpoint. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.providers_retrieve_invoices_with_http_info(provider_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str provider_id: (required) + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param int limit: The number of records to return at once. Limited to 100. + :return: ProviderInvoiceResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['provider_id', 'skip', 'sort', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method providers_retrieve_invoices" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'provider_id' is set + if ('provider_id' not in params or + params['provider_id'] is None): + raise ValueError("Missing the required parameter `provider_id` when calling `providers_retrieve_invoices`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'provider_id' in params: + path_params['provider_id'] = params['provider_id'] # noqa: E501 + + query_params = [] + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/providers/{provider_id}/administrators', 'POST', + '/providers/{provider_id}/invoices', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Administrator', # noqa: E501 + response_type='ProviderInvoiceResponse', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/jcapiv2/jcapiv2/api/radius_servers_api.py b/jcapiv2/jcapiv2/api/radius_servers_api.py index 6da0867..76bf38b 100644 --- a/jcapiv2/jcapiv2/api/radius_servers_api.py +++ b/jcapiv2/jcapiv2/api/radius_servers_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,57 +32,53 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def graph_radius_server_associations_list(self, radiusserver_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_radius_server_associations_list(self, radiusserver_id, targets, **kwargs): # noqa: E501 """List the associations of a RADIUS Server # noqa: E501 This endpoint returns the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_radius_server_associations_list(radiusserver_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_radius_server_associations_list(radiusserver_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str radiusserver_id: ObjectID of the Radius Server. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"radius_server\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_radius_server_associations_list_with_http_info(radiusserver_id, targets, content_type, accept, **kwargs) # noqa: E501 + return self.graph_radius_server_associations_list_with_http_info(radiusserver_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_radius_server_associations_list_with_http_info(radiusserver_id, targets, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_radius_server_associations_list_with_http_info(radiusserver_id, targets, **kwargs) # noqa: E501 return data - def graph_radius_server_associations_list_with_http_info(self, radiusserver_id, targets, content_type, accept, **kwargs): # noqa: E501 + def graph_radius_server_associations_list_with_http_info(self, radiusserver_id, targets, **kwargs): # noqa: E501 """List the associations of a RADIUS Server # noqa: E501 This endpoint returns the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_radius_server_associations_list_with_http_info(radiusserver_id, targets, content_type, accept, async_req=True) + >>> thread = api.graph_radius_server_associations_list_with_http_info(radiusserver_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str radiusserver_id: ObjectID of the Radius Server. (required) - :param list[str] targets: (required) - :param str content_type: (required) - :param str accept: (required) + :param list[str] targets: Targets which a \"radius_server\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['radiusserver_id', 'targets', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['radiusserver_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -106,17 +101,7 @@ def graph_radius_server_associations_list_with_http_info(self, radiusserver_id, if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_radius_server_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_radius_server_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_radius_server_associations_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_radius_server_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -133,10 +118,6 @@ def graph_radius_server_associations_list_with_http_info(self, radiusserver_id, query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -148,10 +129,6 @@ def graph_radius_server_associations_list_with_http_info(self, radiusserver_id, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -171,53 +148,49 @@ def graph_radius_server_associations_list_with_http_info(self, radiusserver_id, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_radius_server_associations_post(self, radiusserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_radius_server_associations_post(self, radiusserver_id, **kwargs): # noqa: E501 """Manage the associations of a RADIUS Server # noqa: E501 This endpoint allows you to manage the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"type\":\"user\", \"id\":\"{USER_ID}\", \"op\":\"add\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_radius_server_associations_post(radiusserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_radius_server_associations_post(radiusserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str radiusserver_id: ObjectID of the Radius Server. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationRadiusServer body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_radius_server_associations_post_with_http_info(radiusserver_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_radius_server_associations_post_with_http_info(radiusserver_id, **kwargs) # noqa: E501 else: - (data) = self.graph_radius_server_associations_post_with_http_info(radiusserver_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_radius_server_associations_post_with_http_info(radiusserver_id, **kwargs) # noqa: E501 return data - def graph_radius_server_associations_post_with_http_info(self, radiusserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_radius_server_associations_post_with_http_info(self, radiusserver_id, **kwargs): # noqa: E501 """Manage the associations of a RADIUS Server # noqa: E501 This endpoint allows you to manage the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"type\":\"user\", \"id\":\"{USER_ID}\", \"op\":\"add\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_radius_server_associations_post_with_http_info(radiusserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_radius_server_associations_post_with_http_info(radiusserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str radiusserver_id: ObjectID of the Radius Server. (required) - :param str content_type: (required) - :param str accept: (required) - :param GraphManagementReq body: - :param str x_org_id: + :param GraphOperationRadiusServer body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['radiusserver_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['radiusserver_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -236,14 +209,6 @@ def graph_radius_server_associations_post_with_http_info(self, radiusserver_id, if ('radiusserver_id' not in params or params['radiusserver_id'] is None): raise ValueError("Missing the required parameter `radiusserver_id` when calling `graph_radius_server_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_radius_server_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_radius_server_associations_post`") # noqa: E501 collection_formats = {} @@ -254,10 +219,6 @@ def graph_radius_server_associations_post_with_http_info(self, radiusserver_id, query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -267,10 +228,6 @@ def graph_radius_server_associations_post_with_http_info(self, radiusserver_id, body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -294,57 +251,53 @@ def graph_radius_server_associations_post_with_http_info(self, radiusserver_id, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_radius_server_traverse_user(self, radiusserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_radius_server_traverse_user(self, radiusserver_id, **kwargs): # noqa: E501 """List the Users bound to a RADIUS Server # noqa: E501 This endpoint will return all Users bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_radius_server_traverse_user(radiusserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_radius_server_traverse_user(radiusserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str radiusserver_id: ObjectID of the Radius Server. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_radius_server_traverse_user_with_http_info(radiusserver_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_radius_server_traverse_user_with_http_info(radiusserver_id, **kwargs) # noqa: E501 else: - (data) = self.graph_radius_server_traverse_user_with_http_info(radiusserver_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_radius_server_traverse_user_with_http_info(radiusserver_id, **kwargs) # noqa: E501 return data - def graph_radius_server_traverse_user_with_http_info(self, radiusserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_radius_server_traverse_user_with_http_info(self, radiusserver_id, **kwargs): # noqa: E501 """List the Users bound to a RADIUS Server # noqa: E501 This endpoint will return all Users bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_radius_server_traverse_user_with_http_info(radiusserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_radius_server_traverse_user_with_http_info(radiusserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str radiusserver_id: ObjectID of the Radius Server. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['radiusserver_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['radiusserver_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -363,17 +316,7 @@ def graph_radius_server_traverse_user_with_http_info(self, radiusserver_id, cont if ('radiusserver_id' not in params or params['radiusserver_id'] is None): raise ValueError("Missing the required parameter `radiusserver_id` when calling `graph_radius_server_traverse_user`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_radius_server_traverse_user`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_radius_server_traverse_user`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_radius_server_traverse_user`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -392,10 +335,6 @@ def graph_radius_server_traverse_user_with_http_info(self, radiusserver_id, cont header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -405,10 +344,6 @@ def graph_radius_server_traverse_user_with_http_info(self, radiusserver_id, cont header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -428,57 +363,53 @@ def graph_radius_server_traverse_user_with_http_info(self, radiusserver_id, cont _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_radius_server_traverse_user_group(self, radiusserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_radius_server_traverse_user_group(self, radiusserver_id, **kwargs): # noqa: E501 """List the User Groups bound to a RADIUS Server # noqa: E501 This endpoint will return all Users Groups bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_radius_server_traverse_user_group(radiusserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_radius_server_traverse_user_group(radiusserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str radiusserver_id: ObjectID of the Radius Server. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_radius_server_traverse_user_group_with_http_info(radiusserver_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_radius_server_traverse_user_group_with_http_info(radiusserver_id, **kwargs) # noqa: E501 else: - (data) = self.graph_radius_server_traverse_user_group_with_http_info(radiusserver_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_radius_server_traverse_user_group_with_http_info(radiusserver_id, **kwargs) # noqa: E501 return data - def graph_radius_server_traverse_user_group_with_http_info(self, radiusserver_id, content_type, accept, **kwargs): # noqa: E501 + def graph_radius_server_traverse_user_group_with_http_info(self, radiusserver_id, **kwargs): # noqa: E501 """List the User Groups bound to a RADIUS Server # noqa: E501 This endpoint will return all Users Groups bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_radius_server_traverse_user_group_with_http_info(radiusserver_id, content_type, accept, async_req=True) + >>> thread = api.graph_radius_server_traverse_user_group_with_http_info(radiusserver_id, async_req=True) >>> result = thread.get() :param async_req bool :param str radiusserver_id: ObjectID of the Radius Server. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['radiusserver_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['radiusserver_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -497,17 +428,7 @@ def graph_radius_server_traverse_user_group_with_http_info(self, radiusserver_id if ('radiusserver_id' not in params or params['radiusserver_id'] is None): raise ValueError("Missing the required parameter `radiusserver_id` when calling `graph_radius_server_traverse_user_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_radius_server_traverse_user_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_radius_server_traverse_user_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_radius_server_traverse_user_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -526,10 +447,6 @@ def graph_radius_server_traverse_user_group_with_http_info(self, radiusserver_id header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -539,10 +456,6 @@ def graph_radius_server_traverse_user_group_with_http_info(self, radiusserver_id header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 diff --git a/jcapiv2/jcapiv2/api/samba_domains_api.py b/jcapiv2/jcapiv2/api/samba_domains_api.py index e640df9..ca9980c 100644 --- a/jcapiv2/jcapiv2/api/samba_domains_api.py +++ b/jcapiv2/jcapiv2/api/samba_domains_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -45,9 +44,7 @@ def ldapservers_samba_domains_delete(self, ldapserver_id, id, **kwargs): # noqa :param async_req bool :param str ldapserver_id: Unique identifier of the LDAP server. (required) :param str id: Unique identifier of the samba domain. (required) - :param str content_type: - :param str accept: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: str If the method is called asynchronously, returns the request thread. @@ -71,15 +68,13 @@ def ldapservers_samba_domains_delete_with_http_info(self, ldapserver_id, id, **k :param async_req bool :param str ldapserver_id: Unique identifier of the LDAP server. (required) :param str id: Unique identifier of the samba domain. (required) - :param str content_type: - :param str accept: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: str If the method is called asynchronously, returns the request thread. """ - all_params = ['ldapserver_id', 'id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['ldapserver_id', 'id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -114,10 +109,6 @@ def ldapservers_samba_domains_delete_with_http_info(self, ldapserver_id, id, **k query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -129,10 +120,6 @@ def ldapservers_samba_domains_delete_with_http_info(self, ldapserver_id, id, **k header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -164,9 +151,7 @@ def ldapservers_samba_domains_get(self, ldapserver_id, id, **kwargs): # noqa: E :param async_req bool :param str ldapserver_id: Unique identifier of the LDAP server. (required) :param str id: Unique identifier of the samba domain. (required) - :param str content_type: - :param str accept: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: SambaDomainOutput If the method is called asynchronously, returns the request thread. @@ -190,15 +175,13 @@ def ldapservers_samba_domains_get_with_http_info(self, ldapserver_id, id, **kwar :param async_req bool :param str ldapserver_id: Unique identifier of the LDAP server. (required) :param str id: Unique identifier of the samba domain. (required) - :param str content_type: - :param str accept: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: SambaDomainOutput If the method is called asynchronously, returns the request thread. """ - all_params = ['ldapserver_id', 'id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['ldapserver_id', 'id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -233,10 +216,6 @@ def ldapservers_samba_domains_get_with_http_info(self, ldapserver_id, id, **kwar query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -248,10 +227,6 @@ def ldapservers_samba_domains_get_with_http_info(self, ldapserver_id, id, **kwar header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -282,14 +257,12 @@ def ldapservers_samba_domains_list(self, ldapserver_id, **kwargs): # noqa: E501 :param async_req bool :param str ldapserver_id: Unique identifier of the LDAP server. (required) - :param str content_type: - :param str accept: :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[SambaDomainOutput] If the method is called asynchronously, returns the request thread. @@ -312,20 +285,18 @@ def ldapservers_samba_domains_list_with_http_info(self, ldapserver_id, **kwargs) :param async_req bool :param str ldapserver_id: Unique identifier of the LDAP server. (required) - :param str content_type: - :param str accept: :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[SambaDomainOutput] If the method is called asynchronously, returns the request thread. """ - all_params = ['ldapserver_id', 'content_type', 'accept', 'fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['ldapserver_id', 'fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -345,8 +316,6 @@ def ldapservers_samba_domains_list_with_http_info(self, ldapserver_id, **kwargs) params['ldapserver_id'] is None): raise ValueError("Missing the required parameter `ldapserver_id` when calling `ldapservers_samba_domains_list`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `ldapservers_samba_domains_list`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -369,10 +338,6 @@ def ldapservers_samba_domains_list_with_http_info(self, ldapserver_id, **kwargs) collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -384,10 +349,6 @@ def ldapservers_samba_domains_list_with_http_info(self, ldapserver_id, **kwargs) header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -410,7 +371,7 @@ def ldapservers_samba_domains_list_with_http_info(self, ldapserver_id, **kwargs) def ldapservers_samba_domains_post(self, ldapserver_id, **kwargs): # noqa: E501 """Create Samba Domain # noqa: E501 - This endpoint allows you to create a samba domain for an LDAP server. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` # noqa: E501 + This endpoint allows you to create a samba domain for an LDAP server. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.ldapservers_samba_domains_post(ldapserver_id, async_req=True) @@ -419,9 +380,7 @@ def ldapservers_samba_domains_post(self, ldapserver_id, **kwargs): # noqa: E501 :param async_req bool :param str ldapserver_id: Unique identifier of the LDAP server. (required) :param SambaDomainInput body: - :param str content_type: - :param str accept: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: SambaDomainOutput If the method is called asynchronously, returns the request thread. @@ -436,7 +395,7 @@ def ldapservers_samba_domains_post(self, ldapserver_id, **kwargs): # noqa: E501 def ldapservers_samba_domains_post_with_http_info(self, ldapserver_id, **kwargs): # noqa: E501 """Create Samba Domain # noqa: E501 - This endpoint allows you to create a samba domain for an LDAP server. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` # noqa: E501 + This endpoint allows you to create a samba domain for an LDAP server. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.ldapservers_samba_domains_post_with_http_info(ldapserver_id, async_req=True) @@ -445,15 +404,13 @@ def ldapservers_samba_domains_post_with_http_info(self, ldapserver_id, **kwargs) :param async_req bool :param str ldapserver_id: Unique identifier of the LDAP server. (required) :param SambaDomainInput body: - :param str content_type: - :param str accept: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: SambaDomainOutput If the method is called asynchronously, returns the request thread. """ - all_params = ['ldapserver_id', 'body', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['ldapserver_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -482,10 +439,6 @@ def ldapservers_samba_domains_post_with_http_info(self, ldapserver_id, **kwargs) query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -525,7 +478,7 @@ def ldapservers_samba_domains_post_with_http_info(self, ldapserver_id, **kwargs) def ldapservers_samba_domains_put(self, ldapserver_id, id, **kwargs): # noqa: E501 """Update Samba Domain # noqa: E501 - This endpoint allows you to update the samba domain information for an LDAP server. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` # noqa: E501 + This endpoint allows you to update the samba domain information for an LDAP server. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.ldapservers_samba_domains_put(ldapserver_id, id, async_req=True) @@ -535,9 +488,6 @@ def ldapservers_samba_domains_put(self, ldapserver_id, id, **kwargs): # noqa: E :param str ldapserver_id: Unique identifier of the LDAP server. (required) :param str id: Unique identifier of the samba domain. (required) :param SambaDomainInput body: - :param str content_type: - :param str accept: - :param str x_org_id: :return: SambaDomainOutput If the method is called asynchronously, returns the request thread. @@ -552,7 +502,7 @@ def ldapservers_samba_domains_put(self, ldapserver_id, id, **kwargs): # noqa: E def ldapservers_samba_domains_put_with_http_info(self, ldapserver_id, id, **kwargs): # noqa: E501 """Update Samba Domain # noqa: E501 - This endpoint allows you to update the samba domain information for an LDAP server. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` # noqa: E501 + This endpoint allows you to update the samba domain information for an LDAP server. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.ldapservers_samba_domains_put_with_http_info(ldapserver_id, id, async_req=True) @@ -562,15 +512,12 @@ def ldapservers_samba_domains_put_with_http_info(self, ldapserver_id, id, **kwar :param str ldapserver_id: Unique identifier of the LDAP server. (required) :param str id: Unique identifier of the samba domain. (required) :param SambaDomainInput body: - :param str content_type: - :param str accept: - :param str x_org_id: :return: SambaDomainOutput If the method is called asynchronously, returns the request thread. """ - all_params = ['ldapserver_id', 'id', 'body', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['ldapserver_id', 'id', 'body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -605,12 +552,6 @@ def ldapservers_samba_domains_put_with_http_info(self, ldapserver_id, id, **kwar query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - if 'x_org_id' in params: - header_params['x-org-id'] = params['x_org_id'] # noqa: E501 form_params = [] local_var_files = {} diff --git a/jcapiv2/jcapiv2/api/scim_import_api.py b/jcapiv2/jcapiv2/api/scim_import_api.py new file mode 100644 index 0000000..a29e874 --- /dev/null +++ b/jcapiv2/jcapiv2/api/scim_import_api.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv2.api_client import ApiClient + + +class SCIMImportApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def import_users(self, application_id, **kwargs): # noqa: E501 + """Get a list of users to import from an Application IdM service provider # noqa: E501 + + Get a list of users to import from an Application IdM service provider. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.import_users(application_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: ObjectID of the Application. (required) + :param str filter: Filter users by a search term + :param str query: URL query to merge with the service provider request + :param str sort: Sort users by supported fields + :param str sort_order: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: ImportUsersResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.import_users_with_http_info(application_id, **kwargs) # noqa: E501 + else: + (data) = self.import_users_with_http_info(application_id, **kwargs) # noqa: E501 + return data + + def import_users_with_http_info(self, application_id, **kwargs): # noqa: E501 + """Get a list of users to import from an Application IdM service provider # noqa: E501 + + Get a list of users to import from an Application IdM service provider. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.import_users_with_http_info(application_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str application_id: ObjectID of the Application. (required) + :param str filter: Filter users by a search term + :param str query: URL query to merge with the service provider request + :param str sort: Sort users by supported fields + :param str sort_order: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: ImportUsersResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['application_id', 'filter', 'query', 'sort', 'sort_order', 'x_org_id', 'limit', 'skip'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method import_users" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'application_id' is set + if ('application_id' not in params or + params['application_id'] is None): + raise ValueError("Missing the required parameter `application_id` when calling `import_users`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'application_id' in params: + path_params['application_id'] = params['application_id'] # noqa: E501 + + query_params = [] + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + if 'query' in params: + query_params.append(('query', params['query'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + if 'sort_order' in params: + query_params.append(('sortOrder', params['sort_order'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/applications/{application_id}/import/users', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ImportUsersResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/software_apps_api.py b/jcapiv2/jcapiv2/api/software_apps_api.py new file mode 100644 index 0000000..7611440 --- /dev/null +++ b/jcapiv2/jcapiv2/api/software_apps_api.py @@ -0,0 +1,1308 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv2.api_client import ApiClient + + +class SoftwareAppsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def graph_softwareapps_associations_list(self, software_app_id, targets, **kwargs): # noqa: E501 + """List the associations of a Software Application # noqa: E501 + + This endpoint will return the _direct_ associations of a Software Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Software Application and System Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_softwareapps_associations_list(software_app_id, targets, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str software_app_id: ObjectID of the Software App. (required) + :param list[str] targets: Targets which a \"software_app\" can be associated to. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_softwareapps_associations_list_with_http_info(software_app_id, targets, **kwargs) # noqa: E501 + else: + (data) = self.graph_softwareapps_associations_list_with_http_info(software_app_id, targets, **kwargs) # noqa: E501 + return data + + def graph_softwareapps_associations_list_with_http_info(self, software_app_id, targets, **kwargs): # noqa: E501 + """List the associations of a Software Application # noqa: E501 + + This endpoint will return the _direct_ associations of a Software Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Software Application and System Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_softwareapps_associations_list_with_http_info(software_app_id, targets, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str software_app_id: ObjectID of the Software App. (required) + :param list[str] targets: Targets which a \"software_app\" can be associated to. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['software_app_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_softwareapps_associations_list" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'software_app_id' is set + if ('software_app_id' not in params or + params['software_app_id'] is None): + raise ValueError("Missing the required parameter `software_app_id` when calling `graph_softwareapps_associations_list`") # noqa: E501 + # verify the required parameter 'targets' is set + if ('targets' not in params or + params['targets'] is None): + raise ValueError("Missing the required parameter `targets` when calling `graph_softwareapps_associations_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'software_app_id' in params: + path_params['software_app_id'] = params['software_app_id'] # noqa: E501 + + query_params = [] + if 'targets' in params: + query_params.append(('targets', params['targets'])) # noqa: E501 + collection_formats['targets'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/softwareapps/{software_app_id}/associations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphConnection]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_softwareapps_associations_post(self, software_app_id, **kwargs): # noqa: E501 + """Manage the associations of a software application. # noqa: E501 + + This endpoint allows you to associate or disassociate a software application to a system or system group. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"id\": \"\", \"op\": \"add\", \"type\": \"system\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_softwareapps_associations_post(software_app_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str software_app_id: ObjectID of the Software App. (required) + :param GraphOperationSoftwareApp body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_softwareapps_associations_post_with_http_info(software_app_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_softwareapps_associations_post_with_http_info(software_app_id, **kwargs) # noqa: E501 + return data + + def graph_softwareapps_associations_post_with_http_info(self, software_app_id, **kwargs): # noqa: E501 + """Manage the associations of a software application. # noqa: E501 + + This endpoint allows you to associate or disassociate a software application to a system or system group. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"id\": \"\", \"op\": \"add\", \"type\": \"system\" }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_softwareapps_associations_post_with_http_info(software_app_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str software_app_id: ObjectID of the Software App. (required) + :param GraphOperationSoftwareApp body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['software_app_id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_softwareapps_associations_post" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'software_app_id' is set + if ('software_app_id' not in params or + params['software_app_id'] is None): + raise ValueError("Missing the required parameter `software_app_id` when calling `graph_softwareapps_associations_post`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'software_app_id' in params: + path_params['software_app_id'] = params['software_app_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/softwareapps/{software_app_id}/associations', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_softwareapps_traverse_system(self, software_app_id, **kwargs): # noqa: E501 + """List the Systems bound to a Software App. # noqa: E501 + + This endpoint will return all Systems bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_softwareapps_traverse_system(software_app_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str software_app_id: ObjectID of the Software App. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_softwareapps_traverse_system_with_http_info(software_app_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_softwareapps_traverse_system_with_http_info(software_app_id, **kwargs) # noqa: E501 + return data + + def graph_softwareapps_traverse_system_with_http_info(self, software_app_id, **kwargs): # noqa: E501 + """List the Systems bound to a Software App. # noqa: E501 + + This endpoint will return all Systems bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_softwareapps_traverse_system_with_http_info(software_app_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str software_app_id: ObjectID of the Software App. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['software_app_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_softwareapps_traverse_system" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'software_app_id' is set + if ('software_app_id' not in params or + params['software_app_id'] is None): + raise ValueError("Missing the required parameter `software_app_id` when calling `graph_softwareapps_traverse_system`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'software_app_id' in params: + path_params['software_app_id'] = params['software_app_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/softwareapps/{software_app_id}/systems', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_softwareapps_traverse_system_group(self, software_app_id, **kwargs): # noqa: E501 + """List the System Groups bound to a Software App. # noqa: E501 + + This endpoint will return all Systems Groups bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_softwareapps_traverse_system_group(software_app_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str software_app_id: ObjectID of the Software App. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_softwareapps_traverse_system_group_with_http_info(software_app_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_softwareapps_traverse_system_group_with_http_info(software_app_id, **kwargs) # noqa: E501 + return data + + def graph_softwareapps_traverse_system_group_with_http_info(self, software_app_id, **kwargs): # noqa: E501 + """List the System Groups bound to a Software App. # noqa: E501 + + This endpoint will return all Systems Groups bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_softwareapps_traverse_system_group_with_http_info(software_app_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str software_app_id: ObjectID of the Software App. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['software_app_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_softwareapps_traverse_system_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'software_app_id' is set + if ('software_app_id' not in params or + params['software_app_id'] is None): + raise ValueError("Missing the required parameter `software_app_id` when calling `graph_softwareapps_traverse_system_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'software_app_id' in params: + path_params['software_app_id'] = params['software_app_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/softwareapps/{software_app_id}/systemgroups', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def software_app_statuses_list(self, software_app_id, **kwargs): # noqa: E501 + """Get the status of the provided Software Application # noqa: E501 + + This endpoint allows you to get the status of the provided Software Application on associated JumpCloud systems. #### Sample Request ``` $ curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/statuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.software_app_statuses_list(software_app_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str software_app_id: ObjectID of the Software App. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: list[SoftwareAppStatus] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.software_app_statuses_list_with_http_info(software_app_id, **kwargs) # noqa: E501 + else: + (data) = self.software_app_statuses_list_with_http_info(software_app_id, **kwargs) # noqa: E501 + return data + + def software_app_statuses_list_with_http_info(self, software_app_id, **kwargs): # noqa: E501 + """Get the status of the provided Software Application # noqa: E501 + + This endpoint allows you to get the status of the provided Software Application on associated JumpCloud systems. #### Sample Request ``` $ curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/statuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.software_app_statuses_list_with_http_info(software_app_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str software_app_id: ObjectID of the Software App. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: list[SoftwareAppStatus] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['software_app_id', 'x_org_id', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method software_app_statuses_list" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'software_app_id' is set + if ('software_app_id' not in params or + params['software_app_id'] is None): + raise ValueError("Missing the required parameter `software_app_id` when calling `software_app_statuses_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'software_app_id' in params: + path_params['software_app_id'] = params['software_app_id'] # noqa: E501 + + query_params = [] + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/softwareapps/{software_app_id}/statuses', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SoftwareAppStatus]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def software_apps_delete(self, id, **kwargs): # noqa: E501 + """Delete a configured Software Application # noqa: E501 + + Removes a Software Application configuration. Warning: This is a destructive operation and will unmanage the application on all affected systems. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.software_apps_delete(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.software_apps_delete_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.software_apps_delete_with_http_info(id, **kwargs) # noqa: E501 + return data + + def software_apps_delete_with_http_info(self, id, **kwargs): # noqa: E501 + """Delete a configured Software Application # noqa: E501 + + Removes a Software Application configuration. Warning: This is a destructive operation and will unmanage the application on all affected systems. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.software_apps_delete_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method software_apps_delete" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `software_apps_delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/softwareapps/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def software_apps_get(self, id, **kwargs): # noqa: E501 + """Retrieve a configured Software Application. # noqa: E501 + + Retrieves a Software Application. The optional isConfigEnabled and appConfiguration apple_vpp attributes are populated in this response. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.software_apps_get(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: SoftwareApp + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.software_apps_get_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.software_apps_get_with_http_info(id, **kwargs) # noqa: E501 + return data + + def software_apps_get_with_http_info(self, id, **kwargs): # noqa: E501 + """Retrieve a configured Software Application. # noqa: E501 + + Retrieves a Software Application. The optional isConfigEnabled and appConfiguration apple_vpp attributes are populated in this response. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.software_apps_get_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: SoftwareApp + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method software_apps_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `software_apps_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/softwareapps/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SoftwareApp', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def software_apps_list(self, **kwargs): # noqa: E501 + """Get all configured Software Applications. # noqa: E501 + + This endpoint allows you to get all configured Software Applications that will be managed by JumpCloud on associated JumpCloud systems. The optional isConfigEnabled and appConfiguration apple_vpp attributes are not included in the response. #### Sample Request ``` $ curl -X GET https://console.jumpcloud.com/api/v2/softwareapps \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.software_apps_list(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: list[SoftwareApp] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.software_apps_list_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.software_apps_list_with_http_info(**kwargs) # noqa: E501 + return data + + def software_apps_list_with_http_info(self, **kwargs): # noqa: E501 + """Get all configured Software Applications. # noqa: E501 + + This endpoint allows you to get all configured Software Applications that will be managed by JumpCloud on associated JumpCloud systems. The optional isConfigEnabled and appConfiguration apple_vpp attributes are not included in the response. #### Sample Request ``` $ curl -X GET https://console.jumpcloud.com/api/v2/softwareapps \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.software_apps_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: list[SoftwareApp] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['x_org_id', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method software_apps_list" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/softwareapps', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SoftwareApp]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def software_apps_post(self, **kwargs): # noqa: E501 + """Create a Software Application that will be managed by JumpCloud. # noqa: E501 + + This endpoint allows you to create a Software Application that will be managed by JumpCloud on associated JumpCloud systems. The optional isConfigEnabled and appConfiguration apple_vpp attributes are not included in the response. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\": \"Adobe Reader\", \"settings\": [{\"packageId\": \"adobereader\"}] }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.software_apps_post(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SoftwareApp body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: SoftwareApp + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.software_apps_post_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.software_apps_post_with_http_info(**kwargs) # noqa: E501 + return data + + def software_apps_post_with_http_info(self, **kwargs): # noqa: E501 + """Create a Software Application that will be managed by JumpCloud. # noqa: E501 + + This endpoint allows you to create a Software Application that will be managed by JumpCloud on associated JumpCloud systems. The optional isConfigEnabled and appConfiguration apple_vpp attributes are not included in the response. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\": \"Adobe Reader\", \"settings\": [{\"packageId\": \"adobereader\"}] }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.software_apps_post_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SoftwareApp body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: SoftwareApp + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method software_apps_post" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/softwareapps', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SoftwareApp', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def software_apps_reclaim_licenses(self, software_app_id, **kwargs): # noqa: E501 + """Reclaim Licenses for a Software Application. # noqa: E501 + + This endpoint allows you to reclaim the licenses from a software app associated with devices that are deleted. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/reclaim-licenses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.software_apps_reclaim_licenses(software_app_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str software_app_id: (required) + :return: SoftwareAppReclaimLicenses + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.software_apps_reclaim_licenses_with_http_info(software_app_id, **kwargs) # noqa: E501 + else: + (data) = self.software_apps_reclaim_licenses_with_http_info(software_app_id, **kwargs) # noqa: E501 + return data + + def software_apps_reclaim_licenses_with_http_info(self, software_app_id, **kwargs): # noqa: E501 + """Reclaim Licenses for a Software Application. # noqa: E501 + + This endpoint allows you to reclaim the licenses from a software app associated with devices that are deleted. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/reclaim-licenses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.software_apps_reclaim_licenses_with_http_info(software_app_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str software_app_id: (required) + :return: SoftwareAppReclaimLicenses + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['software_app_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method software_apps_reclaim_licenses" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'software_app_id' is set + if ('software_app_id' not in params or + params['software_app_id'] is None): + raise ValueError("Missing the required parameter `software_app_id` when calling `software_apps_reclaim_licenses`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'software_app_id' in params: + path_params['software_app_id'] = params['software_app_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/softwareapps/{software_app_id}/reclaim-licenses', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SoftwareAppReclaimLicenses', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def software_apps_retry_installation(self, body, software_app_id, **kwargs): # noqa: E501 + """Retry Installation for a Software Application # noqa: E501 + + This endpoints initiates an installation retry of an Apple VPP App for the provided system IDs #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/retry-installation \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"system_ids\": \"{, , ...}\"}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.software_apps_retry_installation(body, software_app_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SoftwareAppsRetryInstallationRequest body: (required) + :param str software_app_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.software_apps_retry_installation_with_http_info(body, software_app_id, **kwargs) # noqa: E501 + else: + (data) = self.software_apps_retry_installation_with_http_info(body, software_app_id, **kwargs) # noqa: E501 + return data + + def software_apps_retry_installation_with_http_info(self, body, software_app_id, **kwargs): # noqa: E501 + """Retry Installation for a Software Application # noqa: E501 + + This endpoints initiates an installation retry of an Apple VPP App for the provided system IDs #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/retry-installation \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"system_ids\": \"{, , ...}\"}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.software_apps_retry_installation_with_http_info(body, software_app_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SoftwareAppsRetryInstallationRequest body: (required) + :param str software_app_id: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'software_app_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method software_apps_retry_installation" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `software_apps_retry_installation`") # noqa: E501 + # verify the required parameter 'software_app_id' is set + if ('software_app_id' not in params or + params['software_app_id'] is None): + raise ValueError("Missing the required parameter `software_app_id` when calling `software_apps_retry_installation`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'software_app_id' in params: + path_params['software_app_id'] = params['software_app_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/softwareapps/{software_app_id}/retry-installation', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def software_apps_update(self, id, **kwargs): # noqa: E501 + """Update a Software Application Configuration. # noqa: E501 + + This endpoint updates a specific Software Application configuration for the organization. displayName can be changed alone if no settings are provided. If a setting is provided, it should include all its information since this endpoint will update all the settings' fields. The optional isConfigEnabled and appConfiguration apple_vpp attributes are not included in the response. #### Sample Request - displayName only ``` curl -X PUT https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\": \"My Software App\" }' ``` #### Sample Request - all attributes ``` curl -X PUT https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\": \"My Software App\", \"settings\": [ { \"packageId\": \"123456\", \"autoUpdate\": false, \"allowUpdateDelay\": false, \"packageManager\": \"APPLE_VPP\", \"locationObjectId\": \"123456789012123456789012\", \"location\": \"123456\", \"desiredState\": \"Install\", \"appleVpp\": { \"appConfiguration\": \"MyKeyMy String\", \"assignedLicenses\": 20, \"availableLicenses\": 10, \"details\": {}, \"isConfigEnabled\": true, \"supportedDeviceFamilies\": [ \"IPAD\", \"MAC\" ], \"totalLicenses\": 30 }, \"packageSubtitle\": \"My package subtitle\", \"packageVersion\": \"1.2.3\", \"packageKind\": \"software-package\", \"assetKind\": \"software\", \"assetSha256Size\": 256, \"assetSha256Strings\": [ \"a123b123c123d123\" ], \"description\": \"My app description\" } ] }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.software_apps_update(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param SoftwareApp body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: SoftwareApp + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.software_apps_update_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.software_apps_update_with_http_info(id, **kwargs) # noqa: E501 + return data + + def software_apps_update_with_http_info(self, id, **kwargs): # noqa: E501 + """Update a Software Application Configuration. # noqa: E501 + + This endpoint updates a specific Software Application configuration for the organization. displayName can be changed alone if no settings are provided. If a setting is provided, it should include all its information since this endpoint will update all the settings' fields. The optional isConfigEnabled and appConfiguration apple_vpp attributes are not included in the response. #### Sample Request - displayName only ``` curl -X PUT https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\": \"My Software App\" }' ``` #### Sample Request - all attributes ``` curl -X PUT https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\": \"My Software App\", \"settings\": [ { \"packageId\": \"123456\", \"autoUpdate\": false, \"allowUpdateDelay\": false, \"packageManager\": \"APPLE_VPP\", \"locationObjectId\": \"123456789012123456789012\", \"location\": \"123456\", \"desiredState\": \"Install\", \"appleVpp\": { \"appConfiguration\": \"MyKeyMy String\", \"assignedLicenses\": 20, \"availableLicenses\": 10, \"details\": {}, \"isConfigEnabled\": true, \"supportedDeviceFamilies\": [ \"IPAD\", \"MAC\" ], \"totalLicenses\": 30 }, \"packageSubtitle\": \"My package subtitle\", \"packageVersion\": \"1.2.3\", \"packageKind\": \"software-package\", \"assetKind\": \"software\", \"assetSha256Size\": 256, \"assetSha256Strings\": [ \"a123b123c123d123\" ], \"description\": \"My app description\" } ] }' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.software_apps_update_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: (required) + :param SoftwareApp body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: SoftwareApp + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method software_apps_update" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `software_apps_update`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/softwareapps/{id}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SoftwareApp', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/subscriptions_api.py b/jcapiv2/jcapiv2/api/subscriptions_api.py new file mode 100644 index 0000000..a7ac948 --- /dev/null +++ b/jcapiv2/jcapiv2/api/subscriptions_api.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from jcapiv2.api_client import ApiClient + + +class SubscriptionsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def subscriptions_get(self, **kwargs): # noqa: E501 + """Lists all the Pricing & Packaging Subscriptions # noqa: E501 + + This endpoint returns all pricing & packaging subscriptions. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/subscriptions \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.subscriptions_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[Subscription] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.subscriptions_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.subscriptions_get_with_http_info(**kwargs) # noqa: E501 + return data + + def subscriptions_get_with_http_info(self, **kwargs): # noqa: E501 + """Lists all the Pricing & Packaging Subscriptions # noqa: E501 + + This endpoint returns all pricing & packaging subscriptions. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/subscriptions \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.subscriptions_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[Subscription] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method subscriptions_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/subscriptions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Subscription]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/system_group_associations_api.py b/jcapiv2/jcapiv2/api/system_group_associations_api.py index 236c7c2..0db07ec 100644 --- a/jcapiv2/jcapiv2/api/system_group_associations_api.py +++ b/jcapiv2/jcapiv2/api/system_group_associations_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,57 +32,53 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def graph_system_group_associations_list(self, group_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_system_group_associations_list(self, group_id, targets, **kwargs): # noqa: E501 """List the associations of a System Group # noqa: E501 This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_associations_list(group_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_system_group_associations_list(group_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"system_group\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_associations_list_with_http_info(group_id, content_type, accept, targets, **kwargs) # noqa: E501 + return self.graph_system_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_associations_list_with_http_info(group_id, content_type, accept, targets, **kwargs) # noqa: E501 + (data) = self.graph_system_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 return data - def graph_system_group_associations_list_with_http_info(self, group_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_system_group_associations_list_with_http_info(self, group_id, targets, **kwargs): # noqa: E501 """List the associations of a System Group # noqa: E501 This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_associations_list_with_http_info(group_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_system_group_associations_list_with_http_info(group_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"system_group\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -102,21 +97,11 @@ def graph_system_group_associations_list_with_http_info(self, group_id, content_ if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_associations_list`") # noqa: E501 # verify the required parameter 'targets' is set if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_system_group_associations_list`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -124,19 +109,15 @@ def graph_system_group_associations_list_with_http_info(self, group_id, content_ path_params['group_id'] = params['group_id'] # noqa: E501 query_params = [] + if 'targets' in params: + query_params.append(('targets', params['targets'])) # noqa: E501 + collection_formats['targets'] = 'csv' # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 - if 'targets' in params: - query_params.append(('targets', params['targets'])) # noqa: E501 - collection_formats['targets'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -148,10 +129,6 @@ def graph_system_group_associations_list_with_http_info(self, group_id, content_ header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -171,53 +148,49 @@ def graph_system_group_associations_list_with_http_info(self, group_id, content_ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_associations_post(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_associations_post(self, group_id, **kwargs): # noqa: E501 """Manage the associations of a System Group # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_associations_post(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_associations_post(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGroupGraphManagementReq body: - :param str x_org_id: + :param GraphOperationSystemGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_associations_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_associations_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_associations_post_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_associations_post_with_http_info(self, group_id, **kwargs): # noqa: E501 """Manage the associations of a System Group # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_associations_post_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_associations_post_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGroupGraphManagementReq body: - :param str x_org_id: + :param GraphOperationSystemGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -236,14 +209,6 @@ def graph_system_group_associations_post_with_http_info(self, group_id, content_ if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_associations_post`") # noqa: E501 collection_formats = {} @@ -254,10 +219,6 @@ def graph_system_group_associations_post_with_http_info(self, group_id, content_ query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -267,10 +228,6 @@ def graph_system_group_associations_post_with_http_info(self, group_id, content_ body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -294,57 +251,53 @@ def graph_system_group_associations_post_with_http_info(self, group_id, content_ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_traverse_command(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_command(self, group_id, **kwargs): # noqa: E501 """List the Commands bound to a System Group # noqa: E501 This endpoint will return all Commands bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_command(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_command(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_traverse_command_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_traverse_command_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_traverse_command_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_traverse_command_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_traverse_command_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_command_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Commands bound to a System Group # noqa: E501 This endpoint will return all Commands bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_command_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_command_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -363,17 +316,7 @@ def graph_system_group_traverse_command_with_http_info(self, group_id, content_t if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_traverse_command`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_traverse_command`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_traverse_command`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_traverse_command`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -392,10 +335,6 @@ def graph_system_group_traverse_command_with_http_info(self, group_id, content_t header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -405,10 +344,6 @@ def graph_system_group_traverse_command_with_http_info(self, group_id, content_t header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -428,57 +363,53 @@ def graph_system_group_traverse_command_with_http_info(self, group_id, content_t _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_traverse_policy(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_policy(self, group_id, **kwargs): # noqa: E501 """List the Policies bound to a System Group # noqa: E501 This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_policy(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_policy(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_traverse_policy_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_traverse_policy_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_traverse_policy_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_traverse_policy_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_traverse_policy_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_policy_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Policies bound to a System Group # noqa: E501 This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_policy_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_policy_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -497,17 +428,7 @@ def graph_system_group_traverse_policy_with_http_info(self, group_id, content_ty if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_traverse_policy`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_traverse_policy`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_traverse_policy`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_traverse_policy`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -526,10 +447,6 @@ def graph_system_group_traverse_policy_with_http_info(self, group_id, content_ty header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -539,15 +456,123 @@ def graph_system_group_traverse_policy_with_http_info(self, group_id, content_ty header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systemgroups/{group_id}/policies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_system_group_traverse_policy_group(self, group_id, **kwargs): # noqa: E501 + """List the Policy Groups bound to a System Group # noqa: E501 + + This endpoint will return all Policy Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_system_group_traverse_policy_group(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the System Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_system_group_traverse_policy_group_with_http_info(group_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_system_group_traverse_policy_group_with_http_info(group_id, **kwargs) # noqa: E501 + return data + + def graph_system_group_traverse_policy_group_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the Policy Groups bound to a System Group # noqa: E501 + + This endpoint will return all Policy Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_system_group_traverse_policy_group_with_http_info(group_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str group_id: ObjectID of the System Group. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_system_group_traverse_policy_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_traverse_policy_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systemgroups/{group_id}/policies', 'GET', + '/systemgroups/{group_id}/policygroups', 'GET', path_params, query_params, header_params, @@ -562,57 +587,53 @@ def graph_system_group_traverse_policy_with_http_info(self, group_id, content_ty _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_traverse_user(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_user(self, group_id, **kwargs): # noqa: E501 """List the Users bound to a System Group # noqa: E501 This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_user(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_user(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_traverse_user_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_traverse_user_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_traverse_user_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_traverse_user_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_traverse_user_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_user_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Users bound to a System Group # noqa: E501 This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_user_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_user_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -631,17 +652,7 @@ def graph_system_group_traverse_user_with_http_info(self, group_id, content_type if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_traverse_user`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_traverse_user`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_traverse_user`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_traverse_user`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -660,10 +671,6 @@ def graph_system_group_traverse_user_with_http_info(self, group_id, content_type header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -673,10 +680,6 @@ def graph_system_group_traverse_user_with_http_info(self, group_id, content_type header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -696,57 +699,53 @@ def graph_system_group_traverse_user_with_http_info(self, group_id, content_type _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_traverse_user_group(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_user_group(self, group_id, **kwargs): # noqa: E501 """List the User Groups bound to a System Group # noqa: E501 This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_user_group(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_user_group(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_traverse_user_group_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_traverse_user_group_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_traverse_user_group_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_traverse_user_group_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_traverse_user_group_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_user_group_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the User Groups bound to a System Group # noqa: E501 This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_user_group_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_user_group_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -765,17 +764,7 @@ def graph_system_group_traverse_user_group_with_http_info(self, group_id, conten if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_traverse_user_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_traverse_user_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_traverse_user_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_traverse_user_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -794,10 +783,6 @@ def graph_system_group_traverse_user_group_with_http_info(self, group_id, conten header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -807,10 +792,6 @@ def graph_system_group_traverse_user_group_with_http_info(self, group_id, conten header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 diff --git a/jcapiv2/jcapiv2/api/system_group_members__membership_api.py b/jcapiv2/jcapiv2/api/system_group_members__membership_api.py index a51a9e7..db11a99 100644 --- a/jcapiv2/jcapiv2/api/system_group_members__membership_api.py +++ b/jcapiv2/jcapiv2/api/system_group_members__membership_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,194 +32,51 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def graph_system_group_member_of(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the System Group's parents # noqa: E501 - - This endpoint returns all System Groups a System Group is a member of. This endpoint is not yet public as we haven't completed the code yet. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_member_of(group_id, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: - :return: list[GraphObjectWithPaths] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.graph_system_group_member_of_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 - else: - (data) = self.graph_system_group_member_of_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 - return data - - def graph_system_group_member_of_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the System Group's parents # noqa: E501 - - This endpoint returns all System Groups a System Group is a member of. This endpoint is not yet public as we haven't completed the code yet. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_member_of_with_http_info(group_id, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: - :return: list[GraphObjectWithPaths] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['group_id', 'content_type', 'accept', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method graph_system_group_member_of" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'group_id' is set - if ('group_id' not in params or - params['group_id'] is None): - raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_member_of`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_member_of`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_member_of`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_member_of`, must be a value greater than or equal to `0`") # noqa: E501 - collection_formats = {} - - path_params = {} - if 'group_id' in params: - path_params['group_id'] = params['group_id'] # noqa: E501 - - query_params = [] - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 - collection_formats['filter'] = 'csv' # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - collection_formats['sort'] = 'csv' # noqa: E501 - - header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - if 'x_org_id' in params: - header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/systemgroups/{group_id}/memberof', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[GraphObjectWithPaths]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def graph_system_group_members_list(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_members_list(self, group_id, **kwargs): # noqa: E501 """List the members of a System Group # noqa: E501 This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_members_list(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_members_list(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_members_list_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_members_list_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_members_list_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_members_list_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the members of a System Group # noqa: E501 This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_members_list_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_members_list_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -239,17 +95,7 @@ def graph_system_group_members_list_with_http_info(self, group_id, content_type, if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_members_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_members_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_members_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_members_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -263,10 +109,6 @@ def graph_system_group_members_list_with_http_info(self, group_id, content_type, query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -278,10 +120,6 @@ def graph_system_group_members_list_with_http_info(self, group_id, content_type, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -301,57 +139,53 @@ def graph_system_group_members_list_with_http_info(self, group_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_members_post(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_members_post(self, group_id, **kwargs): # noqa: E501 """Manage the members of a System Group # noqa: E501 - This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_members_post(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_members_post(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGroupMembersReq body: + :param GraphOperationSystemGroupMember body: :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_members_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_members_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_members_post_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_members_post_with_http_info(self, group_id, **kwargs): # noqa: E501 """Manage the members of a System Group # noqa: E501 - This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_members_post_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_members_post_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGroupMembersReq body: + :param GraphOperationSystemGroupMember body: :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'body', '_date', 'authorization', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'body', '_date', 'authorization', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -370,14 +204,6 @@ def graph_system_group_members_post_with_http_info(self, group_id, content_type, if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_members_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_members_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_members_post`") # noqa: E501 collection_formats = {} @@ -388,10 +214,6 @@ def graph_system_group_members_post_with_http_info(self, group_id, content_type, query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if '_date' in params: header_params['Date'] = params['_date'] # noqa: E501 if 'authorization' in params: @@ -405,10 +227,6 @@ def graph_system_group_members_post_with_http_info(self, group_id, content_type, body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -432,59 +250,55 @@ def graph_system_group_members_post_with_http_info(self, group_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_membership(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_membership(self, group_id, **kwargs): # noqa: E501 """List the System Group's membership # noqa: E501 This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_membership(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_membership(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param str x_org_id: + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_membership_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_membership_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_membership_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_membership_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the System Group's membership # noqa: E501 This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_membership_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_membership_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param str x_org_id: + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'skip', 'sort', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'limit', 'skip', 'sort', 'filter', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -503,17 +317,7 @@ def graph_system_group_membership_with_http_info(self, group_id, content_type, a if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_membership`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_membership`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_membership`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_membership`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -533,10 +337,6 @@ def graph_system_group_membership_with_http_info(self, group_id, content_type, a collection_formats['filter'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -548,10 +348,6 @@ def graph_system_group_membership_with_http_info(self, group_id, content_type, a header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 diff --git a/jcapiv2/jcapiv2/api/system_groups_api.py b/jcapiv2/jcapiv2/api/system_groups_api.py index 468abc0..a9b2030 100644 --- a/jcapiv2/jcapiv2/api/system_groups_api.py +++ b/jcapiv2/jcapiv2/api/system_groups_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,57 +32,53 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def graph_system_group_associations_list(self, group_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_system_group_associations_list(self, group_id, targets, **kwargs): # noqa: E501 """List the associations of a System Group # noqa: E501 This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_associations_list(group_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_system_group_associations_list(group_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"system_group\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_associations_list_with_http_info(group_id, content_type, accept, targets, **kwargs) # noqa: E501 + return self.graph_system_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_associations_list_with_http_info(group_id, content_type, accept, targets, **kwargs) # noqa: E501 + (data) = self.graph_system_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 return data - def graph_system_group_associations_list_with_http_info(self, group_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_system_group_associations_list_with_http_info(self, group_id, targets, **kwargs): # noqa: E501 """List the associations of a System Group # noqa: E501 This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_associations_list_with_http_info(group_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_system_group_associations_list_with_http_info(group_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"system_group\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -102,21 +97,11 @@ def graph_system_group_associations_list_with_http_info(self, group_id, content_ if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_associations_list`") # noqa: E501 # verify the required parameter 'targets' is set if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_system_group_associations_list`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -124,19 +109,15 @@ def graph_system_group_associations_list_with_http_info(self, group_id, content_ path_params['group_id'] = params['group_id'] # noqa: E501 query_params = [] + if 'targets' in params: + query_params.append(('targets', params['targets'])) # noqa: E501 + collection_formats['targets'] = 'csv' # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 - if 'targets' in params: - query_params.append(('targets', params['targets'])) # noqa: E501 - collection_formats['targets'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -148,10 +129,6 @@ def graph_system_group_associations_list_with_http_info(self, group_id, content_ header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -171,53 +148,49 @@ def graph_system_group_associations_list_with_http_info(self, group_id, content_ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_associations_post(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_associations_post(self, group_id, **kwargs): # noqa: E501 """Manage the associations of a System Group # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_associations_post(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_associations_post(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGroupGraphManagementReq body: - :param str x_org_id: + :param GraphOperationSystemGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_associations_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_associations_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_associations_post_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_associations_post_with_http_info(self, group_id, **kwargs): # noqa: E501 """Manage the associations of a System Group # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_associations_post_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_associations_post_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGroupGraphManagementReq body: - :param str x_org_id: + :param GraphOperationSystemGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -236,14 +209,6 @@ def graph_system_group_associations_post_with_http_info(self, group_id, content_ if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_associations_post`") # noqa: E501 collection_formats = {} @@ -254,10 +219,6 @@ def graph_system_group_associations_post_with_http_info(self, group_id, content_ query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -267,10 +228,6 @@ def graph_system_group_associations_post_with_http_info(self, group_id, content_ body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -294,59 +251,51 @@ def graph_system_group_associations_post_with_http_info(self, group_id, content_ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_member_of(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the System Group's parents # noqa: E501 + def graph_system_group_members_list(self, group_id, **kwargs): # noqa: E501 + """List the members of a System Group # noqa: E501 - This endpoint returns all System Groups a System Group is a member of. This endpoint is not yet public as we haven't completed the code yet. # noqa: E501 + This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_member_of(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_members_list(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: - :return: list[GraphObjectWithPaths] + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_member_of_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_member_of_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_member_of_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the System Group's parents # noqa: E501 + def graph_system_group_members_list_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the members of a System Group # noqa: E501 - This endpoint returns all System Groups a System Group is a member of. This endpoint is not yet public as we haven't completed the code yet. # noqa: E501 + This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_member_of_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_members_list_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: - :return: list[GraphObjectWithPaths] + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -357,25 +306,15 @@ def graph_system_group_member_of_with_http_info(self, group_id, content_type, ac if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method graph_system_group_member_of" % key + " to method graph_system_group_members_list" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'group_id' is set if ('group_id' not in params or params['group_id'] is None): - raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_member_of`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_member_of`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_member_of`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_member_of`, must be a value greater than or equal to `0`") # noqa: E501 + raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_members_list`") # noqa: E501 + collection_formats = {} path_params = {} @@ -383,22 +322,12 @@ def graph_system_group_member_of_with_http_info(self, group_id, content_type, ac path_params['group_id'] = params['group_id'] # noqa: E501 query_params = [] - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 - collection_formats['filter'] = 'csv' # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -410,22 +339,18 @@ def graph_system_group_member_of_with_http_info(self, group_id, content_type, ac header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systemgroups/{group_id}/memberof', 'GET', + '/systemgroups/{group_id}/members', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[GraphObjectWithPaths]', # noqa: E501 + response_type='list[GraphConnection]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -433,55 +358,53 @@ def graph_system_group_member_of_with_http_info(self, group_id, content_type, ac _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_members_list(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the members of a System Group # noqa: E501 + def graph_system_group_members_post(self, group_id, **kwargs): # noqa: E501 + """Manage the members of a System Group # noqa: E501 - This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_members_list(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_members_post(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param str x_org_id: - :return: list[GraphConnection] + :param GraphOperationSystemGroupMember body: + :param str _date: Current date header for the System Context API + :param str authorization: Authorization header for the System Context API + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_members_list_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_members_list_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_members_list_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the members of a System Group # noqa: E501 + def graph_system_group_members_post_with_http_info(self, group_id, **kwargs): # noqa: E501 + """Manage the members of a System Group # noqa: E501 - This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_members_list_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_members_post_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param str x_org_id: - :return: list[GraphConnection] + :param GraphOperationSystemGroupMember body: + :param str _date: Current date header for the System Context API + :param str authorization: Authorization header for the System Context API + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'body', '_date', 'authorization', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -492,25 +415,15 @@ def graph_system_group_members_list_with_http_info(self, group_id, content_type, if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method graph_system_group_members_list" % key + " to method graph_system_group_members_post" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'group_id' is set if ('group_id' not in params or params['group_id'] is None): - raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_members_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_members_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_members_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_members_list`, must be a value greater than or equal to `0`") # noqa: E501 + raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_members_post`") # noqa: E501 + collection_formats = {} path_params = {} @@ -518,16 +431,12 @@ def graph_system_group_members_list_with_http_info(self, group_id, content_type, path_params['group_id'] = params['group_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 + if '_date' in params: + header_params['Date'] = params['_date'] # noqa: E501 + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -535,10 +444,8 @@ def graph_system_group_members_list_with_http_info(self, group_id, content_type, local_var_files = {} body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - + if 'body' in params: + body_params = params['body'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -547,14 +454,14 @@ def graph_system_group_members_list_with_http_info(self, group_id, content_type, auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systemgroups/{group_id}/members', 'GET', + '/systemgroups/{group_id}/members', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[GraphConnection]', # noqa: E501 + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -562,57 +469,55 @@ def graph_system_group_members_list_with_http_info(self, group_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_members_post(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """Manage the members of a System Group # noqa: E501 + def graph_system_group_membership(self, group_id, **kwargs): # noqa: E501 + """List the System Group's membership # noqa: E501 - This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` # noqa: E501 + This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_members_post(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_membership(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGroupMembersReq body: - :param str _date: Current date header for the System Context API - :param str authorization: Authorization header for the System Context API - :param str x_org_id: - :return: None + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_members_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_members_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_members_post_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """Manage the members of a System Group # noqa: E501 + def graph_system_group_membership_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the System Group's membership # noqa: E501 - This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` # noqa: E501 + This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_members_post_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_membership_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGroupMembersReq body: - :param str _date: Current date header for the System Context API - :param str authorization: Authorization header for the System Context API - :param str x_org_id: - :return: None + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'body', '_date', 'authorization', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'limit', 'skip', 'sort', 'filter', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -623,22 +528,14 @@ def graph_system_group_members_post_with_http_info(self, group_id, content_type, if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method graph_system_group_members_post" % key + " to method graph_system_group_membership" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'group_id' is set if ('group_id' not in params or params['group_id'] is None): - raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_members_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_members_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_members_post`") # noqa: E501 + raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_membership`") # noqa: E501 collection_formats = {} @@ -647,16 +544,18 @@ def graph_system_group_members_post_with_http_info(self, group_id, content_type, path_params['group_id'] = params['group_id'] # noqa: E501 query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - if '_date' in params: - header_params['Date'] = params['_date'] # noqa: E501 - if 'authorization' in params: - header_params['Authorization'] = params['authorization'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -664,28 +563,22 @@ def graph_system_group_members_post_with_http_info(self, group_id, content_type, local_var_files = {} body_params = None - if 'body' in params: - body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systemgroups/{group_id}/members', 'POST', + '/systemgroups/{group_id}/membership', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='list[GraphObjectWithPaths]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -693,59 +586,53 @@ def graph_system_group_members_post_with_http_info(self, group_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_membership(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the System Group's membership # noqa: E501 + def graph_system_group_traverse_policy(self, group_id, **kwargs): # noqa: E501 + """List the Policies bound to a System Group # noqa: E501 - This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_membership(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_policy(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param str x_org_id: + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_membership_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_traverse_policy_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_membership_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_traverse_policy_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_membership_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the System Group's membership # noqa: E501 + def graph_system_group_traverse_policy_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the Policies bound to a System Group # noqa: E501 - This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_membership_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_policy_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param str x_org_id: + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'skip', 'sort', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -756,25 +643,15 @@ def graph_system_group_membership_with_http_info(self, group_id, content_type, a if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method graph_system_group_membership" % key + " to method graph_system_group_traverse_policy" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'group_id' is set if ('group_id' not in params or params['group_id'] is None): - raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_membership`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_membership`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_membership`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_membership`, must be a value greater than or equal to `0`") # noqa: E501 + raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_traverse_policy`") # noqa: E501 + collection_formats = {} path_params = {} @@ -786,18 +663,11 @@ def graph_system_group_membership_with_http_info(self, group_id, content_type, a query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -809,15 +679,11 @@ def graph_system_group_membership_with_http_info(self, group_id, content_type, a header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systemgroups/{group_id}/membership', 'GET', + '/systemgroups/{group_id}/policies', 'GET', path_params, query_params, header_params, @@ -832,57 +698,53 @@ def graph_system_group_membership_with_http_info(self, group_id, content_type, a _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_traverse_policy(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the Policies bound to a System Group # noqa: E501 + def graph_system_group_traverse_policy_group(self, group_id, **kwargs): # noqa: E501 + """List the Policy Groups bound to a System Group # noqa: E501 - This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return all Policy Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_policy(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_policy_group(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_traverse_policy_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_traverse_policy_group_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_traverse_policy_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_traverse_policy_group_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_traverse_policy_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the Policies bound to a System Group # noqa: E501 + def graph_system_group_traverse_policy_group_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List the Policy Groups bound to a System Group # noqa: E501 - This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint will return all Policy Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_policy_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_policy_group_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -893,25 +755,15 @@ def graph_system_group_traverse_policy_with_http_info(self, group_id, content_ty if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method graph_system_group_traverse_policy" % key + " to method graph_system_group_traverse_policy_group" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'group_id' is set if ('group_id' not in params or params['group_id'] is None): - raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_traverse_policy`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_traverse_policy`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_traverse_policy`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_traverse_policy`, must be a value greater than or equal to `0`") # noqa: E501 + raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_traverse_policy_group`") # noqa: E501 + collection_formats = {} path_params = {} @@ -930,10 +782,6 @@ def graph_system_group_traverse_policy_with_http_info(self, group_id, content_ty header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -943,15 +791,11 @@ def graph_system_group_traverse_policy_with_http_info(self, group_id, content_ty header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systemgroups/{group_id}/policies', 'GET', + '/systemgroups/{group_id}/policygroups', 'GET', path_params, query_params, header_params, @@ -966,57 +810,53 @@ def graph_system_group_traverse_policy_with_http_info(self, group_id, content_ty _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_traverse_user(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_user(self, group_id, **kwargs): # noqa: E501 """List the Users bound to a System Group # noqa: E501 This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_user(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_user(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_traverse_user_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_traverse_user_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_traverse_user_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_traverse_user_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_traverse_user_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_user_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Users bound to a System Group # noqa: E501 This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_user_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_user_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1035,17 +875,7 @@ def graph_system_group_traverse_user_with_http_info(self, group_id, content_type if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_traverse_user`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_traverse_user`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_traverse_user`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_traverse_user`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1064,10 +894,6 @@ def graph_system_group_traverse_user_with_http_info(self, group_id, content_type header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1077,10 +903,6 @@ def graph_system_group_traverse_user_with_http_info(self, group_id, content_type header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1100,57 +922,53 @@ def graph_system_group_traverse_user_with_http_info(self, group_id, content_type _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_group_traverse_user_group(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_user_group(self, group_id, **kwargs): # noqa: E501 """List the User Groups bound to a System Group # noqa: E501 This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_user_group(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_user_group(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_group_traverse_user_group_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_group_traverse_user_group_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_group_traverse_user_group_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_group_traverse_user_group_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_system_group_traverse_user_group_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_group_traverse_user_group_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the User Groups bound to a System Group # noqa: E501 This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_group_traverse_user_group_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_group_traverse_user_group_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1169,17 +987,7 @@ def graph_system_group_traverse_user_group_with_http_info(self, group_id, conten if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_system_group_traverse_user_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_group_traverse_user_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_group_traverse_user_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_group_traverse_user_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1198,10 +1006,6 @@ def graph_system_group_traverse_user_group_with_http_info(self, group_id, conten header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1211,10 +1015,6 @@ def graph_system_group_traverse_user_group_with_http_info(self, group_id, conten header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1234,51 +1034,47 @@ def graph_system_group_traverse_user_group_with_http_info(self, group_id, conten _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def groups_system_delete(self, id, content_type, accept, **kwargs): # noqa: E501 + def groups_system_delete(self, id, **kwargs): # noqa: E501 """Delete a System Group # noqa: E501 This endpoint allows you to delete a System Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_system_delete(id, content_type, accept, async_req=True) + >>> thread = api.groups_system_delete(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: None + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: SystemGroup If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.groups_system_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.groups_system_delete_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.groups_system_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.groups_system_delete_with_http_info(id, **kwargs) # noqa: E501 return data - def groups_system_delete_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def groups_system_delete_with_http_info(self, id, **kwargs): # noqa: E501 """Delete a System Group # noqa: E501 This endpoint allows you to delete a System Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_system_delete_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.groups_system_delete_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: None + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: SystemGroup If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1297,14 +1093,6 @@ def groups_system_delete_with_http_info(self, id, content_type, accept, **kwargs if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `groups_system_delete`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `groups_system_delete`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `groups_system_delete`") # noqa: E501 collection_formats = {} @@ -1315,10 +1103,6 @@ def groups_system_delete_with_http_info(self, id, content_type, accept, **kwargs query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1330,10 +1114,6 @@ def groups_system_delete_with_http_info(self, id, content_type, accept, **kwargs header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1345,7 +1125,7 @@ def groups_system_delete_with_http_info(self, id, content_type, accept, **kwargs body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='SystemGroup', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1353,51 +1133,47 @@ def groups_system_delete_with_http_info(self, id, content_type, accept, **kwargs _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def groups_system_get(self, id, content_type, accept, **kwargs): # noqa: E501 + def groups_system_get(self, id, **kwargs): # noqa: E501 """View an individual System Group details # noqa: E501 This endpoint returns the details of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_system_get(id, content_type, accept, async_req=True) + >>> thread = api.groups_system_get(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: SystemGroup If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.groups_system_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.groups_system_get_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.groups_system_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.groups_system_get_with_http_info(id, **kwargs) # noqa: E501 return data - def groups_system_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def groups_system_get_with_http_info(self, id, **kwargs): # noqa: E501 """View an individual System Group details # noqa: E501 This endpoint returns the details of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_system_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.groups_system_get_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: SystemGroup If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1416,14 +1192,6 @@ def groups_system_get_with_http_info(self, id, content_type, accept, **kwargs): if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `groups_system_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `groups_system_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `groups_system_get`") # noqa: E501 collection_formats = {} @@ -1434,10 +1202,6 @@ def groups_system_get_with_http_info(self, id, content_type, accept, **kwargs): query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1449,10 +1213,6 @@ def groups_system_get_with_http_info(self, id, content_type, accept, **kwargs): header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1472,59 +1232,55 @@ def groups_system_get_with_http_info(self, id, content_type, accept, **kwargs): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def groups_system_list(self, content_type, accept, **kwargs): # noqa: E501 + def groups_system_list(self, **kwargs): # noqa: E501 """List all System Groups # noqa: E501 This endpoint returns all System Groups. Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_system_list(content_type, accept, async_req=True) + >>> thread = api.groups_system_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[SystemGroup] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.groups_system_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.groups_system_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.groups_system_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.groups_system_list_with_http_info(**kwargs) # noqa: E501 return data - def groups_system_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def groups_system_list_with_http_info(self, **kwargs): # noqa: E501 """List all System Groups # noqa: E501 This endpoint returns all System Groups. Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_system_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.groups_system_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[SystemGroup] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1539,17 +1295,7 @@ def groups_system_list_with_http_info(self, content_type, accept, **kwargs): # ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `groups_system_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `groups_system_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `groups_system_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1570,10 +1316,6 @@ def groups_system_list_with_http_info(self, content_type, accept, **kwargs): # collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1585,10 +1327,6 @@ def groups_system_list_with_http_info(self, content_type, accept, **kwargs): # header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1608,174 +1346,47 @@ def groups_system_list_with_http_info(self, content_type, accept, **kwargs): # _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def groups_system_patch(self, id, content_type, accept, **kwargs): # noqa: E501 - """Partial update a System Group # noqa: E501 - - We have hidden PATCH on the systemgroups and usergroups for now; we don't have that implemented correctly yet, people should use PUT until we do a true PATCH operation. #### Sample Request ``` https://console.jumpcloud.com/api/v2/systemgroups/{id} ``` # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_system_patch(id, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGroupData body: - :param str x_org_id: - :return: SystemGroup - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.groups_system_patch_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 - else: - (data) = self.groups_system_patch_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 - return data - - def groups_system_patch_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """Partial update a System Group # noqa: E501 - - We have hidden PATCH on the systemgroups and usergroups for now; we don't have that implemented correctly yet, people should use PUT until we do a true PATCH operation. #### Sample Request ``` https://console.jumpcloud.com/api/v2/systemgroups/{id} ``` # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_system_patch_with_http_info(id, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGroupData body: - :param str x_org_id: - :return: SystemGroup - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method groups_system_patch" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `groups_system_patch`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `groups_system_patch`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `groups_system_patch`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - if 'x_org_id' in params: - header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/systemgroups/{id}', 'PATCH', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='SystemGroup', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def groups_system_post(self, content_type, accept, **kwargs): # noqa: E501 + def groups_system_post(self, **kwargs): # noqa: E501 """Create a new System Group # noqa: E501 - This endpoint allows you to create a new System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` # noqa: E501 + This endpoint allows you to create a new System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_system_post(content_type, accept, async_req=True) + >>> thread = api.groups_system_post(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param SystemGroupData body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: SystemGroup If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.groups_system_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.groups_system_post_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.groups_system_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.groups_system_post_with_http_info(**kwargs) # noqa: E501 return data - def groups_system_post_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def groups_system_post_with_http_info(self, **kwargs): # noqa: E501 """Create a new System Group # noqa: E501 - This endpoint allows you to create a new System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` # noqa: E501 + This endpoint allows you to create a new System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_system_post_with_http_info(content_type, accept, async_req=True) + >>> thread = api.groups_system_post_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param SystemGroupData body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: SystemGroup If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1790,14 +1401,6 @@ def groups_system_post_with_http_info(self, content_type, accept, **kwargs): # ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `groups_system_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `groups_system_post`") # noqa: E501 collection_formats = {} @@ -1806,10 +1409,6 @@ def groups_system_post_with_http_info(self, content_type, accept, **kwargs): # query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1846,53 +1445,49 @@ def groups_system_post_with_http_info(self, content_type, accept, **kwargs): # _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def groups_system_put(self, id, content_type, accept, **kwargs): # noqa: E501 + def groups_system_put(self, id, **kwargs): # noqa: E501 """Update a System Group # noqa: E501 - This endpoint allows you to do a full update of the System Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Name_Update\" }' ``` # noqa: E501 + This endpoint allows you to do a full update of the System Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Name_Update\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_system_put(id, content_type, accept, async_req=True) + >>> thread = api.groups_system_put(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param SystemGroupData body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: SystemGroup If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.groups_system_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.groups_system_put_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.groups_system_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.groups_system_put_with_http_info(id, **kwargs) # noqa: E501 return data - def groups_system_put_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def groups_system_put_with_http_info(self, id, **kwargs): # noqa: E501 """Update a System Group # noqa: E501 - This endpoint allows you to do a full update of the System Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Name_Update\" }' ``` # noqa: E501 + This endpoint allows you to do a full update of the System Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Name_Update\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_system_put_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.groups_system_put_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the System Group. (required) - :param str content_type: (required) - :param str accept: (required) :param SystemGroupData body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: SystemGroup If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1911,14 +1506,6 @@ def groups_system_put_with_http_info(self, id, content_type, accept, **kwargs): if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `groups_system_put`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `groups_system_put`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `groups_system_put`") # noqa: E501 collection_formats = {} @@ -1929,10 +1516,6 @@ def groups_system_put_with_http_info(self, id, content_type, accept, **kwargs): query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 diff --git a/jcapiv2/jcapiv2/api/system_insights_api.py b/jcapiv2/jcapiv2/api/system_insights_api.py index 5070f3b..a50e976 100644 --- a/jcapiv2/jcapiv2/api/system_insights_api.py +++ b/jcapiv2/jcapiv2/api/system_insights_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,55 +32,53 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def systeminsights_list_apps(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Apps # noqa: E501 + def systeminsights_list_alf(self, **kwargs): # noqa: E501 + """List System Insights ALF # noqa: E501 - Valid filter fields are `system_id` and `bundle_name`. # noqa: E501 + Valid filter fields are `system_id` and `global_state`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_apps(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_alf(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsApps] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param int limit: + :return: list[SystemInsightsAlf] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_apps_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_alf_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_apps_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_alf_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_apps_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Apps # noqa: E501 + def systeminsights_list_alf_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights ALF # noqa: E501 - Valid filter fields are `system_id` and `bundle_name`. # noqa: E501 + Valid filter fields are `system_id` and `global_state`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_apps_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_alf_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsApps] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param int limit: + :return: list[SystemInsightsAlf] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['x_org_id', 'filter', 'skip', 'sort', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -92,45 +89,30 @@ def systeminsights_list_apps_with_http_info(self, content_type, accept, **kwargs if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_apps" % key + " to method systeminsights_list_alf" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_apps`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_apps`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_apps`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_apps`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_apps`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -140,22 +122,18 @@ def systeminsights_list_apps_with_http_info(self, content_type, accept, **kwargs header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/apps', 'GET', + '/systeminsights/alf', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsApps]', # noqa: E501 + response_type='list[SystemInsightsAlf]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -163,55 +141,53 @@ def systeminsights_list_apps_with_http_info(self, content_type, accept, **kwargs _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_battery(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Battery # noqa: E501 + def systeminsights_list_alf_exceptions(self, **kwargs): # noqa: E501 + """List System Insights ALF Exceptions # noqa: E501 - Valid filter fields are `system_id` and `health`. # noqa: E501 + Valid filter fields are `system_id` and `state`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_battery(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_alf_exceptions(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsBattery] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param int limit: + :return: list[SystemInsightsAlfExceptions] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_battery_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_alf_exceptions_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_battery_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_alf_exceptions_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_battery_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Battery # noqa: E501 + def systeminsights_list_alf_exceptions_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights ALF Exceptions # noqa: E501 - Valid filter fields are `system_id` and `health`. # noqa: E501 + Valid filter fields are `system_id` and `state`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_battery_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_alf_exceptions_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsBattery] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param int limit: + :return: list[SystemInsightsAlfExceptions] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['x_org_id', 'filter', 'skip', 'sort', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -222,45 +198,30 @@ def systeminsights_list_battery_with_http_info(self, content_type, accept, **kwa if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_battery" % key + " to method systeminsights_list_alf_exceptions" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_battery`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_battery`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_battery`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_battery`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_battery`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -270,22 +231,18 @@ def systeminsights_list_battery_with_http_info(self, content_type, accept, **kwa header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/battery', 'GET', + '/systeminsights/alf_exceptions', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsBattery]', # noqa: E501 + response_type='list[SystemInsightsAlfExceptions]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -293,55 +250,53 @@ def systeminsights_list_battery_with_http_info(self, content_type, accept, **kwa _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_bitlocker_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Bitlocker Info # noqa: E501 + def systeminsights_list_alf_explicit_auths(self, **kwargs): # noqa: E501 + """List System Insights ALF Explicit Authentications # noqa: E501 - Valid filter fields are `system_id` and `protection_status`. # noqa: E501 + Valid filter fields are `system_id` and `process`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_bitlocker_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_alf_explicit_auths(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsBitlockerInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param int limit: + :return: list[SystemInsightsAlfExplicitAuths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_bitlocker_info_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_alf_explicit_auths_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_bitlocker_info_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_alf_explicit_auths_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_bitlocker_info_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Bitlocker Info # noqa: E501 + def systeminsights_list_alf_explicit_auths_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights ALF Explicit Authentications # noqa: E501 - Valid filter fields are `system_id` and `protection_status`. # noqa: E501 + Valid filter fields are `system_id` and `process`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_bitlocker_info_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_alf_explicit_auths_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsBitlockerInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param int limit: + :return: list[SystemInsightsAlfExplicitAuths] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['x_org_id', 'filter', 'skip', 'sort', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -352,45 +307,30 @@ def systeminsights_list_bitlocker_info_with_http_info(self, content_type, accept if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_bitlocker_info" % key + " to method systeminsights_list_alf_explicit_auths" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_bitlocker_info`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_bitlocker_info`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_bitlocker_info`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_bitlocker_info`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_bitlocker_info`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -400,22 +340,18 @@ def systeminsights_list_bitlocker_info_with_http_info(self, content_type, accept header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/bitlocker_info', 'GET', + '/systeminsights/alf_explicit_auths', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsBitlockerInfo]', # noqa: E501 + response_type='list[SystemInsightsAlfExplicitAuths]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -423,55 +359,53 @@ def systeminsights_list_bitlocker_info_with_http_info(self, content_type, accept _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_browser_plugins(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Browser Plugins # noqa: E501 + def systeminsights_list_appcompat_shims(self, **kwargs): # noqa: E501 + """List System Insights Application Compatibility Shims # noqa: E501 - Valid filter fields are `system_id` and `name`. # noqa: E501 + Valid filter fields are `system_id` and `enabled`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_browser_plugins(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_appcompat_shims(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsBrowserPlugins] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsAppcompatShims] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_browser_plugins_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_appcompat_shims_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_browser_plugins_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_appcompat_shims_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_browser_plugins_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Browser Plugins # noqa: E501 + def systeminsights_list_appcompat_shims_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Application Compatibility Shims # noqa: E501 - Valid filter fields are `system_id` and `name`. # noqa: E501 + Valid filter fields are `system_id` and `enabled`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_browser_plugins_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_appcompat_shims_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsBrowserPlugins] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsAppcompatShims] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -482,45 +416,30 @@ def systeminsights_list_browser_plugins_with_http_info(self, content_type, accep if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_browser_plugins" % key + " to method systeminsights_list_appcompat_shims" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_browser_plugins`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_browser_plugins`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_browser_plugins`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_browser_plugins`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_browser_plugins`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -530,22 +449,18 @@ def systeminsights_list_browser_plugins_with_http_info(self, content_type, accep header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/browser_plugins', 'GET', + '/systeminsights/appcompat_shims', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsBrowserPlugins]', # noqa: E501 + response_type='list[SystemInsightsAppcompatShims]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -553,55 +468,53 @@ def systeminsights_list_browser_plugins_with_http_info(self, content_type, accep _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_chrome_extensions(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Chrome Extensions # noqa: E501 + def systeminsights_list_apps(self, **kwargs): # noqa: E501 + """List System Insights Apps # noqa: E501 - Valid filter fields are `system_id` and `name`. # noqa: E501 + Lists all apps for macOS devices. For Windows devices, use [List System Insights Programs](#operation/systeminsights_list_programs). Valid filter fields are `system_id` and `bundle_name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_chrome_extensions(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_apps(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsChromeExtensions] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsApps] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_chrome_extensions_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_apps_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_chrome_extensions_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_apps_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_chrome_extensions_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Chrome Extensions # noqa: E501 + def systeminsights_list_apps_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Apps # noqa: E501 - Valid filter fields are `system_id` and `name`. # noqa: E501 + Lists all apps for macOS devices. For Windows devices, use [List System Insights Programs](#operation/systeminsights_list_programs). Valid filter fields are `system_id` and `bundle_name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_chrome_extensions_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_apps_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsChromeExtensions] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsApps] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -612,45 +525,30 @@ def systeminsights_list_chrome_extensions_with_http_info(self, content_type, acc if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_chrome_extensions" % key + " to method systeminsights_list_apps" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_chrome_extensions`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_chrome_extensions`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_chrome_extensions`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_chrome_extensions`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_chrome_extensions`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -660,22 +558,18 @@ def systeminsights_list_chrome_extensions_with_http_info(self, content_type, acc header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/chrome_extensions', 'GET', + '/systeminsights/apps', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsChromeExtensions]', # noqa: E501 + response_type='list[SystemInsightsApps]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -683,55 +577,53 @@ def systeminsights_list_chrome_extensions_with_http_info(self, content_type, acc _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_crashes(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Crashes # noqa: E501 + def systeminsights_list_authorized_keys(self, **kwargs): # noqa: E501 + """List System Insights Authorized Keys # noqa: E501 - Valid filter fields are `system_id` and `identifier`. # noqa: E501 + Valid filter fields are `system_id` and `uid`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_crashes(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_authorized_keys(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsCrashes] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsAuthorizedKeys] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_crashes_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_authorized_keys_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_crashes_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_authorized_keys_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_crashes_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Crashes # noqa: E501 + def systeminsights_list_authorized_keys_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Authorized Keys # noqa: E501 - Valid filter fields are `system_id` and `identifier`. # noqa: E501 + Valid filter fields are `system_id` and `uid`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_crashes_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_authorized_keys_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsCrashes] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsAuthorizedKeys] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -742,45 +634,30 @@ def systeminsights_list_crashes_with_http_info(self, content_type, accept, **kwa if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_crashes" % key + " to method systeminsights_list_authorized_keys" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_crashes`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_crashes`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_crashes`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_crashes`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_crashes`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -790,22 +667,18 @@ def systeminsights_list_crashes_with_http_info(self, content_type, accept, **kwa header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/crashes', 'GET', + '/systeminsights/authorized_keys', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsCrashes]', # noqa: E501 + response_type='list[SystemInsightsAuthorizedKeys]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -813,55 +686,53 @@ def systeminsights_list_crashes_with_http_info(self, content_type, accept, **kwa _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_disk_encryption(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Disk Encryption # noqa: E501 + def systeminsights_list_azure_instance_metadata(self, **kwargs): # noqa: E501 + """List System Insights Azure Instance Metadata # noqa: E501 - Valid filter fields are `system_id` and `encryption_status`. # noqa: E501 + Valid filter fields are `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_disk_encryption(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_azure_instance_metadata(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsDiskEncryption] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsAzureInstanceMetadata] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_disk_encryption_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_azure_instance_metadata_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_disk_encryption_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_azure_instance_metadata_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_disk_encryption_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Disk Encryption # noqa: E501 + def systeminsights_list_azure_instance_metadata_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Azure Instance Metadata # noqa: E501 - Valid filter fields are `system_id` and `encryption_status`. # noqa: E501 + Valid filter fields are `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_disk_encryption_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_azure_instance_metadata_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsDiskEncryption] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsAzureInstanceMetadata] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -872,45 +743,30 @@ def systeminsights_list_disk_encryption_with_http_info(self, content_type, accep if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_disk_encryption" % key + " to method systeminsights_list_azure_instance_metadata" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_disk_encryption`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_disk_encryption`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_disk_encryption`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_disk_encryption`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_disk_encryption`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -920,22 +776,18 @@ def systeminsights_list_disk_encryption_with_http_info(self, content_type, accep header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 + auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/systeminsights/disk_encryption', 'GET', + '/systeminsights/azure_instance_metadata', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsDiskEncryption]', # noqa: E501 + response_type='list[SystemInsightsAzureInstanceMetadata]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -943,55 +795,53 @@ def systeminsights_list_disk_encryption_with_http_info(self, content_type, accep _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_disk_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Disk Info # noqa: E501 + def systeminsights_list_azure_instance_tags(self, **kwargs): # noqa: E501 + """List System Insights Azure Instance Tags # noqa: E501 - Valid filter fields are `system_id` and `disk_index`. # noqa: E501 + Valid filter fields are `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_disk_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_azure_instance_tags(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsDiskInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsAzureInstanceTags] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_disk_info_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_azure_instance_tags_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_disk_info_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_azure_instance_tags_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_disk_info_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Disk Info # noqa: E501 + def systeminsights_list_azure_instance_tags_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Azure Instance Tags # noqa: E501 - Valid filter fields are `system_id` and `disk_index`. # noqa: E501 + Valid filter fields are `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_disk_info_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_azure_instance_tags_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsDiskInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsAzureInstanceTags] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1002,45 +852,30 @@ def systeminsights_list_disk_info_with_http_info(self, content_type, accept, **k if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_disk_info" % key + " to method systeminsights_list_azure_instance_tags" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_disk_info`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_disk_info`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_disk_info`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_disk_info`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_disk_info`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1050,22 +885,18 @@ def systeminsights_list_disk_info_with_http_info(self, content_type, accept, **k header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 + auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/systeminsights/disk_info', 'GET', + '/systeminsights/azure_instance_tags', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsDiskInfo]', # noqa: E501 + response_type='list[SystemInsightsAzureInstanceTags]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1073,55 +904,53 @@ def systeminsights_list_disk_info_with_http_info(self, content_type, accept, **k _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_etc_hosts(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Etc Hosts # noqa: E501 + def systeminsights_list_battery(self, **kwargs): # noqa: E501 + """List System Insights Battery # noqa: E501 - Valid filter fields are `system_id` and `address`. # noqa: E501 + Valid filter fields are `system_id` and `health`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_etc_hosts(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_battery(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsEtcHosts] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsBattery] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_etc_hosts_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_battery_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_etc_hosts_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_battery_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_etc_hosts_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Etc Hosts # noqa: E501 + def systeminsights_list_battery_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Battery # noqa: E501 - Valid filter fields are `system_id` and `address`. # noqa: E501 + Valid filter fields are `system_id` and `health`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_etc_hosts_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_battery_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsEtcHosts] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsBattery] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1132,45 +961,30 @@ def systeminsights_list_etc_hosts_with_http_info(self, content_type, accept, **k if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_etc_hosts" % key + " to method systeminsights_list_battery" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_etc_hosts`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_etc_hosts`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_etc_hosts`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_etc_hosts`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_etc_hosts`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1180,22 +994,18 @@ def systeminsights_list_etc_hosts_with_http_info(self, content_type, accept, **k header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/etc_hosts', 'GET', + '/systeminsights/battery', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsEtcHosts]', # noqa: E501 + response_type='list[SystemInsightsBattery]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1203,55 +1013,53 @@ def systeminsights_list_etc_hosts_with_http_info(self, content_type, accept, **k _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_firefox_addons(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Firefox Addons # noqa: E501 + def systeminsights_list_bitlocker_info(self, **kwargs): # noqa: E501 + """List System Insights Bitlocker Info # noqa: E501 - Valid filter fields are `system_id` and `name`. # noqa: E501 + Valid filter fields are `system_id` and `protection_status`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_firefox_addons(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_bitlocker_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsFirefoxAddons] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsBitlockerInfo] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_firefox_addons_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_bitlocker_info_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_firefox_addons_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_bitlocker_info_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_firefox_addons_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Firefox Addons # noqa: E501 + def systeminsights_list_bitlocker_info_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Bitlocker Info # noqa: E501 - Valid filter fields are `system_id` and `name`. # noqa: E501 + Valid filter fields are `system_id` and `protection_status`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_firefox_addons_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_bitlocker_info_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsFirefoxAddons] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsBitlockerInfo] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1262,45 +1070,30 @@ def systeminsights_list_firefox_addons_with_http_info(self, content_type, accept if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_firefox_addons" % key + " to method systeminsights_list_bitlocker_info" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_firefox_addons`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_firefox_addons`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_firefox_addons`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_firefox_addons`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_firefox_addons`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1310,22 +1103,18 @@ def systeminsights_list_firefox_addons_with_http_info(self, content_type, accept header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/firefox_addons', 'GET', + '/systeminsights/bitlocker_info', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsFirefoxAddons]', # noqa: E501 + response_type='list[SystemInsightsBitlockerInfo]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1333,55 +1122,53 @@ def systeminsights_list_firefox_addons_with_http_info(self, content_type, accept _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_groups(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Groups # noqa: E501 + def systeminsights_list_browser_plugins(self, **kwargs): # noqa: E501 + """List System Insights Browser Plugins # noqa: E501 - Valid filter fields are `system_id` and `groupname`. # noqa: E501 + Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_groups(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_browser_plugins(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsGroups] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsBrowserPlugins] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_groups_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_browser_plugins_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_groups_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_browser_plugins_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_groups_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Groups # noqa: E501 + def systeminsights_list_browser_plugins_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Browser Plugins # noqa: E501 - Valid filter fields are `system_id` and `groupname`. # noqa: E501 + Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_groups_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_browser_plugins_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsGroups] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsBrowserPlugins] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1392,45 +1179,30 @@ def systeminsights_list_groups_with_http_info(self, content_type, accept, **kwar if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_groups" % key + " to method systeminsights_list_browser_plugins" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_groups`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_groups`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_groups`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_groups`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_groups`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1440,22 +1212,18 @@ def systeminsights_list_groups_with_http_info(self, content_type, accept, **kwar header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/groups', 'GET', + '/systeminsights/browser_plugins', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsGroups]', # noqa: E501 + response_type='list[SystemInsightsBrowserPlugins]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1463,55 +1231,53 @@ def systeminsights_list_groups_with_http_info(self, content_type, accept, **kwar _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_ie_extensions(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights IE Extensions # noqa: E501 + def systeminsights_list_certificates(self, **kwargs): # noqa: E501 + """List System Insights Certificates # noqa: E501 - Valid filter fields are `system_id` and `name`. # noqa: E501 + Valid filter fields are `system_id` and `common_name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_ie_extensions(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_certificates(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsIeExtensions] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` Note: You can only filter by `system_id` and `common_name` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsCertificates] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_ie_extensions_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_certificates_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_ie_extensions_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_certificates_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_ie_extensions_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights IE Extensions # noqa: E501 + def systeminsights_list_certificates_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Certificates # noqa: E501 - Valid filter fields are `system_id` and `name`. # noqa: E501 + Valid filter fields are `system_id` and `common_name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_ie_extensions_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_certificates_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsIeExtensions] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` Note: You can only filter by `system_id` and `common_name` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsCertificates] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1522,45 +1288,30 @@ def systeminsights_list_ie_extensions_with_http_info(self, content_type, accept, if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_ie_extensions" % key + " to method systeminsights_list_certificates" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_ie_extensions`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_ie_extensions`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_ie_extensions`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_ie_extensions`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_ie_extensions`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1570,22 +1321,18 @@ def systeminsights_list_ie_extensions_with_http_info(self, content_type, accept, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/ie_extensions', 'GET', + '/systeminsights/certificates', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsIeExtensions]', # noqa: E501 + response_type='list[SystemInsightsCertificates]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1593,55 +1340,53 @@ def systeminsights_list_ie_extensions_with_http_info(self, content_type, accept, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_interface_addresses(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Interface Addresses # noqa: E501 + def systeminsights_list_chassis_info(self, **kwargs): # noqa: E501 + """List System Insights Chassis Info # noqa: E501 - Valid filter fields are `system_id` and `address`. # noqa: E501 + Valid filter fields are `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_interface_addresses(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_chassis_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsInterfaceAddresses] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsChassisInfo] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_interface_addresses_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_chassis_info_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_interface_addresses_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_chassis_info_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_interface_addresses_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Interface Addresses # noqa: E501 + def systeminsights_list_chassis_info_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Chassis Info # noqa: E501 - Valid filter fields are `system_id` and `address`. # noqa: E501 + Valid filter fields are `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_interface_addresses_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_chassis_info_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsInterfaceAddresses] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsChassisInfo] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1652,45 +1397,30 @@ def systeminsights_list_interface_addresses_with_http_info(self, content_type, a if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_interface_addresses" % key + " to method systeminsights_list_chassis_info" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_interface_addresses`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_interface_addresses`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_interface_addresses`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_interface_addresses`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_interface_addresses`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1700,22 +1430,18 @@ def systeminsights_list_interface_addresses_with_http_info(self, content_type, a header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 + auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/systeminsights/interface_addresses', 'GET', + '/systeminsights/chassis_info', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsInterfaceAddresses]', # noqa: E501 + response_type='list[SystemInsightsChassisInfo]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1723,55 +1449,53 @@ def systeminsights_list_interface_addresses_with_http_info(self, content_type, a _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_kernel_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Kernel Info # noqa: E501 + def systeminsights_list_chrome_extensions(self, **kwargs): # noqa: E501 + """List System Insights Chrome Extensions # noqa: E501 - Valid filter fields are `system_id` and `version`. # noqa: E501 + Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_kernel_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_chrome_extensions(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsKernelInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsChromeExtensions] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_kernel_info_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_chrome_extensions_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_kernel_info_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_chrome_extensions_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_kernel_info_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Kernel Info # noqa: E501 + def systeminsights_list_chrome_extensions_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Chrome Extensions # noqa: E501 - Valid filter fields are `system_id` and `version`. # noqa: E501 + Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_kernel_info_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_chrome_extensions_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsKernelInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsChromeExtensions] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1782,45 +1506,30 @@ def systeminsights_list_kernel_info_with_http_info(self, content_type, accept, * if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_kernel_info" % key + " to method systeminsights_list_chrome_extensions" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_kernel_info`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_kernel_info`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_kernel_info`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_kernel_info`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_kernel_info`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1830,22 +1539,18 @@ def systeminsights_list_kernel_info_with_http_info(self, content_type, accept, * header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/kernel_info', 'GET', + '/systeminsights/chrome_extensions', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsKernelInfo]', # noqa: E501 + response_type='list[SystemInsightsChromeExtensions]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1853,55 +1558,53 @@ def systeminsights_list_kernel_info_with_http_info(self, content_type, accept, * _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_launchd(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Launchd # noqa: E501 + def systeminsights_list_connectivity(self, **kwargs): # noqa: E501 + """List System Insights Connectivity # noqa: E501 - Valid filter fields are `system_id` and `name`. # noqa: E501 + The only valid filter field is `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_launchd(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_connectivity(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsLaunchd] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsConnectivity] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_launchd_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_connectivity_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_launchd_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_connectivity_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_launchd_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Launchd # noqa: E501 + def systeminsights_list_connectivity_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Connectivity # noqa: E501 - Valid filter fields are `system_id` and `name`. # noqa: E501 + The only valid filter field is `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_launchd_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_connectivity_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsLaunchd] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsConnectivity] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1912,45 +1615,30 @@ def systeminsights_list_launchd_with_http_info(self, content_type, accept, **kwa if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_launchd" % key + " to method systeminsights_list_connectivity" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_launchd`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_launchd`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_launchd`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_launchd`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_launchd`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1960,22 +1648,18 @@ def systeminsights_list_launchd_with_http_info(self, content_type, accept, **kwa header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/launchd', 'GET', + '/systeminsights/connectivity', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsLaunchd]', # noqa: E501 + response_type='list[SystemInsightsConnectivity]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1983,55 +1667,53 @@ def systeminsights_list_launchd_with_http_info(self, content_type, accept, **kwa _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_logged_in_users(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Logged-In Users # noqa: E501 + def systeminsights_list_crashes(self, **kwargs): # noqa: E501 + """List System Insights Crashes # noqa: E501 - Valid filter fields are `system_id` and `user`. # noqa: E501 + Valid filter fields are `system_id` and `identifier`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_logged_in_users(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_crashes(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsLoggedInUsers] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsCrashes] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_logged_in_users_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_crashes_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_logged_in_users_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_crashes_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_logged_in_users_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Logged-In Users # noqa: E501 + def systeminsights_list_crashes_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Crashes # noqa: E501 - Valid filter fields are `system_id` and `user`. # noqa: E501 + Valid filter fields are `system_id` and `identifier`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_logged_in_users_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_crashes_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsLoggedInUsers] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsCrashes] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2042,45 +1724,30 @@ def systeminsights_list_logged_in_users_with_http_info(self, content_type, accep if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_logged_in_users" % key + " to method systeminsights_list_crashes" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_logged_in_users`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_logged_in_users`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_logged_in_users`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_logged_in_users`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_logged_in_users`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -2090,22 +1757,18 @@ def systeminsights_list_logged_in_users_with_http_info(self, content_type, accep header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/logged_in_users', 'GET', + '/systeminsights/crashes', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsLoggedInUsers]', # noqa: E501 + response_type='list[SystemInsightsCrashes]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2113,55 +1776,53 @@ def systeminsights_list_logged_in_users_with_http_info(self, content_type, accep _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_logical_drives(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Logical Drives # noqa: E501 + def systeminsights_list_cups_destinations(self, **kwargs): # noqa: E501 + """List System Insights CUPS Destinations # noqa: E501 - Valid filter fields are `system_id` and `device_id`. # noqa: E501 + Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_logical_drives(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_cups_destinations(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsLogicalDrvies] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsCupsDestinations] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_logical_drives_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_cups_destinations_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_logical_drives_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_cups_destinations_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_logical_drives_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Logical Drives # noqa: E501 + def systeminsights_list_cups_destinations_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights CUPS Destinations # noqa: E501 - Valid filter fields are `system_id` and `device_id`. # noqa: E501 + Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_logical_drives_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_cups_destinations_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsLogicalDrvies] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsCupsDestinations] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2172,45 +1833,30 @@ def systeminsights_list_logical_drives_with_http_info(self, content_type, accept if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_logical_drives" % key + " to method systeminsights_list_cups_destinations" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_logical_drives`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_logical_drives`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_logical_drives`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_logical_drives`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_logical_drives`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -2220,22 +1866,18 @@ def systeminsights_list_logical_drives_with_http_info(self, content_type, accept header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/logical_drives', 'GET', + '/systeminsights/cups_destinations', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsLogicalDrvies]', # noqa: E501 + response_type='list[SystemInsightsCupsDestinations]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2243,55 +1885,53 @@ def systeminsights_list_logical_drives_with_http_info(self, content_type, accept _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_mounts(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Mounts # noqa: E501 + def systeminsights_list_disk_encryption(self, **kwargs): # noqa: E501 + """List System Insights Disk Encryption # noqa: E501 - Valid filter fields are `system_id` and `path`. # noqa: E501 + Valid filter fields are `system_id` and `encryption_status`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_mounts(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_disk_encryption(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsMounts] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsDiskEncryption] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_mounts_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_disk_encryption_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_mounts_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_disk_encryption_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_mounts_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Mounts # noqa: E501 + def systeminsights_list_disk_encryption_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Disk Encryption # noqa: E501 - Valid filter fields are `system_id` and `path`. # noqa: E501 + Valid filter fields are `system_id` and `encryption_status`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_mounts_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_disk_encryption_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsMounts] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsDiskEncryption] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2302,45 +1942,30 @@ def systeminsights_list_mounts_with_http_info(self, content_type, accept, **kwar if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_mounts" % key + " to method systeminsights_list_disk_encryption" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_mounts`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_mounts`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_mounts`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_mounts`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_mounts`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -2350,22 +1975,18 @@ def systeminsights_list_mounts_with_http_info(self, content_type, accept, **kwar header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/mounts', 'GET', + '/systeminsights/disk_encryption', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsMounts]', # noqa: E501 + response_type='list[SystemInsightsDiskEncryption]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2373,55 +1994,53 @@ def systeminsights_list_mounts_with_http_info(self, content_type, accept, **kwar _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_os_version(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights OS Version # noqa: E501 + def systeminsights_list_disk_info(self, **kwargs): # noqa: E501 + """List System Insights Disk Info # noqa: E501 - Valid filter fields are `system_id` and `version`. # noqa: E501 + Valid filter fields are `system_id` and `disk_index`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_os_version(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_disk_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsOsVersion] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsDiskInfo] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_os_version_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_disk_info_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_os_version_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_disk_info_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_os_version_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights OS Version # noqa: E501 + def systeminsights_list_disk_info_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Disk Info # noqa: E501 - Valid filter fields are `system_id` and `version`. # noqa: E501 + Valid filter fields are `system_id` and `disk_index`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_os_version_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_disk_info_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsOsVersion] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsDiskInfo] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2432,45 +2051,30 @@ def systeminsights_list_os_version_with_http_info(self, content_type, accept, ** if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_os_version" % key + " to method systeminsights_list_disk_info" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_os_version`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_os_version`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_os_version`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_os_version`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_os_version`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -2480,22 +2084,18 @@ def systeminsights_list_os_version_with_http_info(self, content_type, accept, ** header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/os_version', 'GET', + '/systeminsights/disk_info', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsOsVersion]', # noqa: E501 + response_type='list[SystemInsightsDiskInfo]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2503,55 +2103,53 @@ def systeminsights_list_os_version_with_http_info(self, content_type, accept, ** _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_patches(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Patches # noqa: E501 + def systeminsights_list_dns_resolvers(self, **kwargs): # noqa: E501 + """List System Insights DNS Resolvers # noqa: E501 - Valid filter fields are `system_id` and `hotfix_id`. # noqa: E501 + Valid filter fields are `system_id` and `type`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_patches(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_dns_resolvers(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsPatches] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsDnsResolvers] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_patches_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_dns_resolvers_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_patches_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_dns_resolvers_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_patches_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Patches # noqa: E501 + def systeminsights_list_dns_resolvers_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights DNS Resolvers # noqa: E501 - Valid filter fields are `system_id` and `hotfix_id`. # noqa: E501 + Valid filter fields are `system_id` and `type`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_patches_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_dns_resolvers_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsPatches] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsDnsResolvers] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2562,45 +2160,30 @@ def systeminsights_list_patches_with_http_info(self, content_type, accept, **kwa if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_patches" % key + " to method systeminsights_list_dns_resolvers" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_patches`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_patches`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_patches`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_patches`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_patches`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -2610,22 +2193,18 @@ def systeminsights_list_patches_with_http_info(self, content_type, accept, **kwa header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/patches', 'GET', + '/systeminsights/dns_resolvers', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsPatches]', # noqa: E501 + response_type='list[SystemInsightsDnsResolvers]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2633,55 +2212,53 @@ def systeminsights_list_patches_with_http_info(self, content_type, accept, **kwa _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_programs(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Programs # noqa: E501 + def systeminsights_list_etc_hosts(self, **kwargs): # noqa: E501 + """List System Insights Etc Hosts # noqa: E501 - Valid filter fields are `system_id` and `name`. # noqa: E501 + Valid filter fields are `system_id` and `address`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_programs(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_etc_hosts(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsPrograms] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsEtcHosts] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_programs_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_etc_hosts_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_programs_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_etc_hosts_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_programs_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Programs # noqa: E501 + def systeminsights_list_etc_hosts_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Etc Hosts # noqa: E501 - Valid filter fields are `system_id` and `name`. # noqa: E501 + Valid filter fields are `system_id` and `address`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_programs_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_etc_hosts_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsPrograms] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsEtcHosts] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2692,45 +2269,30 @@ def systeminsights_list_programs_with_http_info(self, content_type, accept, **kw if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_programs" % key + " to method systeminsights_list_etc_hosts" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_programs`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_programs`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_programs`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_programs`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_programs`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -2740,22 +2302,18 @@ def systeminsights_list_programs_with_http_info(self, content_type, accept, **kw header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/programs', 'GET', + '/systeminsights/etc_hosts', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsPrograms]', # noqa: E501 + response_type='list[SystemInsightsEtcHosts]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2763,55 +2321,53 @@ def systeminsights_list_programs_with_http_info(self, content_type, accept, **kw _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_safari_extensions(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Safari Extensions # noqa: E501 + def systeminsights_list_firefox_addons(self, **kwargs): # noqa: E501 + """List System Insights Firefox Addons # noqa: E501 Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_safari_extensions(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_firefox_addons(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsSafariExtensions] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsFirefoxAddons] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_safari_extensions_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_firefox_addons_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_safari_extensions_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_firefox_addons_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_safari_extensions_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Safari Extensions # noqa: E501 + def systeminsights_list_firefox_addons_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Firefox Addons # noqa: E501 Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_safari_extensions_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_firefox_addons_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsSafariExtensions] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsFirefoxAddons] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2822,45 +2378,30 @@ def systeminsights_list_safari_extensions_with_http_info(self, content_type, acc if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_safari_extensions" % key + " to method systeminsights_list_firefox_addons" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_safari_extensions`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_safari_extensions`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_safari_extensions`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_safari_extensions`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_safari_extensions`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -2870,22 +2411,18 @@ def systeminsights_list_safari_extensions_with_http_info(self, content_type, acc header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/safari_extensions', 'GET', + '/systeminsights/firefox_addons', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsSafariExtensions]', # noqa: E501 + response_type='list[SystemInsightsFirefoxAddons]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2893,57 +2430,53 @@ def systeminsights_list_safari_extensions_with_http_info(self, content_type, acc _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_apps(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Apps # noqa: E501 + def systeminsights_list_groups(self, **kwargs): # noqa: E501 + """List System Insights Groups # noqa: E501 - Valid filter fields are `bundle_name`. # noqa: E501 + Valid filter fields are `system_id` and `groupname`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_apps(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_groups(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsApps] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsGroups] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_apps_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_groups_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_apps_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_groups_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_apps_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Apps # noqa: E501 + def systeminsights_list_groups_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Groups # noqa: E501 - Valid filter fields are `bundle_name`. # noqa: E501 + Valid filter fields are `system_id` and `groupname`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_apps_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_groups_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsApps] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsGroups] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2954,51 +2487,139 @@ def systeminsights_list_system_apps_with_http_info(self, system_id, content_type if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_apps" % key + " to method systeminsights_list_groups" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_apps`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_apps`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_apps`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_apps`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_apps`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_apps`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systeminsights/groups', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SystemInsightsGroups]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def systeminsights_list_ie_extensions(self, **kwargs): # noqa: E501 + """List System Insights IE Extensions # noqa: E501 + + Valid filter fields are `system_id` and `name`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_ie_extensions(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsIeExtensions] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.systeminsights_list_ie_extensions_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.systeminsights_list_ie_extensions_with_http_info(**kwargs) # noqa: E501 + return data + + def systeminsights_list_ie_extensions_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights IE Extensions # noqa: E501 + + Valid filter fields are `system_id` and `name`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_ie_extensions_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsIeExtensions] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method systeminsights_list_ie_extensions" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -3008,22 +2629,999 @@ def systeminsights_list_system_apps_with_http_info(self, system_id, content_type header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systeminsights/ie_extensions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SystemInsightsIeExtensions]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def systeminsights_list_interface_addresses(self, **kwargs): # noqa: E501 + """List System Insights Interface Addresses # noqa: E501 + + Valid filter fields are `system_id` and `address`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_interface_addresses(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsInterfaceAddresses] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.systeminsights_list_interface_addresses_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.systeminsights_list_interface_addresses_with_http_info(**kwargs) # noqa: E501 + return data + + def systeminsights_list_interface_addresses_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Interface Addresses # noqa: E501 + + Valid filter fields are `system_id` and `address`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_interface_addresses_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsInterfaceAddresses] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method systeminsights_list_interface_addresses" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/apps', 'GET', + '/systeminsights/interface_addresses', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsApps]', # noqa: E501 + response_type='list[SystemInsightsInterfaceAddresses]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def systeminsights_list_interface_details(self, **kwargs): # noqa: E501 + """List System Insights Interface Details # noqa: E501 + + Valid filter fields are `system_id` and `interface`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_interface_details(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsInterfaceDetails] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.systeminsights_list_interface_details_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.systeminsights_list_interface_details_with_http_info(**kwargs) # noqa: E501 + return data + + def systeminsights_list_interface_details_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Interface Details # noqa: E501 + + Valid filter fields are `system_id` and `interface`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_interface_details_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsInterfaceDetails] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method systeminsights_list_interface_details" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systeminsights/interface_details', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SystemInsightsInterfaceDetails]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def systeminsights_list_kernel_info(self, **kwargs): # noqa: E501 + """List System Insights Kernel Info # noqa: E501 + + Valid filter fields are `system_id` and `version`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_kernel_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsKernelInfo] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.systeminsights_list_kernel_info_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.systeminsights_list_kernel_info_with_http_info(**kwargs) # noqa: E501 + return data + + def systeminsights_list_kernel_info_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Kernel Info # noqa: E501 + + Valid filter fields are `system_id` and `version`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_kernel_info_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsKernelInfo] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method systeminsights_list_kernel_info" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systeminsights/kernel_info', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SystemInsightsKernelInfo]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def systeminsights_list_launchd(self, **kwargs): # noqa: E501 + """List System Insights Launchd # noqa: E501 + + Valid filter fields are `system_id` and `name`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_launchd(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsLaunchd] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.systeminsights_list_launchd_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.systeminsights_list_launchd_with_http_info(**kwargs) # noqa: E501 + return data + + def systeminsights_list_launchd_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Launchd # noqa: E501 + + Valid filter fields are `system_id` and `name`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_launchd_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsLaunchd] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method systeminsights_list_launchd" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systeminsights/launchd', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SystemInsightsLaunchd]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def systeminsights_list_linux_packages(self, **kwargs): # noqa: E501 + """List System Insights Linux Packages # noqa: E501 + + Lists all programs for Linux devices. For macOS devices, use [List System Insights System Apps](#operation/systeminsights_list_apps). For windows devices, use [List System Insights System Apps](#operation/systeminsights_list_programs). Valid filter fields are `name` and `package_format`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_linux_packages(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsLinuxPackages] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.systeminsights_list_linux_packages_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.systeminsights_list_linux_packages_with_http_info(**kwargs) # noqa: E501 + return data + + def systeminsights_list_linux_packages_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Linux Packages # noqa: E501 + + Lists all programs for Linux devices. For macOS devices, use [List System Insights System Apps](#operation/systeminsights_list_apps). For windows devices, use [List System Insights System Apps](#operation/systeminsights_list_programs). Valid filter fields are `name` and `package_format`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_linux_packages_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsLinuxPackages] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method systeminsights_list_linux_packages" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systeminsights/linux_packages', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SystemInsightsLinuxPackages]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def systeminsights_list_logged_in_users(self, **kwargs): # noqa: E501 + """List System Insights Logged-In Users # noqa: E501 + + Valid filter fields are `system_id` and `user`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_logged_in_users(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsLoggedInUsers] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.systeminsights_list_logged_in_users_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.systeminsights_list_logged_in_users_with_http_info(**kwargs) # noqa: E501 + return data + + def systeminsights_list_logged_in_users_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Logged-In Users # noqa: E501 + + Valid filter fields are `system_id` and `user`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_logged_in_users_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsLoggedInUsers] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method systeminsights_list_logged_in_users" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systeminsights/logged_in_users', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SystemInsightsLoggedInUsers]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def systeminsights_list_logical_drives(self, **kwargs): # noqa: E501 + """List System Insights Logical Drives # noqa: E501 + + Valid filter fields are `system_id` and `device_id`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_logical_drives(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsLogicalDrives] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.systeminsights_list_logical_drives_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.systeminsights_list_logical_drives_with_http_info(**kwargs) # noqa: E501 + return data + + def systeminsights_list_logical_drives_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Logical Drives # noqa: E501 + + Valid filter fields are `system_id` and `device_id`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_logical_drives_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsLogicalDrives] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method systeminsights_list_logical_drives" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systeminsights/logical_drives', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SystemInsightsLogicalDrives]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def systeminsights_list_managed_policies(self, **kwargs): # noqa: E501 + """List System Insights Managed Policies # noqa: E501 + + Valid filter fields are `system_id` and `domain`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_managed_policies(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsManagedPolicies] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.systeminsights_list_managed_policies_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.systeminsights_list_managed_policies_with_http_info(**kwargs) # noqa: E501 + return data + + def systeminsights_list_managed_policies_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Managed Policies # noqa: E501 + + Valid filter fields are `system_id` and `domain`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_managed_policies_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsManagedPolicies] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method systeminsights_list_managed_policies" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systeminsights/managed_policies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SystemInsightsManagedPolicies]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def systeminsights_list_mounts(self, **kwargs): # noqa: E501 + """List System Insights Mounts # noqa: E501 + + Valid filter fields are `system_id` and `path`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_mounts(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsMounts] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.systeminsights_list_mounts_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.systeminsights_list_mounts_with_http_info(**kwargs) # noqa: E501 + return data + + def systeminsights_list_mounts_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Mounts # noqa: E501 + + Valid filter fields are `system_id` and `path`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systeminsights_list_mounts_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsMounts] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method systeminsights_list_mounts" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systeminsights/mounts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SystemInsightsMounts]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -3031,57 +3629,53 @@ def systeminsights_list_system_apps_with_http_info(self, system_id, content_type _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_bitlocker_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Bitlocker Info # noqa: E501 + def systeminsights_list_os_version(self, **kwargs): # noqa: E501 + """List System Insights OS Version # noqa: E501 - Valid filter fields are `protection_status`. # noqa: E501 + Valid filter fields are `system_id` and `version`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_bitlocker_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_os_version(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsBitlockerInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsOsVersion] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_bitlocker_info_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_os_version_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_bitlocker_info_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_os_version_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_bitlocker_info_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Bitlocker Info # noqa: E501 + def systeminsights_list_os_version_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights OS Version # noqa: E501 - Valid filter fields are `protection_status`. # noqa: E501 + Valid filter fields are `system_id` and `version`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_bitlocker_info_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_os_version_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsBitlockerInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsOsVersion] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3092,51 +3686,30 @@ def systeminsights_list_system_bitlocker_info_with_http_info(self, system_id, co if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_bitlocker_info" % key + " to method systeminsights_list_os_version" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_bitlocker_info`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_bitlocker_info`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_bitlocker_info`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_bitlocker_info`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_bitlocker_info`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_bitlocker_info`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -3146,22 +3719,18 @@ def systeminsights_list_system_bitlocker_info_with_http_info(self, system_id, co header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/bitlocker_info', 'GET', + '/systeminsights/os_version', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsBitlockerInfo]', # noqa: E501 + response_type='list[SystemInsightsOsVersion]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -3169,57 +3738,53 @@ def systeminsights_list_system_bitlocker_info_with_http_info(self, system_id, co _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_browser_plugins(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Browser Plugins # noqa: E501 + def systeminsights_list_patches(self, **kwargs): # noqa: E501 + """List System Insights Patches # noqa: E501 - Valid filter fields are `name`. # noqa: E501 + Valid filter fields are `system_id` and `hotfix_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_browser_plugins(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_patches(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsBrowserPlugins] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsPatches] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_browser_plugins_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_patches_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_browser_plugins_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_patches_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_browser_plugins_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Browser Plugins # noqa: E501 + def systeminsights_list_patches_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Patches # noqa: E501 - Valid filter fields are `name`. # noqa: E501 + Valid filter fields are `system_id` and `hotfix_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_browser_plugins_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_patches_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsBrowserPlugins] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsPatches] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3230,51 +3795,30 @@ def systeminsights_list_system_browser_plugins_with_http_info(self, system_id, c if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_browser_plugins" % key + " to method systeminsights_list_patches" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_browser_plugins`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_browser_plugins`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_browser_plugins`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_browser_plugins`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_browser_plugins`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_browser_plugins`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -3284,22 +3828,18 @@ def systeminsights_list_system_browser_plugins_with_http_info(self, system_id, c header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/browser_plugins', 'GET', + '/systeminsights/patches', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsBrowserPlugins]', # noqa: E501 + response_type='list[SystemInsightsPatches]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -3307,57 +3847,53 @@ def systeminsights_list_system_browser_plugins_with_http_info(self, system_id, c _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_chrome_extensions(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Chrome Extensions # noqa: E501 + def systeminsights_list_programs(self, **kwargs): # noqa: E501 + """List System Insights Programs # noqa: E501 - Valid filter fields are `name`. # noqa: E501 + Lists all programs for Windows devices. For macOS devices, use [List System Insights Apps](#operation/systeminsights_list_apps). Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_chrome_extensions(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_programs(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsChromeExtensions] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsPrograms] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_chrome_extensions_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_programs_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_chrome_extensions_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_programs_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_chrome_extensions_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Chrome Extensions # noqa: E501 + def systeminsights_list_programs_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Programs # noqa: E501 - Valid filter fields are `name`. # noqa: E501 + Lists all programs for Windows devices. For macOS devices, use [List System Insights Apps](#operation/systeminsights_list_apps). Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_chrome_extensions_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_programs_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsChromeExtensions] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsPrograms] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3368,51 +3904,30 @@ def systeminsights_list_system_chrome_extensions_with_http_info(self, system_id, if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_chrome_extensions" % key + " to method systeminsights_list_programs" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_chrome_extensions`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_chrome_extensions`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_chrome_extensions`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_chrome_extensions`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_chrome_extensions`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_chrome_extensions`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -3422,22 +3937,18 @@ def systeminsights_list_system_chrome_extensions_with_http_info(self, system_id, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/chrome_extensions', 'GET', + '/systeminsights/programs', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsChromeExtensions]', # noqa: E501 + response_type='list[SystemInsightsPrograms]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -3445,55 +3956,53 @@ def systeminsights_list_system_chrome_extensions_with_http_info(self, system_id, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_controls(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Control # noqa: E501 + def systeminsights_list_python_packages(self, **kwargs): # noqa: E501 + """List System Insights Python Packages # noqa: E501 Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_controls(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_python_packages(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsSystemControls] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsPythonPackages] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_controls_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_python_packages_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_controls_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_python_packages_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_controls_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Control # noqa: E501 + def systeminsights_list_python_packages_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Python Packages # noqa: E501 Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_controls_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_python_packages_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsSystemControls] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsPythonPackages] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3504,45 +4013,30 @@ def systeminsights_list_system_controls_with_http_info(self, content_type, accep if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_controls" % key + " to method systeminsights_list_python_packages" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_controls`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_controls`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_controls`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_controls`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_controls`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -3552,22 +4046,18 @@ def systeminsights_list_system_controls_with_http_info(self, content_type, accep header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/system_controls', 'GET', + '/systeminsights/python_packages', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsSystemControls]', # noqa: E501 + response_type='list[SystemInsightsPythonPackages]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -3575,57 +4065,53 @@ def systeminsights_list_system_controls_with_http_info(self, content_type, accep _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_disk_encryption(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Disk Encryption # noqa: E501 + def systeminsights_list_safari_extensions(self, **kwargs): # noqa: E501 + """List System Insights Safari Extensions # noqa: E501 - Valid filter fields are `encryption_status`. # noqa: E501 + Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_disk_encryption(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_safari_extensions(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsDiskEncryption] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsSafariExtensions] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_disk_encryption_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_safari_extensions_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_disk_encryption_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_safari_extensions_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_disk_encryption_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Disk Encryption # noqa: E501 + def systeminsights_list_safari_extensions_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Safari Extensions # noqa: E501 - Valid filter fields are `encryption_status`. # noqa: E501 + Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_disk_encryption_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_safari_extensions_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsDiskEncryption] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsSafariExtensions] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3636,51 +4122,30 @@ def systeminsights_list_system_disk_encryption_with_http_info(self, system_id, c if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_disk_encryption" % key + " to method systeminsights_list_safari_extensions" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_disk_encryption`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_disk_encryption`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_disk_encryption`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_disk_encryption`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_disk_encryption`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_disk_encryption`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -3690,22 +4155,18 @@ def systeminsights_list_system_disk_encryption_with_http_info(self, system_id, c header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/disk_encryption', 'GET', + '/systeminsights/safari_extensions', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsDiskEncryption]', # noqa: E501 + response_type='list[SystemInsightsSafariExtensions]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -3713,57 +4174,53 @@ def systeminsights_list_system_disk_encryption_with_http_info(self, system_id, c _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_disk_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Disk Info # noqa: E501 + def systeminsights_list_scheduled_tasks(self, **kwargs): # noqa: E501 + """List System Insights Scheduled Tasks # noqa: E501 - Valid filter fields are `disk_index`. # noqa: E501 + Valid filter fields are `system_id` and `enabled`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_disk_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_scheduled_tasks(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsBitlockerInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsScheduledTasks] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_disk_info_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_scheduled_tasks_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_disk_info_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_scheduled_tasks_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_disk_info_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Disk Info # noqa: E501 + def systeminsights_list_scheduled_tasks_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Scheduled Tasks # noqa: E501 - Valid filter fields are `disk_index`. # noqa: E501 + Valid filter fields are `system_id` and `enabled`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_disk_info_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_scheduled_tasks_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsBitlockerInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsScheduledTasks] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3774,51 +4231,30 @@ def systeminsights_list_system_disk_info_with_http_info(self, system_id, content if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_disk_info" % key + " to method systeminsights_list_scheduled_tasks" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_disk_info`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_disk_info`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_disk_info`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_disk_info`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_disk_info`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_disk_info`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -3828,22 +4264,18 @@ def systeminsights_list_system_disk_info_with_http_info(self, system_id, content header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/disk_info', 'GET', + '/systeminsights/scheduled_tasks', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsBitlockerInfo]', # noqa: E501 + response_type='list[SystemInsightsScheduledTasks]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -3851,57 +4283,53 @@ def systeminsights_list_system_disk_info_with_http_info(self, system_id, content _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_etc_hosts(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Etc Hosts # noqa: E501 + def systeminsights_list_secureboot(self, **kwargs): # noqa: E501 + """List System Insights Secure Boot # noqa: E501 - Valid filter fields are `address`. # noqa: E501 + Valid filter fields are `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_etc_hosts(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_secureboot(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsBitlockerInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsSecureboot] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_etc_hosts_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_secureboot_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_etc_hosts_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_secureboot_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_etc_hosts_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Etc Hosts # noqa: E501 + def systeminsights_list_secureboot_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Secure Boot # noqa: E501 - Valid filter fields are `address`. # noqa: E501 + Valid filter fields are `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_etc_hosts_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_secureboot_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsBitlockerInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsSecureboot] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3912,51 +4340,30 @@ def systeminsights_list_system_etc_hosts_with_http_info(self, system_id, content if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_etc_hosts" % key + " to method systeminsights_list_secureboot" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_etc_hosts`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_etc_hosts`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_etc_hosts`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_etc_hosts`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_etc_hosts`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_etc_hosts`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -3966,22 +4373,18 @@ def systeminsights_list_system_etc_hosts_with_http_info(self, system_id, content header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 + auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/etc_hosts', 'GET', + '/systeminsights/secureboot', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsBitlockerInfo]', # noqa: E501 + response_type='list[SystemInsightsSecureboot]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -3989,57 +4392,53 @@ def systeminsights_list_system_etc_hosts_with_http_info(self, system_id, content _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_firefox_addons(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Firefox Addons # noqa: E501 + def systeminsights_list_services(self, **kwargs): # noqa: E501 + """List System Insights Services # noqa: E501 - Valid filter fields are `name`. # noqa: E501 + Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_firefox_addons(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_services(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsFirefoxAddons] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsServices] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_firefox_addons_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_services_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_firefox_addons_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_services_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_firefox_addons_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Firefox Addons # noqa: E501 + def systeminsights_list_services_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Services # noqa: E501 - Valid filter fields are `name`. # noqa: E501 + Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_firefox_addons_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_services_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsFirefoxAddons] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsServices] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -4050,51 +4449,30 @@ def systeminsights_list_system_firefox_addons_with_http_info(self, system_id, co if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_firefox_addons" % key + " to method systeminsights_list_services" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_firefox_addons`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_firefox_addons`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_firefox_addons`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_firefox_addons`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_firefox_addons`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_firefox_addons`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -4104,22 +4482,18 @@ def systeminsights_list_system_firefox_addons_with_http_info(self, system_id, co header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/firefox_addons', 'GET', + '/systeminsights/services', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsFirefoxAddons]', # noqa: E501 + response_type='list[SystemInsightsServices]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -4127,57 +4501,53 @@ def systeminsights_list_system_firefox_addons_with_http_info(self, system_id, co _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_groups(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Groups # noqa: E501 + def systeminsights_list_shadow(self, **kwargs): # noqa: E501 + """LIst System Insights Shadow # noqa: E501 - Valid filter fields are `groupname`. # noqa: E501 + Valid filter fields are `system_id` and `username`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_groups(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_shadow(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsGroups] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsShadow] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_groups_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_shadow_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_groups_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_shadow_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_groups_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Groups # noqa: E501 + def systeminsights_list_shadow_with_http_info(self, **kwargs): # noqa: E501 + """LIst System Insights Shadow # noqa: E501 - Valid filter fields are `groupname`. # noqa: E501 + Valid filter fields are `system_id` and `username`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_groups_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_shadow_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsGroups] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsShadow] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -4188,51 +4558,30 @@ def systeminsights_list_system_groups_with_http_info(self, system_id, content_ty if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_groups" % key + " to method systeminsights_list_shadow" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_groups`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_groups`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_groups`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_groups`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_groups`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_groups`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -4242,22 +4591,18 @@ def systeminsights_list_system_groups_with_http_info(self, system_id, content_ty header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/groups', 'GET', + '/systeminsights/shadow', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsGroups]', # noqa: E501 + response_type='list[SystemInsightsShadow]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -4265,55 +4610,53 @@ def systeminsights_list_system_groups_with_http_info(self, system_id, content_ty _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Info # noqa: E501 + def systeminsights_list_shared_folders(self, **kwargs): # noqa: E501 + """List System Insights Shared Folders # noqa: E501 - Valid filter fields are `system_id` and `cpu_subtype`. # noqa: E501 + Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_shared_folders(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsSystemInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsSharedFolders] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_info_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_shared_folders_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_info_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_shared_folders_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_info_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Info # noqa: E501 + def systeminsights_list_shared_folders_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Shared Folders # noqa: E501 - Valid filter fields are `system_id` and `cpu_subtype`. # noqa: E501 + Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_info_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_shared_folders_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsSystemInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsSharedFolders] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -4324,45 +4667,30 @@ def systeminsights_list_system_info_with_http_info(self, content_type, accept, * if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_info" % key + " to method systeminsights_list_shared_folders" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_info`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_info`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_info`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_info`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_info`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -4372,22 +4700,18 @@ def systeminsights_list_system_info_with_http_info(self, content_type, accept, * header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/system_info', 'GET', + '/systeminsights/shared_folders', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsSystemInfo]', # noqa: E501 + response_type='list[SystemInsightsSharedFolders]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -4395,57 +4719,53 @@ def systeminsights_list_system_info_with_http_info(self, content_type, accept, * _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_interface_addresses(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Interface Addresses # noqa: E501 + def systeminsights_list_shared_resources(self, **kwargs): # noqa: E501 + """List System Insights Shared Resources # noqa: E501 - Valid filter fields are `address`. # noqa: E501 + Valid filter fields are `system_id` and `type`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_interface_addresses(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_shared_resources(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsInterfaceAddresses] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsSharedResources] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_interface_addresses_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_shared_resources_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_interface_addresses_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_shared_resources_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_interface_addresses_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Interface Addresses # noqa: E501 + def systeminsights_list_shared_resources_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Shared Resources # noqa: E501 - Valid filter fields are `address`. # noqa: E501 + Valid filter fields are `system_id` and `type`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_interface_addresses_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_shared_resources_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsInterfaceAddresses] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsSharedResources] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -4456,51 +4776,30 @@ def systeminsights_list_system_interface_addresses_with_http_info(self, system_i if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_interface_addresses" % key + " to method systeminsights_list_shared_resources" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_interface_addresses`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_interface_addresses`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_interface_addresses`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_interface_addresses`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_interface_addresses`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_interface_addresses`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -4510,22 +4809,18 @@ def systeminsights_list_system_interface_addresses_with_http_info(self, system_i header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 + auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/interface_addresses', 'GET', + '/systeminsights/shared_resources', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsInterfaceAddresses]', # noqa: E501 + response_type='list[SystemInsightsSharedResources]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -4533,57 +4828,53 @@ def systeminsights_list_system_interface_addresses_with_http_info(self, system_i _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_kernel_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Kernel Info # noqa: E501 + def systeminsights_list_sharing_preferences(self, **kwargs): # noqa: E501 + """List System Insights Sharing Preferences # noqa: E501 - Valid filter fields are `version`. # noqa: E501 + Only valid filed field is `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_kernel_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_sharing_preferences(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsKernelInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsSharingPreferences] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_kernel_info_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_sharing_preferences_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_kernel_info_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_sharing_preferences_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_kernel_info_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Kernel Info # noqa: E501 + def systeminsights_list_sharing_preferences_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Sharing Preferences # noqa: E501 - Valid filter fields are `version`. # noqa: E501 + Only valid filed field is `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_kernel_info_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_sharing_preferences_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsKernelInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsSharingPreferences] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -4594,51 +4885,30 @@ def systeminsights_list_system_kernel_info_with_http_info(self, system_id, conte if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_kernel_info" % key + " to method systeminsights_list_sharing_preferences" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_kernel_info`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_kernel_info`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_kernel_info`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_kernel_info`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_kernel_info`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_kernel_info`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -4648,22 +4918,18 @@ def systeminsights_list_system_kernel_info_with_http_info(self, system_id, conte header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/kernel_info', 'GET', + '/systeminsights/sharing_preferences', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsKernelInfo]', # noqa: E501 + response_type='list[SystemInsightsSharingPreferences]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -4671,57 +4937,53 @@ def systeminsights_list_system_kernel_info_with_http_info(self, system_id, conte _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_logical_drives(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Logical Drives # noqa: E501 + def systeminsights_list_sip_config(self, **kwargs): # noqa: E501 + """List System Insights SIP Config # noqa: E501 - Valid filter fields are `device_id`. # noqa: E501 + Valid filter fields are `system_id` and `enabled`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_logical_drives(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_sip_config(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsLogicalDrvies] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsSipConfig] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_logical_drives_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_sip_config_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_logical_drives_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_sip_config_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_logical_drives_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Logical Drives # noqa: E501 + def systeminsights_list_sip_config_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights SIP Config # noqa: E501 - Valid filter fields are `device_id`. # noqa: E501 + Valid filter fields are `system_id` and `enabled`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_logical_drives_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_sip_config_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsLogicalDrvies] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsSipConfig] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -4732,51 +4994,30 @@ def systeminsights_list_system_logical_drives_with_http_info(self, system_id, co if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_logical_drives" % key + " to method systeminsights_list_sip_config" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_logical_drives`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_logical_drives`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_logical_drives`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_logical_drives`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_logical_drives`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_logical_drives`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -4786,22 +5027,18 @@ def systeminsights_list_system_logical_drives_with_http_info(self, system_id, co header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/logical_drives', 'GET', + '/systeminsights/sip_config', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsLogicalDrvies]', # noqa: E501 + response_type='list[SystemInsightsSipConfig]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -4809,57 +5046,53 @@ def systeminsights_list_system_logical_drives_with_http_info(self, system_id, co _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_mounts(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Mounts # noqa: E501 + def systeminsights_list_startup_items(self, **kwargs): # noqa: E501 + """List System Insights Startup Items # noqa: E501 - Valid filter fields are `path`. # noqa: E501 + Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_mounts(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_startup_items(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsMounts] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsStartupItems] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_mounts_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_startup_items_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_mounts_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_startup_items_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_mounts_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Mounts # noqa: E501 + def systeminsights_list_startup_items_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Startup Items # noqa: E501 - Valid filter fields are `path`. # noqa: E501 + Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_mounts_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_startup_items_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsMounts] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsStartupItems] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -4870,51 +5103,30 @@ def systeminsights_list_system_mounts_with_http_info(self, system_id, content_ty if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_mounts" % key + " to method systeminsights_list_startup_items" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_mounts`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_mounts`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_mounts`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_mounts`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_mounts`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_mounts`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -4924,22 +5136,18 @@ def systeminsights_list_system_mounts_with_http_info(self, system_id, content_ty header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/mounts', 'GET', + '/systeminsights/startup_items', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsMounts]', # noqa: E501 + response_type='list[SystemInsightsStartupItems]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -4947,57 +5155,53 @@ def systeminsights_list_system_mounts_with_http_info(self, system_id, content_ty _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_os_version(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System OS Version # noqa: E501 + def systeminsights_list_system_controls(self, **kwargs): # noqa: E501 + """List System Insights System Control # noqa: E501 - Valid filter fields are `version`. # noqa: E501 + Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_os_version(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_system_controls(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsOsVersion] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` Note: You can only filter by `system_id` and `name` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsSystemControls] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_os_version_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_system_controls_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_os_version_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_system_controls_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_os_version_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System OS Version # noqa: E501 + def systeminsights_list_system_controls_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights System Control # noqa: E501 - Valid filter fields are `version`. # noqa: E501 + Valid filter fields are `system_id` and `name`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_os_version_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_system_controls_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsOsVersion] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` Note: You can only filter by `system_id` and `name` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsSystemControls] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -5008,51 +5212,30 @@ def systeminsights_list_system_os_version_with_http_info(self, system_id, conten if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_os_version" % key + " to method systeminsights_list_system_controls" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_os_version`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_os_version`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_os_version`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_os_version`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_os_version`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_os_version`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -5062,22 +5245,18 @@ def systeminsights_list_system_os_version_with_http_info(self, system_id, conten header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/os_version', 'GET', + '/systeminsights/system_controls', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsOsVersion]', # noqa: E501 + response_type='list[SystemInsightsSystemControls]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -5085,57 +5264,53 @@ def systeminsights_list_system_os_version_with_http_info(self, system_id, conten _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_patches(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Patches # noqa: E501 + def systeminsights_list_system_info(self, **kwargs): # noqa: E501 + """List System Insights System Info # noqa: E501 - Valid filter fields are `hotfix_id `. # noqa: E501 + Valid filter fields are `system_id` and `cpu_subtype`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_patches(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_system_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsPatches] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsSystemInfo] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_patches_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_system_info_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_patches_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_system_info_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_patches_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Patches # noqa: E501 + def systeminsights_list_system_info_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights System Info # noqa: E501 - Valid filter fields are `hotfix_id `. # noqa: E501 + Valid filter fields are `system_id` and `cpu_subtype`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_patches_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_system_info_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsPatches] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsSystemInfo] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -5146,51 +5321,30 @@ def systeminsights_list_system_patches_with_http_info(self, system_id, content_t if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_patches" % key + " to method systeminsights_list_system_info" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_patches`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_patches`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_patches`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_patches`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_patches`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_patches`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -5200,22 +5354,18 @@ def systeminsights_list_system_patches_with_http_info(self, system_id, content_t header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/patches', 'GET', + '/systeminsights/system_info', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsPatches]', # noqa: E501 + response_type='list[SystemInsightsSystemInfo]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -5223,57 +5373,53 @@ def systeminsights_list_system_patches_with_http_info(self, system_id, content_t _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_programs(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Programs # noqa: E501 + def systeminsights_list_tpm_info(self, **kwargs): # noqa: E501 + """List System Insights TPM Info # noqa: E501 - Valid filter fields are `name`. # noqa: E501 + Valid filter fields are `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_programs(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_tpm_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsPrograms] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsTpmInfo] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_programs_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_tpm_info_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_programs_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_tpm_info_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_programs_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Programs # noqa: E501 + def systeminsights_list_tpm_info_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights TPM Info # noqa: E501 - Valid filter fields are `name`. # noqa: E501 + Valid filter fields are `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_programs_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_tpm_info_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsPrograms] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsTpmInfo] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -5284,51 +5430,30 @@ def systeminsights_list_system_programs_with_http_info(self, system_id, content_ if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_programs" % key + " to method systeminsights_list_tpm_info" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_programs`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_programs`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_programs`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_programs`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_programs`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_programs`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -5336,24 +5461,20 @@ def systeminsights_list_system_programs_with_http_info(self, system_id, content_ body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 + ['text/html']) # noqa: E501 # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 + auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/programs', 'GET', + '/systeminsights/tpm_info', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsPrograms]', # noqa: E501 + response_type='list[SystemInsightsTpmInfo]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -5361,57 +5482,53 @@ def systeminsights_list_system_programs_with_http_info(self, system_id, content_ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_safari_extensions(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Safari Extensions # noqa: E501 + def systeminsights_list_uptime(self, **kwargs): # noqa: E501 + """List System Insights Uptime # noqa: E501 - Valid filter fields are `name`. # noqa: E501 + Valid filter fields are `system_id` and `days`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_safari_extensions(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_uptime(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsSafariExtensions] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, gte, in. e.g: Filter for single value: `filter=field:gte:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsUptime] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_safari_extensions_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_uptime_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_safari_extensions_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_uptime_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_safari_extensions_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Safari Extensions # noqa: E501 + def systeminsights_list_uptime_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Uptime # noqa: E501 - Valid filter fields are `name`. # noqa: E501 + Valid filter fields are `system_id` and `days`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_safari_extensions_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_uptime_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsSafariExtensions] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, gte, in. e.g: Filter for single value: `filter=field:gte:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsUptime] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -5422,51 +5539,30 @@ def systeminsights_list_system_safari_extensions_with_http_info(self, system_id, if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_safari_extensions" % key + " to method systeminsights_list_uptime" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_safari_extensions`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_safari_extensions`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_safari_extensions`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_safari_extensions`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_safari_extensions`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_safari_extensions`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -5476,22 +5572,18 @@ def systeminsights_list_system_safari_extensions_with_http_info(self, system_id, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/safari_extensions', 'GET', + '/systeminsights/uptime', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsSafariExtensions]', # noqa: E501 + response_type='list[SystemInsightsUptime]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -5499,57 +5591,53 @@ def systeminsights_list_system_safari_extensions_with_http_info(self, system_id, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_system_controls(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System System Controls # noqa: E501 + def systeminsights_list_usb_devices(self, **kwargs): # noqa: E501 + """List System Insights USB Devices # noqa: E501 - Valid filter fields are `name`. # noqa: E501 + Valid filter fields are `system_id` and `model`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_system_controls(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_usb_devices(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsSystemControls] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsUsbDevices] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_system_controls_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_usb_devices_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_system_controls_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_usb_devices_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_system_controls_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System System Controls # noqa: E501 + def systeminsights_list_usb_devices_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights USB Devices # noqa: E501 - Valid filter fields are `name`. # noqa: E501 + Valid filter fields are `system_id` and `model`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_system_controls_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_usb_devices_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsSystemControls] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsUsbDevices] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -5560,51 +5648,30 @@ def systeminsights_list_system_system_controls_with_http_info(self, system_id, c if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_system_controls" % key + " to method systeminsights_list_usb_devices" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_system_controls`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_system_controls`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_system_controls`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_system_controls`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_system_controls`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_system_controls`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -5614,22 +5681,18 @@ def systeminsights_list_system_system_controls_with_http_info(self, system_id, c header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/system_controls', 'GET', + '/systeminsights/usb_devices', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsSystemControls]', # noqa: E501 + response_type='list[SystemInsightsUsbDevices]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -5637,57 +5700,53 @@ def systeminsights_list_system_system_controls_with_http_info(self, system_id, c _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_system_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System System Info # noqa: E501 + def systeminsights_list_user_groups(self, **kwargs): # noqa: E501 + """List System Insights User Groups # noqa: E501 - Valid filter fields are `cpu_subtype`. # noqa: E501 + Only valid filter field is `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_system_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_user_groups(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsSystemInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsUserGroups] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_system_info_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_user_groups_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_system_info_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_user_groups_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_system_info_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System System Info # noqa: E501 + def systeminsights_list_user_groups_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights User Groups # noqa: E501 - Valid filter fields are `cpu_subtype`. # noqa: E501 + Only valid filter field is `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_system_info_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_user_groups_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsSystemInfo] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsUserGroups] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -5698,51 +5757,30 @@ def systeminsights_list_system_system_info_with_http_info(self, system_id, conte if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_system_info" % key + " to method systeminsights_list_user_groups" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_system_info`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_system_info`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_system_info`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_system_info`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_system_info`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_system_info`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -5752,22 +5790,18 @@ def systeminsights_list_system_system_info_with_http_info(self, system_id, conte header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/system_info', 'GET', + '/systeminsights/user_groups', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsSystemInfo]', # noqa: E501 + response_type='list[SystemInsightsUserGroups]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -5775,57 +5809,53 @@ def systeminsights_list_system_system_info_with_http_info(self, system_id, conte _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_uptime(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Uptime # noqa: E501 + def systeminsights_list_user_ssh_keys(self, **kwargs): # noqa: E501 + """List System Insights User SSH Keys # noqa: E501 - Valid filter fields are `days`. # noqa: E501 + Valid filter fields are `system_id` and `uid`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_uptime(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_user_ssh_keys(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsUptime] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsUserSshKeys] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_uptime_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_user_ssh_keys_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_uptime_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_user_ssh_keys_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_uptime_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Uptime # noqa: E501 + def systeminsights_list_user_ssh_keys_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights User SSH Keys # noqa: E501 - Valid filter fields are `days`. # noqa: E501 + Valid filter fields are `system_id` and `uid`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_uptime_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_user_ssh_keys_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsUptime] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param int limit: + :return: list[SystemInsightsUserSshKeys] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['x_org_id', 'skip', 'sort', 'filter', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -5836,51 +5866,30 @@ def systeminsights_list_system_uptime_with_http_info(self, system_id, content_ty if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_uptime" % key + " to method systeminsights_list_user_ssh_keys" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_uptime`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_uptime`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_uptime`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_uptime`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_uptime`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_uptime`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -5890,22 +5899,18 @@ def systeminsights_list_system_uptime_with_http_info(self, system_id, content_ty header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/uptime', 'GET', + '/systeminsights/user_ssh_keys', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsUptime]', # noqa: E501 + response_type='list[SystemInsightsUserSshKeys]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -5913,57 +5918,53 @@ def systeminsights_list_system_uptime_with_http_info(self, system_id, content_ty _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_system_users(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Users # noqa: E501 + def systeminsights_list_userassist(self, **kwargs): # noqa: E501 + """List System Insights User Assist # noqa: E501 - Valid filter fields are `username`. # noqa: E501 + Valid filter fields are `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_users(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_userassist(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsUsers] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsUserassist] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_system_users_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_userassist_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_system_users_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_userassist_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_system_users_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 - """List System Insights System Users # noqa: E501 + def systeminsights_list_userassist_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights User Assist # noqa: E501 - Valid filter fields are `username`. # noqa: E501 + Valid filter fields are `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_system_users_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_userassist_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str system_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsUsers] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsUserassist] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -5974,51 +5975,30 @@ def systeminsights_list_system_users_with_http_info(self, system_id, content_typ if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_system_users" % key + " to method systeminsights_list_userassist" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'system_id' is set - if ('system_id' not in params or - params['system_id'] is None): - raise ValueError("Missing the required parameter `system_id` when calling `systeminsights_list_system_users`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_system_users`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_system_users`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_users`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_system_users`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_system_users`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} - if 'system_id' in params: - path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -6028,22 +6008,18 @@ def systeminsights_list_system_users_with_http_info(self, system_id, content_typ header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 + auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/systeminsights/{system_id}/users', 'GET', + '/systeminsights/userassist', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsUsers]', # noqa: E501 + response_type='list[SystemInsightsUserassist]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -6051,55 +6027,53 @@ def systeminsights_list_system_users_with_http_info(self, system_id, content_typ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_uptime(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Uptime # noqa: E501 + def systeminsights_list_users(self, **kwargs): # noqa: E501 + """List System Insights Users # noqa: E501 - Valid filter fields are `system_id` and `days`. # noqa: E501 + Valid filter fields are `system_id` and `username`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_uptime(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_users(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsUptime] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsUsers] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_uptime_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_users_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_uptime_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_users_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_uptime_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Uptime # noqa: E501 + def systeminsights_list_users_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Users # noqa: E501 - Valid filter fields are `system_id` and `days`. # noqa: E501 + Valid filter fields are `system_id` and `username`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_uptime_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_users_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsUptime] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsUsers] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -6110,45 +6084,30 @@ def systeminsights_list_uptime_with_http_info(self, content_type, accept, **kwar if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_uptime" % key + " to method systeminsights_list_users" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_uptime`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_uptime`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_uptime`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_uptime`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_uptime`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -6158,22 +6117,18 @@ def systeminsights_list_uptime_with_http_info(self, content_type, accept, **kwar header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/uptime', 'GET', + '/systeminsights/users', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsUptime]', # noqa: E501 + response_type='list[SystemInsightsUsers]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -6181,55 +6136,53 @@ def systeminsights_list_uptime_with_http_info(self, content_type, accept, **kwar _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_usb_devices(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights USB Devices # noqa: E501 + def systeminsights_list_wifi_networks(self, **kwargs): # noqa: E501 + """List System Insights WiFi Networks # noqa: E501 - Valid filter fields are `system_id` and `model`. # noqa: E501 + Valid filter fields are `system_id` and `security_type`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_usb_devices(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_wifi_networks(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsUsbDevices] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsWifiNetworks] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_usb_devices_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_wifi_networks_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_usb_devices_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_wifi_networks_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_usb_devices_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights USB Devices # noqa: E501 + def systeminsights_list_wifi_networks_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights WiFi Networks # noqa: E501 - Valid filter fields are `system_id` and `model`. # noqa: E501 + Valid filter fields are `system_id` and `security_type`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_usb_devices_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_wifi_networks_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsUsbDevices] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsWifiNetworks] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -6240,45 +6193,30 @@ def systeminsights_list_usb_devices_with_http_info(self, content_type, accept, * if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_usb_devices" % key + " to method systeminsights_list_wifi_networks" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_usb_devices`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_usb_devices`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_usb_devices`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_usb_devices`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_usb_devices`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -6288,22 +6226,18 @@ def systeminsights_list_usb_devices_with_http_info(self, content_type, accept, * header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/usb_devices', 'GET', + '/systeminsights/wifi_networks', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsUsbDevices]', # noqa: E501 + response_type='list[SystemInsightsWifiNetworks]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -6311,55 +6245,53 @@ def systeminsights_list_usb_devices_with_http_info(self, content_type, accept, * _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_user_groups(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights User Groups # noqa: E501 + def systeminsights_list_wifi_status(self, **kwargs): # noqa: E501 + """List System Insights WiFi Status # noqa: E501 - Only valid filter field is `system_id`. # noqa: E501 + Valid filter fields are `system_id` and `security_type`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_user_groups(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_wifi_status(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsUserGroups] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsWifiStatus] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_user_groups_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_wifi_status_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_user_groups_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_wifi_status_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_user_groups_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights User Groups # noqa: E501 + def systeminsights_list_wifi_status_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights WiFi Status # noqa: E501 - Only valid filter field is `system_id`. # noqa: E501 + Valid filter fields are `system_id` and `security_type`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_user_groups_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_wifi_status_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsUserGroups] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsWifiStatus] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -6370,45 +6302,30 @@ def systeminsights_list_user_groups_with_http_info(self, content_type, accept, * if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_user_groups" % key + " to method systeminsights_list_wifi_status" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_user_groups`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_user_groups`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_user_groups`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_user_groups`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_user_groups`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -6418,22 +6335,18 @@ def systeminsights_list_user_groups_with_http_info(self, content_type, accept, * header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/user_groups', 'GET', + '/systeminsights/wifi_status', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsUserGroups]', # noqa: E501 + response_type='list[SystemInsightsWifiStatus]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -6441,55 +6354,53 @@ def systeminsights_list_user_groups_with_http_info(self, content_type, accept, * _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_users(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Users # noqa: E501 + def systeminsights_list_windows_security_center(self, **kwargs): # noqa: E501 + """List System Insights Windows Security Center # noqa: E501 - Valid filter fields are `system_id` and `username`. # noqa: E501 + Valid filter fields are `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_users(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_windows_security_center(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsUsers] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsWindowsSecurityCenter] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_users_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_windows_security_center_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_users_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_windows_security_center_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_users_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Users # noqa: E501 + def systeminsights_list_windows_security_center_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Windows Security Center # noqa: E501 - Valid filter fields are `system_id` and `username`. # noqa: E501 + Valid filter fields are `system_id`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_users_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_windows_security_center_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :param str x_org_id: - :return: list[SystemInsightsUsers] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsWindowsSecurityCenter] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'skip', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -6500,45 +6411,30 @@ def systeminsights_list_users_with_http_info(self, content_type, accept, **kwarg if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_users" % key + " to method systeminsights_list_windows_security_center" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_users`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_users`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_users`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_users`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_users`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -6548,22 +6444,18 @@ def systeminsights_list_users_with_http_info(self, content_type, accept, **kwarg header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 + auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/systeminsights/users', 'GET', + '/systeminsights/windows_security_center', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsUsers]', # noqa: E501 + response_type='list[SystemInsightsWindowsSecurityCenter]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -6571,55 +6463,53 @@ def systeminsights_list_users_with_http_info(self, content_type, accept, **kwarg _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def systeminsights_list_windows_crashes(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Windows Crashes # noqa: E501 + def systeminsights_list_windows_security_products(self, **kwargs): # noqa: E501 + """List System Insights Windows Security Products # noqa: E501 - Valid filter fields are `system_id` and `type`. # noqa: E501 + Valid filter fields are `system_id` and `state`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_windows_crashes(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_windows_security_products(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsWindowsCrashes] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsWindowsSecurityProducts] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.systeminsights_list_windows_crashes_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.systeminsights_list_windows_security_products_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.systeminsights_list_windows_crashes_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.systeminsights_list_windows_security_products_with_http_info(**kwargs) # noqa: E501 return data - def systeminsights_list_windows_crashes_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List System Insights Windows Crashes # noqa: E501 + def systeminsights_list_windows_security_products_with_http_info(self, **kwargs): # noqa: E501 + """List System Insights Windows Security Products # noqa: E501 - Valid filter fields are `system_id` and `type`. # noqa: E501 + Valid filter fields are `system_id` and `state`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.systeminsights_list_windows_crashes_with_http_info(content_type, accept, async_req=True) + >>> thread = api.systeminsights_list_windows_security_products_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param int limit: - :param str x_org_id: :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq - :return: list[SystemInsightsWindowsCrashes] + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + :param list[str] filter: Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: + :return: list[SystemInsightsWindowsSecurityProducts] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['skip', 'sort', 'filter', 'x_org_id', 'limit'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -6630,45 +6520,30 @@ def systeminsights_list_windows_crashes_with_http_info(self, content_type, accep if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method systeminsights_list_windows_crashes" % key + " to method systeminsights_list_windows_security_products" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `systeminsights_list_windows_crashes`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `systeminsights_list_windows_crashes`") # noqa: E501 - - if 'limit' in params and params['limit'] > 100: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_windows_crashes`, must be a value less than or equal to `100`") # noqa: E501 - if 'limit' in params and params['limit'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `limit` when calling `systeminsights_list_windows_crashes`, must be a value greater than or equal to `0`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `systeminsights_list_windows_crashes`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 if 'filter' in params: query_params.append(('filter', params['filter'])) # noqa: E501 collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -6678,22 +6553,18 @@ def systeminsights_list_windows_crashes_with_http_info(self, content_type, accep header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systeminsights/windows_crashes', 'GET', + '/systeminsights/windows_security_products', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[SystemInsightsWindowsCrashes]', # noqa: E501 + response_type='list[SystemInsightsWindowsSecurityProducts]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/jcapiv2/jcapiv2/api/systems_api.py b/jcapiv2/jcapiv2/api/systems_api.py index fc2f484..66b2784 100644 --- a/jcapiv2/jcapiv2/api/systems_api.py +++ b/jcapiv2/jcapiv2/api/systems_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,61 +32,57 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def graph_system_associations_list(self, system_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_system_associations_list(self, system_id, targets, **kwargs): # noqa: E501 """List the associations of a System # noqa: E501 This endpoint returns the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_associations_list(system_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_system_associations_list(system_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"system\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_associations_list_with_http_info(system_id, content_type, accept, targets, **kwargs) # noqa: E501 + return self.graph_system_associations_list_with_http_info(system_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_system_associations_list_with_http_info(system_id, content_type, accept, targets, **kwargs) # noqa: E501 + (data) = self.graph_system_associations_list_with_http_info(system_id, targets, **kwargs) # noqa: E501 return data - def graph_system_associations_list_with_http_info(self, system_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_system_associations_list_with_http_info(self, system_id, targets, **kwargs): # noqa: E501 """List the associations of a System # noqa: E501 This endpoint returns the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_associations_list_with_http_info(system_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_system_associations_list_with_http_info(system_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"system\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'targets', 'limit', 'skip', '_date', 'authorization', 'x_org_id'] # noqa: E501 + all_params = ['system_id', 'targets', 'limit', 'skip', '_date', 'authorization', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -106,21 +101,11 @@ def graph_system_associations_list_with_http_info(self, system_id, content_type, if ('system_id' not in params or params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `graph_system_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_associations_list`") # noqa: E501 # verify the required parameter 'targets' is set if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_system_associations_list`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -128,19 +113,15 @@ def graph_system_associations_list_with_http_info(self, system_id, content_type, path_params['system_id'] = params['system_id'] # noqa: E501 query_params = [] + if 'targets' in params: + query_params.append(('targets', params['targets'])) # noqa: E501 + collection_formats['targets'] = 'csv' # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 - if 'targets' in params: - query_params.append(('targets', params['targets'])) # noqa: E501 - collection_formats['targets'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if '_date' in params: header_params['Date'] = params['_date'] # noqa: E501 if 'authorization' in params: @@ -156,10 +137,6 @@ def graph_system_associations_list_with_http_info(self, system_id, content_type, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -179,57 +156,53 @@ def graph_system_associations_list_with_http_info(self, system_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_associations_post(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_associations_post(self, system_id, **kwargs): # noqa: E501 """Manage associations of a System # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_associations_post(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_associations_post(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGraphManagementReq body: + :param GraphOperationSystem body: :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_associations_post_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_associations_post_with_http_info(system_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_associations_post_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_associations_post_with_http_info(system_id, **kwargs) # noqa: E501 return data - def graph_system_associations_post_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_associations_post_with_http_info(self, system_id, **kwargs): # noqa: E501 """Manage associations of a System # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_associations_post_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_associations_post_with_http_info(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) - :param SystemGraphManagementReq body: + :param GraphOperationSystem body: :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'body', '_date', 'authorization', 'x_org_id'] # noqa: E501 + all_params = ['system_id', 'body', '_date', 'authorization', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -248,14 +221,6 @@ def graph_system_associations_post_with_http_info(self, system_id, content_type, if ('system_id' not in params or params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `graph_system_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_associations_post`") # noqa: E501 collection_formats = {} @@ -266,10 +231,6 @@ def graph_system_associations_post_with_http_info(self, system_id, content_type, query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if '_date' in params: header_params['Date'] = params['_date'] # noqa: E501 if 'authorization' in params: @@ -283,10 +244,6 @@ def graph_system_associations_post_with_http_info(self, system_id, content_type, body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -310,63 +267,59 @@ def graph_system_associations_post_with_http_info(self, system_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_member_of(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_member_of(self, system_id, **kwargs): # noqa: E501 """List the parent Groups of a System # noqa: E501 This endpoint returns all the System Groups a System is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_member_of(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_member_of(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_member_of_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_member_of_with_http_info(system_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_member_of_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_member_of_with_http_info(system_id, **kwargs) # noqa: E501 return data - def graph_system_member_of_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_member_of_with_http_info(self, system_id, **kwargs): # noqa: E501 """List the parent Groups of a System # noqa: E501 This endpoint returns all the System Groups a System is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_member_of_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_member_of_with_http_info(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'filter', 'limit', 'skip', '_date', 'authorization', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['system_id', 'filter', 'limit', 'skip', '_date', 'authorization', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -385,17 +338,7 @@ def graph_system_member_of_with_http_info(self, system_id, content_type, accept, if ('system_id' not in params or params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `graph_system_member_of`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_member_of`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_member_of`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_member_of`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -415,10 +358,6 @@ def graph_system_member_of_with_http_info(self, system_id, content_type, accept, collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if '_date' in params: header_params['Date'] = params['_date'] # noqa: E501 if 'authorization' in params: @@ -434,10 +373,6 @@ def graph_system_member_of_with_http_info(self, system_id, content_type, accept, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -457,57 +392,53 @@ def graph_system_member_of_with_http_info(self, system_id, content_type, accept, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_traverse_command(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_traverse_command(self, system_id, **kwargs): # noqa: E501 """List the Commands bound to a System # noqa: E501 This endpoint will return all Commands bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_traverse_command(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_traverse_command(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_traverse_command_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_traverse_command_with_http_info(system_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_traverse_command_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_traverse_command_with_http_info(system_id, **kwargs) # noqa: E501 return data - def graph_system_traverse_command_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_traverse_command_with_http_info(self, system_id, **kwargs): # noqa: E501 """List the Commands bound to a System # noqa: E501 This endpoint will return all Commands bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_traverse_command_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_traverse_command_with_http_info(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['system_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -526,17 +457,7 @@ def graph_system_traverse_command_with_http_info(self, system_id, content_type, if ('system_id' not in params or params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `graph_system_traverse_command`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_traverse_command`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_traverse_command`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_traverse_command`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -555,10 +476,6 @@ def graph_system_traverse_command_with_http_info(self, system_id, content_type, header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -568,10 +485,6 @@ def graph_system_traverse_command_with_http_info(self, system_id, content_type, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -591,57 +504,53 @@ def graph_system_traverse_command_with_http_info(self, system_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_traverse_policy(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_traverse_policy(self, system_id, **kwargs): # noqa: E501 """List the Policies bound to a System # noqa: E501 This endpoint will return all Policies bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not yet public as we have finish the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/{System_ID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_traverse_policy(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_traverse_policy(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_traverse_policy_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_traverse_policy_with_http_info(system_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_traverse_policy_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_traverse_policy_with_http_info(system_id, **kwargs) # noqa: E501 return data - def graph_system_traverse_policy_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_traverse_policy_with_http_info(self, system_id, **kwargs): # noqa: E501 """List the Policies bound to a System # noqa: E501 This endpoint will return all Policies bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not yet public as we have finish the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/{System_ID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_traverse_policy_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_traverse_policy_with_http_info(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['system_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -660,17 +569,7 @@ def graph_system_traverse_policy_with_http_info(self, system_id, content_type, a if ('system_id' not in params or params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `graph_system_traverse_policy`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_traverse_policy`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_traverse_policy`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_traverse_policy`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -689,10 +588,6 @@ def graph_system_traverse_policy_with_http_info(self, system_id, content_type, a header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -702,15 +597,131 @@ def graph_system_traverse_policy_with_http_info(self, system_id, content_type, a header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systems/{system_id}/policies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_system_traverse_policy_group(self, system_id, **kwargs): # noqa: E501 + """List the Policy Groups bound to a System # noqa: E501 + + This endpoint will return all Policy Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_system_traverse_policy_group(system_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str system_id: ObjectID of the System. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param str _date: Current date header for the System Context API + :param str authorization: Authorization header for the System Context API + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_system_traverse_policy_group_with_http_info(system_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_system_traverse_policy_group_with_http_info(system_id, **kwargs) # noqa: E501 + return data + + def graph_system_traverse_policy_group_with_http_info(self, system_id, **kwargs): # noqa: E501 + """List the Policy Groups bound to a System # noqa: E501 + + This endpoint will return all Policy Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_system_traverse_policy_group_with_http_info(system_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str system_id: ObjectID of the System. (required) + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :param str _date: Current date header for the System Context API + :param str authorization: Authorization header for the System Context API + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['system_id', 'limit', 'x_org_id', 'skip', '_date', 'authorization', 'filter'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_system_traverse_policy_group" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'system_id' is set + if ('system_id' not in params or + params['system_id'] is None): + raise ValueError("Missing the required parameter `system_id` when calling `graph_system_traverse_policy_group`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'system_id' in params: + path_params['system_id'] = params['system_id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + if '_date' in params: + header_params['Date'] = params['_date'] # noqa: E501 + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/systems/{system_id}/policies', 'GET', + '/systems/{system_id}/policygroups', 'GET', path_params, query_params, header_params, @@ -725,61 +736,57 @@ def graph_system_traverse_policy_with_http_info(self, system_id, content_type, a _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_traverse_user(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_traverse_user(self, system_id, **kwargs): # noqa: E501 """List the Users bound to a System # noqa: E501 This endpoint will return all Users bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_traverse_user(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_traverse_user(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_traverse_user_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_traverse_user_with_http_info(system_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_traverse_user_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_traverse_user_with_http_info(system_id, **kwargs) # noqa: E501 return data - def graph_system_traverse_user_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_traverse_user_with_http_info(self, system_id, **kwargs): # noqa: E501 """List the Users bound to a System # noqa: E501 This endpoint will return all Users bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_traverse_user_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_traverse_user_with_http_info(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', '_date', 'authorization', 'filter'] # noqa: E501 + all_params = ['system_id', 'limit', 'x_org_id', 'skip', '_date', 'authorization', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -798,17 +805,7 @@ def graph_system_traverse_user_with_http_info(self, system_id, content_type, acc if ('system_id' not in params or params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `graph_system_traverse_user`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_traverse_user`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_traverse_user`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_traverse_user`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -827,10 +824,6 @@ def graph_system_traverse_user_with_http_info(self, system_id, content_type, acc header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if '_date' in params: header_params['Date'] = params['_date'] # noqa: E501 if 'authorization' in params: @@ -844,10 +837,6 @@ def graph_system_traverse_user_with_http_info(self, system_id, content_type, acc header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -867,61 +856,57 @@ def graph_system_traverse_user_with_http_info(self, system_id, content_type, acc _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_system_traverse_user_group(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_traverse_user_group(self, system_id, **kwargs): # noqa: E501 """List the User Groups bound to a System # noqa: E501 This endpoint will return all User Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_traverse_user_group(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_traverse_user_group(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_system_traverse_user_group_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_system_traverse_user_group_with_http_info(system_id, **kwargs) # noqa: E501 else: - (data) = self.graph_system_traverse_user_group_with_http_info(system_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_system_traverse_user_group_with_http_info(system_id, **kwargs) # noqa: E501 return data - def graph_system_traverse_user_group_with_http_info(self, system_id, content_type, accept, **kwargs): # noqa: E501 + def graph_system_traverse_user_group_with_http_info(self, system_id, **kwargs): # noqa: E501 """List the User Groups bound to a System # noqa: E501 This endpoint will return all User Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_system_traverse_user_group_with_http_info(system_id, content_type, accept, async_req=True) + >>> thread = api.graph_system_traverse_user_group_with_http_info(system_id, async_req=True) >>> result = thread.get() :param async_req bool :param str system_id: ObjectID of the System. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. :param str _date: Current date header for the System Context API :param str authorization: Authorization header for the System Context API - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['system_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', '_date', 'authorization', 'filter'] # noqa: E501 + all_params = ['system_id', 'limit', 'x_org_id', 'skip', '_date', 'authorization', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -940,17 +925,7 @@ def graph_system_traverse_user_group_with_http_info(self, system_id, content_typ if ('system_id' not in params or params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `graph_system_traverse_user_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_system_traverse_user_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_system_traverse_user_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_system_traverse_user_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -969,10 +944,6 @@ def graph_system_traverse_user_group_with_http_info(self, system_id, content_typ header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if '_date' in params: header_params['Date'] = params['_date'] # noqa: E501 if 'authorization' in params: @@ -986,10 +957,6 @@ def graph_system_traverse_user_group_with_http_info(self, system_id, content_typ header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1020,7 +987,7 @@ def systems_get_fde_key(self, system_id, **kwargs): # noqa: E501 :param async_req bool :param str system_id: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: Systemfdekey If the method is called asynchronously, returns the request thread. @@ -1043,7 +1010,7 @@ def systems_get_fde_key_with_http_info(self, system_id, **kwargs): # noqa: E501 :param async_req bool :param str system_id: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: Systemfdekey If the method is called asynchronously, returns the request thread. @@ -1089,10 +1056,6 @@ def systems_get_fde_key_with_http_info(self, system_id, **kwargs): # noqa: E501 header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1111,3 +1074,120 @@ def systems_get_fde_key_with_http_info(self, system_id, **kwargs): # noqa: E501 _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + + def systems_list_software_apps_with_statuses(self, system_id, **kwargs): # noqa: E501 + """List the associated Software Application Statuses of a System # noqa: E501 + + This endpoint returns all the statuses of the associated Software Applications from the provided JumpCloud system ID. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{system_id}/softwareappstatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systems_list_software_apps_with_statuses(system_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str system_id: ObjectID of the System. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: list[SoftwareAppWithStatus] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.systems_list_software_apps_with_statuses_with_http_info(system_id, **kwargs) # noqa: E501 + else: + (data) = self.systems_list_software_apps_with_statuses_with_http_info(system_id, **kwargs) # noqa: E501 + return data + + def systems_list_software_apps_with_statuses_with_http_info(self, system_id, **kwargs): # noqa: E501 + """List the associated Software Application Statuses of a System # noqa: E501 + + This endpoint returns all the statuses of the associated Software Applications from the provided JumpCloud system ID. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{system_id}/softwareappstatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.systems_list_software_apps_with_statuses_with_http_info(system_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str system_id: ObjectID of the System. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :return: list[SoftwareAppWithStatus] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['system_id', 'x_org_id', 'filter', 'limit', 'skip', 'sort'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method systems_list_software_apps_with_statuses" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'system_id' is set + if ('system_id' not in params or + params['system_id'] is None): + raise ValueError("Missing the required parameter `system_id` when calling `systems_list_software_apps_with_statuses`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'system_id' in params: + path_params['system_id'] = params['system_id'] # noqa: E501 + + query_params = [] + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/systems/{system_id}/softwareappstatuses', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SoftwareAppWithStatus]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/jcapiv2/jcapiv2/api/user_group_associations_api.py b/jcapiv2/jcapiv2/api/user_group_associations_api.py index 71e6fa7..3c61a02 100644 --- a/jcapiv2/jcapiv2/api/user_group_associations_api.py +++ b/jcapiv2/jcapiv2/api/user_group_associations_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,57 +32,53 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def graph_user_group_associations_list(self, group_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_user_group_associations_list(self, group_id, targets, **kwargs): # noqa: E501 """List the associations of a User Group. # noqa: E501 This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_associations_list(group_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_user_group_associations_list(group_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"user_group\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_associations_list_with_http_info(group_id, content_type, accept, targets, **kwargs) # noqa: E501 + return self.graph_user_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_associations_list_with_http_info(group_id, content_type, accept, targets, **kwargs) # noqa: E501 + (data) = self.graph_user_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 return data - def graph_user_group_associations_list_with_http_info(self, group_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_user_group_associations_list_with_http_info(self, group_id, targets, **kwargs): # noqa: E501 """List the associations of a User Group. # noqa: E501 This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_associations_list_with_http_info(group_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_user_group_associations_list_with_http_info(group_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"user_group\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -102,21 +97,11 @@ def graph_user_group_associations_list_with_http_info(self, group_id, content_ty if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_associations_list`") # noqa: E501 # verify the required parameter 'targets' is set if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_user_group_associations_list`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -124,19 +109,15 @@ def graph_user_group_associations_list_with_http_info(self, group_id, content_ty path_params['group_id'] = params['group_id'] # noqa: E501 query_params = [] + if 'targets' in params: + query_params.append(('targets', params['targets'])) # noqa: E501 + collection_formats['targets'] = 'csv' # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 - if 'targets' in params: - query_params.append(('targets', params['targets'])) # noqa: E501 - collection_formats['targets'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -148,10 +129,6 @@ def graph_user_group_associations_list_with_http_info(self, group_id, content_ty header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -171,53 +148,49 @@ def graph_user_group_associations_list_with_http_info(self, group_id, content_ty _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_associations_post(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_associations_post(self, group_id, **kwargs): # noqa: E501 """Manage the associations of a User Group # noqa: E501 - This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 + This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_associations_post(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_associations_post(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGroupGraphManagementReq body: - :param str x_org_id: + :param GraphOperationUserGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_associations_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_associations_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_associations_post_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_associations_post_with_http_info(self, group_id, **kwargs): # noqa: E501 """Manage the associations of a User Group # noqa: E501 - This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 + This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_associations_post_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_associations_post_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGroupGraphManagementReq body: - :param str x_org_id: + :param GraphOperationUserGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -236,14 +209,6 @@ def graph_user_group_associations_post_with_http_info(self, group_id, content_ty if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_associations_post`") # noqa: E501 collection_formats = {} @@ -254,10 +219,6 @@ def graph_user_group_associations_post_with_http_info(self, group_id, content_ty query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -267,10 +228,6 @@ def graph_user_group_associations_post_with_http_info(self, group_id, content_ty body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -294,57 +251,53 @@ def graph_user_group_associations_post_with_http_info(self, group_id, content_ty _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_active_directory(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_active_directory(self, group_id, **kwargs): # noqa: E501 """List the Active Directories bound to a User Group # noqa: E501 This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_active_directory(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_active_directory(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_active_directory_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_active_directory_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_active_directory_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_active_directory_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_active_directory_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_active_directory_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Active Directories bound to a User Group # noqa: E501 This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_active_directory_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_active_directory_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -363,17 +316,7 @@ def graph_user_group_traverse_active_directory_with_http_info(self, group_id, co if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_active_directory`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_active_directory`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_active_directory`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_active_directory`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -392,10 +335,6 @@ def graph_user_group_traverse_active_directory_with_http_info(self, group_id, co header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -405,10 +344,6 @@ def graph_user_group_traverse_active_directory_with_http_info(self, group_id, co header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -428,57 +363,53 @@ def graph_user_group_traverse_active_directory_with_http_info(self, group_id, co _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_application(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_application(self, group_id, **kwargs): # noqa: E501 """List the Applications bound to a User Group # noqa: E501 This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_application(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_application(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_application_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_application_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_application_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_application_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_application_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_application_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Applications bound to a User Group # noqa: E501 This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_application_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_application_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -497,17 +428,7 @@ def graph_user_group_traverse_application_with_http_info(self, group_id, content if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_application`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_application`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_application`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_application`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -526,10 +447,6 @@ def graph_user_group_traverse_application_with_http_info(self, group_id, content header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -539,10 +456,6 @@ def graph_user_group_traverse_application_with_http_info(self, group_id, content header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -562,57 +475,53 @@ def graph_user_group_traverse_application_with_http_info(self, group_id, content _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_directory(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_directory(self, group_id, **kwargs): # noqa: E501 """List the Directories bound to a User Group # noqa: E501 This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_directory(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_directory(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_directory_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_directory_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_directory_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_directory_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_directory_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_directory_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Directories bound to a User Group # noqa: E501 This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_directory_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_directory_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -631,17 +540,7 @@ def graph_user_group_traverse_directory_with_http_info(self, group_id, content_t if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_directory`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_directory`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_directory`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_directory`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -660,10 +559,6 @@ def graph_user_group_traverse_directory_with_http_info(self, group_id, content_t header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -673,10 +568,6 @@ def graph_user_group_traverse_directory_with_http_info(self, group_id, content_t header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -696,57 +587,53 @@ def graph_user_group_traverse_directory_with_http_info(self, group_id, content_t _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_g_suite(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_g_suite(self, group_id, **kwargs): # noqa: E501 """List the G Suite instances bound to a User Group # noqa: E501 This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_g_suite(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_g_suite(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_g_suite_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_g_suite_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_g_suite_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_g_suite_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_g_suite_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_g_suite_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the G Suite instances bound to a User Group # noqa: E501 This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_g_suite_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_g_suite_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -765,17 +652,7 @@ def graph_user_group_traverse_g_suite_with_http_info(self, group_id, content_typ if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_g_suite`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_g_suite`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_g_suite`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_g_suite`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -794,10 +671,6 @@ def graph_user_group_traverse_g_suite_with_http_info(self, group_id, content_typ header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -807,10 +680,6 @@ def graph_user_group_traverse_g_suite_with_http_info(self, group_id, content_typ header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -830,57 +699,53 @@ def graph_user_group_traverse_g_suite_with_http_info(self, group_id, content_typ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_ldap_server(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_ldap_server(self, group_id, **kwargs): # noqa: E501 """List the LDAP Servers bound to a User Group # noqa: E501 This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_ldap_server(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_ldap_server(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_ldap_server_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_ldap_server_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_ldap_server_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_ldap_server_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the LDAP Servers bound to a User Group # noqa: E501 This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_ldap_server_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_ldap_server_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -899,17 +764,7 @@ def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, content if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_ldap_server`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_ldap_server`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_ldap_server`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_ldap_server`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -928,10 +783,6 @@ def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, content header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -941,10 +792,6 @@ def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, content header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -964,57 +811,53 @@ def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, content _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_office365(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_office365(self, group_id, **kwargs): # noqa: E501 """List the Office 365 instances bound to a User Group # noqa: E501 This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_office365(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_office365(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_office365_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_office365_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_office365_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_office365_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_office365_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_office365_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Office 365 instances bound to a User Group # noqa: E501 This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_office365_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_office365_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1033,17 +876,7 @@ def graph_user_group_traverse_office365_with_http_info(self, group_id, content_t if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_office365`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_office365`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_office365`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_office365`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1062,10 +895,6 @@ def graph_user_group_traverse_office365_with_http_info(self, group_id, content_t header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1075,10 +904,6 @@ def graph_user_group_traverse_office365_with_http_info(self, group_id, content_t header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1098,57 +923,53 @@ def graph_user_group_traverse_office365_with_http_info(self, group_id, content_t _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_radius_server(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_radius_server(self, group_id, **kwargs): # noqa: E501 """List the RADIUS Servers bound to a User Group # noqa: E501 This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_radius_server(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_radius_server(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_radius_server_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_radius_server_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_radius_server_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_radius_server_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_radius_server_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_radius_server_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the RADIUS Servers bound to a User Group # noqa: E501 This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_radius_server_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_radius_server_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1167,17 +988,7 @@ def graph_user_group_traverse_radius_server_with_http_info(self, group_id, conte if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_radius_server`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_radius_server`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_radius_server`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_radius_server`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1196,10 +1007,6 @@ def graph_user_group_traverse_radius_server_with_http_info(self, group_id, conte header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1209,10 +1016,6 @@ def graph_user_group_traverse_radius_server_with_http_info(self, group_id, conte header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1232,57 +1035,53 @@ def graph_user_group_traverse_radius_server_with_http_info(self, group_id, conte _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_system(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_system(self, group_id, **kwargs): # noqa: E501 """List the Systems bound to a User Group # noqa: E501 This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_system(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_system(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_system_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_system_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_system_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_system_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_system_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_system_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Systems bound to a User Group # noqa: E501 This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_system_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_system_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1301,17 +1100,7 @@ def graph_user_group_traverse_system_with_http_info(self, group_id, content_type if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_system`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_system`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_system`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_system`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1330,10 +1119,6 @@ def graph_user_group_traverse_system_with_http_info(self, group_id, content_type header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1343,10 +1128,6 @@ def graph_user_group_traverse_system_with_http_info(self, group_id, content_type header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1366,57 +1147,53 @@ def graph_user_group_traverse_system_with_http_info(self, group_id, content_type _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_system_group(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_system_group(self, group_id, **kwargs): # noqa: E501 """List the System Groups bound to User Groups # noqa: E501 This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_system_group(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_system_group(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_system_group_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_system_group_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_system_group_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_system_group_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_system_group_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_system_group_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the System Groups bound to User Groups # noqa: E501 This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_system_group_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_system_group_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1435,17 +1212,7 @@ def graph_user_group_traverse_system_group_with_http_info(self, group_id, conten if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_system_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_system_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_system_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_system_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1464,10 +1231,6 @@ def graph_user_group_traverse_system_group_with_http_info(self, group_id, conten header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1477,10 +1240,6 @@ def graph_user_group_traverse_system_group_with_http_info(self, group_id, conten header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 diff --git a/jcapiv2/jcapiv2/api/user_group_members__membership_api.py b/jcapiv2/jcapiv2/api/user_group_members__membership_api.py index 03a6254..e25c6cb 100644 --- a/jcapiv2/jcapiv2/api/user_group_members__membership_api.py +++ b/jcapiv2/jcapiv2/api/user_group_members__membership_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,194 +32,51 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def graph_user_group_member_of(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the User Group's parents # noqa: E501 - - This endpoint returns all User Groups a User Group is a member of. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{group_id}/memberof ``` Not public yet, as the code is not finished, # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_member_of(group_id, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: - :return: list[GraphObjectWithPaths] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.graph_user_group_member_of_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 - else: - (data) = self.graph_user_group_member_of_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 - return data - - def graph_user_group_member_of_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the User Group's parents # noqa: E501 - - This endpoint returns all User Groups a User Group is a member of. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{group_id}/memberof ``` Not public yet, as the code is not finished, # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_member_of_with_http_info(group_id, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: - :return: list[GraphObjectWithPaths] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['group_id', 'content_type', 'accept', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method graph_user_group_member_of" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'group_id' is set - if ('group_id' not in params or - params['group_id'] is None): - raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_member_of`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_member_of`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_member_of`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_member_of`, must be a value greater than or equal to `0`") # noqa: E501 - collection_formats = {} - - path_params = {} - if 'group_id' in params: - path_params['group_id'] = params['group_id'] # noqa: E501 - - query_params = [] - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 - collection_formats['filter'] = 'csv' # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - collection_formats['sort'] = 'csv' # noqa: E501 - - header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - if 'x_org_id' in params: - header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/usergroups/{group_id}/memberof', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[GraphObjectWithPaths]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def graph_user_group_members_list(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_members_list(self, group_id, **kwargs): # noqa: E501 """List the members of a User Group # noqa: E501 This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_members_list(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_members_list(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_members_list_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_members_list_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_members_list_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_members_list_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the members of a User Group # noqa: E501 This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_members_list_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_members_list_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -239,17 +95,7 @@ def graph_user_group_members_list_with_http_info(self, group_id, content_type, a if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_members_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_members_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_members_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_members_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -263,10 +109,6 @@ def graph_user_group_members_list_with_http_info(self, group_id, content_type, a query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -278,10 +120,6 @@ def graph_user_group_members_list_with_http_info(self, group_id, content_type, a header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -301,53 +139,49 @@ def graph_user_group_members_list_with_http_info(self, group_id, content_type, a _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_members_post(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_members_post(self, group_id, **kwargs): # noqa: E501 """Manage the members of a User Group # noqa: E501 - This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_members_post(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_members_post(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGroupMembersReq body: - :param str x_org_id: + :param GraphOperationUserGroupMember body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_members_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_members_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_members_post_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_members_post_with_http_info(self, group_id, **kwargs): # noqa: E501 """Manage the members of a User Group # noqa: E501 - This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_members_post_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_members_post_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGroupMembersReq body: - :param str x_org_id: + :param GraphOperationUserGroupMember body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -366,14 +200,6 @@ def graph_user_group_members_post_with_http_info(self, group_id, content_type, a if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_members_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_members_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_members_post`") # noqa: E501 collection_formats = {} @@ -384,10 +210,6 @@ def graph_user_group_members_post_with_http_info(self, group_id, content_type, a query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -397,10 +219,6 @@ def graph_user_group_members_post_with_http_info(self, group_id, content_type, a body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -424,59 +242,55 @@ def graph_user_group_members_post_with_http_info(self, group_id, content_type, a _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_membership(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_membership(self, group_id, **kwargs): # noqa: E501 """List the User Group's membership # noqa: E501 This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_membership(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_membership(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_membership_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_membership_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_membership_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_membership_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the User Group's membership # noqa: E501 This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_membership_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_membership_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -495,17 +309,7 @@ def graph_user_group_membership_with_http_info(self, group_id, content_type, acc if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_membership`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_membership`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_membership`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_membership`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -525,10 +329,6 @@ def graph_user_group_membership_with_http_info(self, group_id, content_type, acc collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -540,10 +340,6 @@ def graph_user_group_membership_with_http_info(self, group_id, content_type, acc header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 diff --git a/jcapiv2/jcapiv2/api/user_groups_api.py b/jcapiv2/jcapiv2/api/user_groups_api.py index ca1d9ee..5e4cf62 100644 --- a/jcapiv2/jcapiv2/api/user_groups_api.py +++ b/jcapiv2/jcapiv2/api/user_groups_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,57 +32,53 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def graph_user_group_associations_list(self, group_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_user_group_associations_list(self, group_id, targets, **kwargs): # noqa: E501 """List the associations of a User Group. # noqa: E501 This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_associations_list(group_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_user_group_associations_list(group_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"user_group\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_associations_list_with_http_info(group_id, content_type, accept, targets, **kwargs) # noqa: E501 + return self.graph_user_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_associations_list_with_http_info(group_id, content_type, accept, targets, **kwargs) # noqa: E501 + (data) = self.graph_user_group_associations_list_with_http_info(group_id, targets, **kwargs) # noqa: E501 return data - def graph_user_group_associations_list_with_http_info(self, group_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_user_group_associations_list_with_http_info(self, group_id, targets, **kwargs): # noqa: E501 """List the associations of a User Group. # noqa: E501 This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_associations_list_with_http_info(group_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_user_group_associations_list_with_http_info(group_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"user_group\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -102,21 +97,11 @@ def graph_user_group_associations_list_with_http_info(self, group_id, content_ty if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_associations_list`") # noqa: E501 # verify the required parameter 'targets' is set if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_user_group_associations_list`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -124,19 +109,15 @@ def graph_user_group_associations_list_with_http_info(self, group_id, content_ty path_params['group_id'] = params['group_id'] # noqa: E501 query_params = [] + if 'targets' in params: + query_params.append(('targets', params['targets'])) # noqa: E501 + collection_formats['targets'] = 'csv' # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 - if 'targets' in params: - query_params.append(('targets', params['targets'])) # noqa: E501 - collection_formats['targets'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -148,10 +129,6 @@ def graph_user_group_associations_list_with_http_info(self, group_id, content_ty header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -171,53 +148,49 @@ def graph_user_group_associations_list_with_http_info(self, group_id, content_ty _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_associations_post(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_associations_post(self, group_id, **kwargs): # noqa: E501 """Manage the associations of a User Group # noqa: E501 - This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 + This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_associations_post(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_associations_post(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGroupGraphManagementReq body: - :param str x_org_id: + :param GraphOperationUserGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_associations_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_associations_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_associations_post_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_associations_post_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_associations_post_with_http_info(self, group_id, **kwargs): # noqa: E501 """Manage the associations of a User Group # noqa: E501 - This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 + This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_associations_post_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_associations_post_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGroupGraphManagementReq body: - :param str x_org_id: + :param GraphOperationUserGroup body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -236,14 +209,6 @@ def graph_user_group_associations_post_with_http_info(self, group_id, content_ty if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_associations_post`") # noqa: E501 collection_formats = {} @@ -254,10 +219,6 @@ def graph_user_group_associations_post_with_http_info(self, group_id, content_ty query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -267,10 +228,6 @@ def graph_user_group_associations_post_with_http_info(self, group_id, content_ty body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -294,194 +251,51 @@ def graph_user_group_associations_post_with_http_info(self, group_id, content_ty _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_member_of(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the User Group's parents # noqa: E501 - - This endpoint returns all User Groups a User Group is a member of. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{group_id}/memberof ``` Not public yet, as the code is not finished, # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_member_of(group_id, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: - :return: list[GraphObjectWithPaths] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.graph_user_group_member_of_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 - else: - (data) = self.graph_user_group_member_of_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 - return data - - def graph_user_group_member_of_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 - """List the User Group's parents # noqa: E501 - - This endpoint returns all User Groups a User Group is a member of. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{group_id}/memberof ``` Not public yet, as the code is not finished, # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_member_of_with_http_info(group_id, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: - :return: list[GraphObjectWithPaths] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['group_id', 'content_type', 'accept', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method graph_user_group_member_of" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'group_id' is set - if ('group_id' not in params or - params['group_id'] is None): - raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_member_of`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_member_of`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_member_of`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_member_of`, must be a value greater than or equal to `0`") # noqa: E501 - collection_formats = {} - - path_params = {} - if 'group_id' in params: - path_params['group_id'] = params['group_id'] # noqa: E501 - - query_params = [] - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 - collection_formats['filter'] = 'csv' # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - collection_formats['sort'] = 'csv' # noqa: E501 - - header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - if 'x_org_id' in params: - header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/usergroups/{group_id}/memberof', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[GraphObjectWithPaths]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def graph_user_group_members_list(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_members_list(self, group_id, **kwargs): # noqa: E501 """List the members of a User Group # noqa: E501 This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_members_list(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_members_list(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_members_list_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_members_list_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_members_list_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_members_list_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_members_list_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the members of a User Group # noqa: E501 This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_members_list_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_members_list_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -500,17 +314,7 @@ def graph_user_group_members_list_with_http_info(self, group_id, content_type, a if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_members_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_members_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_members_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_members_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -524,10 +328,6 @@ def graph_user_group_members_list_with_http_info(self, group_id, content_type, a query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -539,10 +339,6 @@ def graph_user_group_members_list_with_http_info(self, group_id, content_type, a header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -562,53 +358,49 @@ def graph_user_group_members_list_with_http_info(self, group_id, content_type, a _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_members_post(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_members_post(self, group_id, **kwargs): # noqa: E501 """Manage the members of a User Group # noqa: E501 - This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_members_post(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_members_post(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGroupMembersReq body: - :param str x_org_id: + :param GraphOperationUserGroupMember body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_members_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_members_post_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_members_post_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_members_post_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_members_post_with_http_info(self, group_id, **kwargs): # noqa: E501 """Manage the members of a User Group # noqa: E501 - This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 + This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_members_post_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_members_post_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGroupMembersReq body: - :param str x_org_id: + :param GraphOperationUserGroupMember body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -627,14 +419,6 @@ def graph_user_group_members_post_with_http_info(self, group_id, content_type, a if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_members_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_members_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_members_post`") # noqa: E501 collection_formats = {} @@ -645,10 +429,6 @@ def graph_user_group_members_post_with_http_info(self, group_id, content_type, a query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -658,10 +438,6 @@ def graph_user_group_members_post_with_http_info(self, group_id, content_type, a body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -685,59 +461,55 @@ def graph_user_group_members_post_with_http_info(self, group_id, content_type, a _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_membership(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_membership(self, group_id, **kwargs): # noqa: E501 """List the User Group's membership # noqa: E501 This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_membership(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_membership(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_membership_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_membership_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_membership_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_membership_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_membership_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the User Group's membership # noqa: E501 This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_membership_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_membership_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -756,17 +528,7 @@ def graph_user_group_membership_with_http_info(self, group_id, content_type, acc if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_membership`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_membership`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_membership`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_membership`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -786,10 +548,6 @@ def graph_user_group_membership_with_http_info(self, group_id, content_type, acc collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -801,10 +559,6 @@ def graph_user_group_membership_with_http_info(self, group_id, content_type, acc header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -824,57 +578,53 @@ def graph_user_group_membership_with_http_info(self, group_id, content_type, acc _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_active_directory(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_active_directory(self, group_id, **kwargs): # noqa: E501 """List the Active Directories bound to a User Group # noqa: E501 This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_active_directory(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_active_directory(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_active_directory_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_active_directory_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_active_directory_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_active_directory_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_active_directory_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_active_directory_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Active Directories bound to a User Group # noqa: E501 This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_active_directory_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_active_directory_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -893,17 +643,7 @@ def graph_user_group_traverse_active_directory_with_http_info(self, group_id, co if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_active_directory`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_active_directory`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_active_directory`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_active_directory`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -922,10 +662,6 @@ def graph_user_group_traverse_active_directory_with_http_info(self, group_id, co header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -935,10 +671,6 @@ def graph_user_group_traverse_active_directory_with_http_info(self, group_id, co header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -958,57 +690,53 @@ def graph_user_group_traverse_active_directory_with_http_info(self, group_id, co _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_application(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_application(self, group_id, **kwargs): # noqa: E501 """List the Applications bound to a User Group # noqa: E501 This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_application(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_application(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_application_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_application_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_application_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_application_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_application_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_application_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Applications bound to a User Group # noqa: E501 This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_application_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_application_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1027,17 +755,7 @@ def graph_user_group_traverse_application_with_http_info(self, group_id, content if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_application`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_application`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_application`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_application`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1056,10 +774,6 @@ def graph_user_group_traverse_application_with_http_info(self, group_id, content header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1069,10 +783,6 @@ def graph_user_group_traverse_application_with_http_info(self, group_id, content header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1092,57 +802,53 @@ def graph_user_group_traverse_application_with_http_info(self, group_id, content _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_directory(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_directory(self, group_id, **kwargs): # noqa: E501 """List the Directories bound to a User Group # noqa: E501 This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_directory(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_directory(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_directory_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_directory_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_directory_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_directory_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_directory_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_directory_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Directories bound to a User Group # noqa: E501 This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_directory_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_directory_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1161,17 +867,7 @@ def graph_user_group_traverse_directory_with_http_info(self, group_id, content_t if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_directory`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_directory`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_directory`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_directory`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1190,10 +886,6 @@ def graph_user_group_traverse_directory_with_http_info(self, group_id, content_t header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1203,10 +895,6 @@ def graph_user_group_traverse_directory_with_http_info(self, group_id, content_t header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1226,57 +914,53 @@ def graph_user_group_traverse_directory_with_http_info(self, group_id, content_t _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_g_suite(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_g_suite(self, group_id, **kwargs): # noqa: E501 """List the G Suite instances bound to a User Group # noqa: E501 This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_g_suite(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_g_suite(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_g_suite_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_g_suite_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_g_suite_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_g_suite_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_g_suite_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_g_suite_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the G Suite instances bound to a User Group # noqa: E501 This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_g_suite_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_g_suite_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1295,17 +979,7 @@ def graph_user_group_traverse_g_suite_with_http_info(self, group_id, content_typ if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_g_suite`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_g_suite`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_g_suite`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_g_suite`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1324,10 +998,6 @@ def graph_user_group_traverse_g_suite_with_http_info(self, group_id, content_typ header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1337,10 +1007,6 @@ def graph_user_group_traverse_g_suite_with_http_info(self, group_id, content_typ header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1360,57 +1026,53 @@ def graph_user_group_traverse_g_suite_with_http_info(self, group_id, content_typ _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_ldap_server(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_ldap_server(self, group_id, **kwargs): # noqa: E501 """List the LDAP Servers bound to a User Group # noqa: E501 This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_ldap_server(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_ldap_server(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_ldap_server_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_ldap_server_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_ldap_server_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_ldap_server_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the LDAP Servers bound to a User Group # noqa: E501 This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_ldap_server_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_ldap_server_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1429,17 +1091,7 @@ def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, content if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_ldap_server`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_ldap_server`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_ldap_server`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_ldap_server`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1458,10 +1110,6 @@ def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, content header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1471,10 +1119,6 @@ def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, content header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1494,57 +1138,53 @@ def graph_user_group_traverse_ldap_server_with_http_info(self, group_id, content _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_office365(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_office365(self, group_id, **kwargs): # noqa: E501 """List the Office 365 instances bound to a User Group # noqa: E501 This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_office365(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_office365(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_office365_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_office365_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_office365_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_office365_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_office365_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_office365_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Office 365 instances bound to a User Group # noqa: E501 This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_office365_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_office365_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1563,17 +1203,7 @@ def graph_user_group_traverse_office365_with_http_info(self, group_id, content_t if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_office365`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_office365`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_office365`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_office365`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1592,10 +1222,6 @@ def graph_user_group_traverse_office365_with_http_info(self, group_id, content_t header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1605,10 +1231,6 @@ def graph_user_group_traverse_office365_with_http_info(self, group_id, content_t header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1628,57 +1250,53 @@ def graph_user_group_traverse_office365_with_http_info(self, group_id, content_t _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_radius_server(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_radius_server(self, group_id, **kwargs): # noqa: E501 """List the RADIUS Servers bound to a User Group # noqa: E501 This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_radius_server(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_radius_server(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_radius_server_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_radius_server_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_radius_server_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_radius_server_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_radius_server_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_radius_server_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the RADIUS Servers bound to a User Group # noqa: E501 This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_radius_server_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_radius_server_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1697,17 +1315,7 @@ def graph_user_group_traverse_radius_server_with_http_info(self, group_id, conte if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_radius_server`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_radius_server`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_radius_server`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_radius_server`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1726,10 +1334,6 @@ def graph_user_group_traverse_radius_server_with_http_info(self, group_id, conte header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1739,10 +1343,6 @@ def graph_user_group_traverse_radius_server_with_http_info(self, group_id, conte header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1762,57 +1362,53 @@ def graph_user_group_traverse_radius_server_with_http_info(self, group_id, conte _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_system(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_system(self, group_id, **kwargs): # noqa: E501 """List the Systems bound to a User Group # noqa: E501 This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_system(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_system(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_system_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_system_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_system_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_system_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_system_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_system_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the Systems bound to a User Group # noqa: E501 This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_system_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_system_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1831,17 +1427,7 @@ def graph_user_group_traverse_system_with_http_info(self, group_id, content_type if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_system`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_system`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_system`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_system`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1860,10 +1446,6 @@ def graph_user_group_traverse_system_with_http_info(self, group_id, content_type header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1873,10 +1455,6 @@ def graph_user_group_traverse_system_with_http_info(self, group_id, content_type header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1896,57 +1474,53 @@ def graph_user_group_traverse_system_with_http_info(self, group_id, content_type _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_group_traverse_system_group(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_system_group(self, group_id, **kwargs): # noqa: E501 """List the System Groups bound to User Groups # noqa: E501 This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_system_group(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_system_group(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_group_traverse_system_group_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_group_traverse_system_group_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_group_traverse_system_group_with_http_info(group_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_group_traverse_system_group_with_http_info(group_id, **kwargs) # noqa: E501 return data - def graph_user_group_traverse_system_group_with_http_info(self, group_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_group_traverse_system_group_with_http_info(self, group_id, **kwargs): # noqa: E501 """List the System Groups bound to User Groups # noqa: E501 This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_group_traverse_system_group_with_http_info(group_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_group_traverse_system_group_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool :param str group_id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['group_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['group_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1965,17 +1539,7 @@ def graph_user_group_traverse_system_group_with_http_info(self, group_id, conten if ('group_id' not in params or params['group_id'] is None): raise ValueError("Missing the required parameter `group_id` when calling `graph_user_group_traverse_system_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_group_traverse_system_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_group_traverse_system_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_group_traverse_system_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1994,10 +1558,6 @@ def graph_user_group_traverse_system_group_with_http_info(self, group_id, conten header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -2007,10 +1567,6 @@ def graph_user_group_traverse_system_group_with_http_info(self, group_id, conten header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -2030,51 +1586,51 @@ def graph_user_group_traverse_system_group_with_http_info(self, group_id, conten _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def groups_user_delete(self, id, content_type, accept, **kwargs): # noqa: E501 - """Delete a User Group # noqa: E501 + def groups_suggestions_get(self, group_id, **kwargs): # noqa: E501 + """List Suggestions for a User Group # noqa: E501 - This endpoint allows you to delete a User Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns available suggestions for a given group #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/suggestions \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_user_delete(id, content_type, accept, async_req=True) + >>> thread = api.groups_suggestions_get(group_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: None + :param str group_id: ID of the group (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: list[MemberSuggestion] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.groups_user_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.groups_suggestions_get_with_http_info(group_id, **kwargs) # noqa: E501 else: - (data) = self.groups_user_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.groups_suggestions_get_with_http_info(group_id, **kwargs) # noqa: E501 return data - def groups_user_delete_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """Delete a User Group # noqa: E501 + def groups_suggestions_get_with_http_info(self, group_id, **kwargs): # noqa: E501 + """List Suggestions for a User Group # noqa: E501 - This endpoint allows you to delete a User Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint returns available suggestions for a given group #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/suggestions \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_user_delete_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.groups_suggestions_get_with_http_info(group_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: None + :param str group_id: ID of the group (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :return: list[MemberSuggestion] If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['group_id', 'x_org_id', 'limit', 'skip'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2085,36 +1641,28 @@ def groups_user_delete_with_http_info(self, id, content_type, accept, **kwargs): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method groups_user_delete" % key + " to method groups_suggestions_get" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `groups_user_delete`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `groups_user_delete`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `groups_user_delete`") # noqa: E501 + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `groups_suggestions_get`") # noqa: E501 collection_formats = {} path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -2126,22 +1674,18 @@ def groups_user_delete_with_http_info(self, id, content_type, accept, **kwargs): header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/usergroups/{id}', 'DELETE', + '/usergroups/{group_id}/suggestions', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='list[MemberSuggestion]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2149,51 +1693,49 @@ def groups_user_delete_with_http_info(self, id, content_type, accept, **kwargs): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def groups_user_get(self, id, content_type, accept, **kwargs): # noqa: E501 - """View an individual User Group details # noqa: E501 + def groups_suggestions_post(self, body, group_id, **kwargs): # noqa: E501 + """List Suggestions for a User Group # noqa: E501 - This endpoint returns the details of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint applies the suggestions for the specified user group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/suggestions \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"user_ids\": [\"212345678901234567890123\", \"123456789012345678901234\"] }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_user_get(id, content_type, accept, async_req=True) + >>> thread = api.groups_suggestions_post(body, group_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: UserGroup + :param GroupIdSuggestionsBody body: (required) + :param str group_id: ID of the group (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: object If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.groups_user_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.groups_suggestions_post_with_http_info(body, group_id, **kwargs) # noqa: E501 else: - (data) = self.groups_user_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.groups_suggestions_post_with_http_info(body, group_id, **kwargs) # noqa: E501 return data - def groups_user_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """View an individual User Group details # noqa: E501 + def groups_suggestions_post_with_http_info(self, body, group_id, **kwargs): # noqa: E501 + """List Suggestions for a User Group # noqa: E501 - This endpoint returns the details of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint applies the suggestions for the specified user group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/suggestions \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"user_ids\": [\"212345678901234567890123\", \"123456789012345678901234\"] }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_user_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.groups_suggestions_post_with_http_info(body, group_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: UserGroup + :param GroupIdSuggestionsBody body: (required) + :param str group_id: ID of the group (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: object If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['body', 'group_id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2204,36 +1746,28 @@ def groups_user_get_with_http_info(self, id, content_type, accept, **kwargs): # if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method groups_user_get" % key + " to method groups_suggestions_post" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `groups_user_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `groups_user_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `groups_user_get`") # noqa: E501 + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `groups_suggestions_post`") # noqa: E501 + # verify the required parameter 'group_id' is set + if ('group_id' not in params or + params['group_id'] is None): + raise ValueError("Missing the required parameter `group_id` when calling `groups_suggestions_post`") # noqa: E501 collection_formats = {} path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 + if 'group_id' in params: + path_params['group_id'] = params['group_id'] # noqa: E501 query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -2241,6 +1775,8 @@ def groups_user_get_with_http_info(self, id, content_type, accept, **kwargs): # local_var_files = {} body_params = None + if 'body' in params: + body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 @@ -2253,14 +1789,14 @@ def groups_user_get_with_http_info(self, id, content_type, accept, **kwargs): # auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/usergroups/{id}', 'GET', + '/usergroups/{group_id}/suggestions', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='UserGroup', # noqa: E501 + response_type='object', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2268,59 +1804,47 @@ def groups_user_get_with_http_info(self, id, content_type, accept, **kwargs): # _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def groups_user_list(self, content_type, accept, **kwargs): # noqa: E501 - """List all User Groups # noqa: E501 + def groups_user_delete(self, id, **kwargs): # noqa: E501 + """Delete a User Group # noqa: E501 - This endpoint returns all User Groups. Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint allows you to delete a User Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_user_list(content_type, accept, async_req=True) + >>> thread = api.groups_user_delete(id, async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: - :return: list[UserGroup] + :param str id: ObjectID of the User Group. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: UserGroup If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.groups_user_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.groups_user_delete_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.groups_user_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.groups_user_delete_with_http_info(id, **kwargs) # noqa: E501 return data - def groups_user_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """List all User Groups # noqa: E501 + def groups_user_delete_with_http_info(self, id, **kwargs): # noqa: E501 + """Delete a User Group # noqa: E501 - This endpoint returns all User Groups. Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This endpoint allows you to delete a User Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_user_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.groups_user_delete_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param int limit: The number of records to return at once. Limited to 100. - :param int skip: The offset into the records to return. - :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: - :return: list[UserGroup] + :param str id: ObjectID of the User Group. (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: UserGroup If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2331,45 +1855,24 @@ def groups_user_list_with_http_info(self, content_type, accept, **kwargs): # no if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method groups_user_list" % key + " to method groups_user_delete" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `groups_user_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `groups_user_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `groups_user_list`, must be a value greater than or equal to `0`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `groups_user_delete`") # noqa: E501 + collection_formats = {} path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'fields' in params: - query_params.append(('fields', params['fields'])) # noqa: E501 - collection_formats['fields'] = 'csv' # noqa: E501 - if 'filter' in params: - query_params.append(('filter', params['filter'])) # noqa: E501 - collection_formats['filter'] = 'csv' # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'skip' in params: - query_params.append(('skip', params['skip'])) # noqa: E501 - if 'sort' in params: - query_params.append(('sort', params['sort'])) # noqa: E501 - collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -2381,22 +1884,18 @@ def groups_user_list_with_http_info(self, content_type, accept, **kwargs): # no header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/usergroups', 'GET', + '/usergroups/{id}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[UserGroup]', # noqa: E501 + response_type='UserGroup', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2404,53 +1903,47 @@ def groups_user_list_with_http_info(self, content_type, accept, **kwargs): # no _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def groups_user_patch(self, id, content_type, accept, **kwargs): # noqa: E501 - """Partial update a User Group # noqa: E501 + def groups_user_get(self, id, **kwargs): # noqa: E501 + """View an individual User Group details # noqa: E501 - We have hidden PATCH on the systemgroups and usergroups for now; we don't have that implemented correctly yet, people should use PUT until we do a true PATCH operation. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{id} ``` # noqa: E501 + This endpoint returns the details of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_user_patch(id, content_type, accept, async_req=True) + >>> thread = api.groups_user_get(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGroupPost body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: UserGroup If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.groups_user_patch_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.groups_user_get_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.groups_user_patch_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.groups_user_get_with_http_info(id, **kwargs) # noqa: E501 return data - def groups_user_patch_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """Partial update a User Group # noqa: E501 + def groups_user_get_with_http_info(self, id, **kwargs): # noqa: E501 + """View an individual User Group details # noqa: E501 - We have hidden PATCH on the systemgroups and usergroups for now; we don't have that implemented correctly yet, people should use PUT until we do a true PATCH operation. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{id} ``` # noqa: E501 + This endpoint returns the details of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_user_patch_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.groups_user_get_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGroupPost body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: UserGroup If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2461,22 +1954,14 @@ def groups_user_patch_with_http_info(self, id, content_type, accept, **kwargs): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method groups_user_patch" % key + " to method groups_user_get" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `groups_user_patch`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `groups_user_patch`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `groups_user_patch`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `groups_user_get`") # noqa: E501 collection_formats = {} @@ -2487,10 +1972,6 @@ def groups_user_patch_with_http_info(self, id, content_type, accept, **kwargs): query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -2498,28 +1979,136 @@ def groups_user_patch_with_http_info(self, id, content_type, accept, **kwargs): local_var_files = {} body_params = None - if 'body' in params: - body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/usergroups/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UserGroup', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def groups_user_list(self, **kwargs): # noqa: E501 + """List all User Groups # noqa: E501 + + This endpoint returns all User Groups. Available filter fields: - `name` - `disabled` - `type` - `suggestionCounts.add` - `suggestionCounts.remove` - `suggestionCounts.total` - `attributes.sudo.enabled` - `attributes.sudo.withoutPassword` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.groups_user_list(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[UserGroup] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.groups_user_list_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.groups_user_list_with_http_info(**kwargs) # noqa: E501 + return data + + def groups_user_list_with_http_info(self, **kwargs): # noqa: E501 + """List all User Groups # noqa: E501 + + This endpoint returns all User Groups. Available filter fields: - `name` - `disabled` - `type` - `suggestionCounts.add` - `suggestionCounts.remove` - `suggestionCounts.total` - `attributes.sudo.enabled` - `attributes.sudo.withoutPassword` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.groups_user_list_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param int skip: The offset into the records to return. + :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[UserGroup] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['fields', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method groups_user_list" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'fields' in params: + query_params.append(('fields', params['fields'])) # noqa: E501 + collection_formats['fields'] = 'csv' # noqa: E501 + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + if 'sort' in params: + query_params.append(('sort', params['sort'])) # noqa: E501 + collection_formats['sort'] = 'csv' # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/usergroups/{id}', 'PATCH', + '/usergroups', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='UserGroup', # noqa: E501 + response_type='list[UserGroup]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2527,51 +2116,47 @@ def groups_user_patch_with_http_info(self, id, content_type, accept, **kwargs): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def groups_user_post(self, content_type, accept, **kwargs): # noqa: E501 + def groups_user_post(self, **kwargs): # noqa: E501 """Create a new User Group # noqa: E501 - This endpoint allows you to create a new User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` # noqa: E501 + This endpoint allows you to create a new User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_user_post(content_type, accept, async_req=True) + >>> thread = api.groups_user_post(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param UserGroupPost body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: UserGroup If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.groups_user_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.groups_user_post_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.groups_user_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.groups_user_post_with_http_info(**kwargs) # noqa: E501 return data - def groups_user_post_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def groups_user_post_with_http_info(self, **kwargs): # noqa: E501 """Create a new User Group # noqa: E501 - This endpoint allows you to create a new User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` # noqa: E501 + This endpoint allows you to create a new User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_user_post_with_http_info(content_type, accept, async_req=True) + >>> thread = api.groups_user_post_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param UserGroupPost body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: UserGroup If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2586,14 +2171,6 @@ def groups_user_post_with_http_info(self, content_type, accept, **kwargs): # no ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `groups_user_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `groups_user_post`") # noqa: E501 collection_formats = {} @@ -2602,10 +2179,6 @@ def groups_user_post_with_http_info(self, content_type, accept, **kwargs): # no query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -2642,53 +2215,49 @@ def groups_user_post_with_http_info(self, content_type, accept, **kwargs): # no _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def groups_user_put(self, id, content_type, accept, **kwargs): # noqa: E501 + def groups_user_put(self, id, **kwargs): # noqa: E501 """Update a User Group # noqa: E501 - This endpoint allows you to do a full update of the User Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY' \\ -d '{ \"name\": \"group_update\" }' ``` # noqa: E501 + This endpoint allows you to do a full update of the User Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"group_update\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_user_put(id, content_type, accept, async_req=True) + >>> thread = api.groups_user_put(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param UserGroupPut body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: UserGroup If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.groups_user_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.groups_user_put_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.groups_user_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.groups_user_put_with_http_info(id, **kwargs) # noqa: E501 return data - def groups_user_put_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def groups_user_put_with_http_info(self, id, **kwargs): # noqa: E501 """Update a User Group # noqa: E501 - This endpoint allows you to do a full update of the User Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY' \\ -d '{ \"name\": \"group_update\" }' ``` # noqa: E501 + This endpoint allows you to do a full update of the User Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"group_update\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.groups_user_put_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.groups_user_put_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: ObjectID of the User Group. (required) - :param str content_type: (required) - :param str accept: (required) :param UserGroupPut body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: UserGroup If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2707,14 +2276,6 @@ def groups_user_put_with_http_info(self, id, content_type, accept, **kwargs): # if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `groups_user_put`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `groups_user_put`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `groups_user_put`") # noqa: E501 collection_formats = {} @@ -2725,10 +2286,6 @@ def groups_user_put_with_http_info(self, id, content_type, accept, **kwargs): # query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 diff --git a/jcapiv2/jcapiv2/api/users_api.py b/jcapiv2/jcapiv2/api/users_api.py index be382be..b2dc187 100644 --- a/jcapiv2/jcapiv2/api/users_api.py +++ b/jcapiv2/jcapiv2/api/users_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,57 +32,53 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def graph_user_associations_list(self, user_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_user_associations_list(self, user_id, targets, **kwargs): # noqa: E501 """List the associations of a User # noqa: E501 This endpoint returns the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_associations_list(user_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_user_associations_list(user_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"user\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_associations_list_with_http_info(user_id, content_type, accept, targets, **kwargs) # noqa: E501 + return self.graph_user_associations_list_with_http_info(user_id, targets, **kwargs) # noqa: E501 else: - (data) = self.graph_user_associations_list_with_http_info(user_id, content_type, accept, targets, **kwargs) # noqa: E501 + (data) = self.graph_user_associations_list_with_http_info(user_id, targets, **kwargs) # noqa: E501 return data - def graph_user_associations_list_with_http_info(self, user_id, content_type, accept, targets, **kwargs): # noqa: E501 + def graph_user_associations_list_with_http_info(self, user_id, targets, **kwargs): # noqa: E501 """List the associations of a User # noqa: E501 This endpoint returns the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_associations_list_with_http_info(user_id, content_type, accept, targets, async_req=True) + >>> thread = api.graph_user_associations_list_with_http_info(user_id, targets, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] targets: (required) + :param list[str] targets: Targets which a \"user\" can be associated to. (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphConnection] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['user_id', 'targets', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -102,21 +97,11 @@ def graph_user_associations_list_with_http_info(self, user_id, content_type, acc if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_associations_list`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_associations_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_associations_list`") # noqa: E501 # verify the required parameter 'targets' is set if ('targets' not in params or params['targets'] is None): raise ValueError("Missing the required parameter `targets` when calling `graph_user_associations_list`") # noqa: E501 - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_associations_list`, must be a value greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} @@ -124,19 +109,15 @@ def graph_user_associations_list_with_http_info(self, user_id, content_type, acc path_params['user_id'] = params['user_id'] # noqa: E501 query_params = [] + if 'targets' in params: + query_params.append(('targets', params['targets'])) # noqa: E501 + collection_formats['targets'] = 'csv' # noqa: E501 if 'limit' in params: query_params.append(('limit', params['limit'])) # noqa: E501 if 'skip' in params: query_params.append(('skip', params['skip'])) # noqa: E501 - if 'targets' in params: - query_params.append(('targets', params['targets'])) # noqa: E501 - collection_formats['targets'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -148,10 +129,6 @@ def graph_user_associations_list_with_http_info(self, user_id, content_type, acc header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -171,53 +148,49 @@ def graph_user_associations_list_with_http_info(self, user_id, content_type, acc _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_associations_post(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_associations_post(self, user_id, **kwargs): # noqa: E501 """Manage the associations of a User # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_associations_post(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_associations_post(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGraphManagementReq body: - :param str x_org_id: + :param GraphOperationUser body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_associations_post_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_associations_post_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_associations_post_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_associations_post_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_associations_post_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_associations_post_with_http_info(self, user_id, **kwargs): # noqa: E501 """Manage the associations of a User # noqa: E501 - This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' # noqa: E501 + This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_associations_post_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_associations_post_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) - :param UserGraphManagementReq body: - :param str x_org_id: + :param GraphOperationUser body: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['user_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -236,14 +209,6 @@ def graph_user_associations_post_with_http_info(self, user_id, content_type, acc if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_associations_post`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_associations_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_associations_post`") # noqa: E501 collection_formats = {} @@ -254,10 +219,6 @@ def graph_user_associations_post_with_http_info(self, user_id, content_type, acc query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -267,10 +228,6 @@ def graph_user_associations_post_with_http_info(self, user_id, content_type, acc body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -294,59 +251,55 @@ def graph_user_associations_post_with_http_info(self, user_id, content_type, acc _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_member_of(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_member_of(self, user_id, **kwargs): # noqa: E501 """List the parent Groups of a User # noqa: E501 This endpoint returns all the User Groups a User is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_member_of(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_member_of(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_member_of_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_member_of_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_member_of_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_member_of_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_member_of_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_member_of_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the parent Groups of a User # noqa: E501 This endpoint returns all the User Groups a User is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_member_of_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_member_of_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['user_id', 'filter', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -365,17 +318,7 @@ def graph_user_member_of_with_http_info(self, user_id, content_type, accept, **k if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_member_of`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_member_of`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_member_of`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_member_of`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -395,10 +338,6 @@ def graph_user_member_of_with_http_info(self, user_id, content_type, accept, **k collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -410,15 +349,123 @@ def graph_user_member_of_with_http_info(self, user_id, content_type, accept, **k header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/users/{user_id}/memberof', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[GraphObjectWithPaths]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def graph_user_traverse_active_directory(self, user_id, **kwargs): # noqa: E501 + """List the Active Directory instances bound to a User # noqa: E501 + + This endpoint will return all Active Directory Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Active Directory instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_user_traverse_active_directory(user_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_id: ObjectID of the User. (required) + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.graph_user_traverse_active_directory_with_http_info(user_id, **kwargs) # noqa: E501 + else: + (data) = self.graph_user_traverse_active_directory_with_http_info(user_id, **kwargs) # noqa: E501 + return data + + def graph_user_traverse_active_directory_with_http_info(self, user_id, **kwargs): # noqa: E501 + """List the Active Directory instances bound to a User # noqa: E501 + + This endpoint will return all Active Directory Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Active Directory instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.graph_user_traverse_active_directory_with_http_info(user_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_id: ObjectID of the User. (required) + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param int limit: The number of records to return at once. Limited to 100. + :param str x_org_id: Organization identifier that can be obtained from console settings. + :param int skip: The offset into the records to return. + :return: list[GraphObjectWithPaths] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['user_id', 'filter', 'limit', 'x_org_id', 'skip'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method graph_user_traverse_active_directory" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'user_id' is set + if ('user_id' not in params or + params['user_id'] is None): + raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_active_directory`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_id' in params: + path_params['user_id'] = params['user_id'] # noqa: E501 + + query_params = [] + if 'filter' in params: + query_params.append(('filter', params['filter'])) # noqa: E501 + collection_formats['filter'] = 'csv' # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'skip' in params: + query_params.append(('skip', params['skip'])) # noqa: E501 + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/users/{user_id}/memberof', 'GET', + '/users/{user_id}/activedirectories', 'GET', path_params, query_params, header_params, @@ -433,57 +480,53 @@ def graph_user_member_of_with_http_info(self, user_id, content_type, accept, **k _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_traverse_application(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_application(self, user_id, **kwargs): # noqa: E501 """List the Applications bound to a User # noqa: E501 This endpoint will return all Applications bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_application(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_application(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_traverse_application_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_traverse_application_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_traverse_application_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_traverse_application_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_traverse_application_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_application_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the Applications bound to a User # noqa: E501 This endpoint will return all Applications bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_application_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_application_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['user_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -502,17 +545,7 @@ def graph_user_traverse_application_with_http_info(self, user_id, content_type, if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_application`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_traverse_application`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_traverse_application`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_traverse_application`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -531,10 +564,6 @@ def graph_user_traverse_application_with_http_info(self, user_id, content_type, header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -544,10 +573,6 @@ def graph_user_traverse_application_with_http_info(self, user_id, content_type, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -567,57 +592,53 @@ def graph_user_traverse_application_with_http_info(self, user_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_traverse_directory(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_directory(self, user_id, **kwargs): # noqa: E501 """List the Directories bound to a User # noqa: E501 This endpoint will return all Directories bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directory from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_directory(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_directory(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_traverse_directory_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_traverse_directory_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_traverse_directory_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_traverse_directory_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_traverse_directory_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_directory_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the Directories bound to a User # noqa: E501 This endpoint will return all Directories bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directory from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_directory_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_directory_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['user_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -636,17 +657,7 @@ def graph_user_traverse_directory_with_http_info(self, user_id, content_type, ac if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_directory`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_traverse_directory`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_traverse_directory`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_traverse_directory`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -665,10 +676,6 @@ def graph_user_traverse_directory_with_http_info(self, user_id, content_type, ac header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -678,10 +685,6 @@ def graph_user_traverse_directory_with_http_info(self, user_id, content_type, ac header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -701,57 +704,53 @@ def graph_user_traverse_directory_with_http_info(self, user_id, content_type, ac _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_traverse_g_suite(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_g_suite(self, user_id, **kwargs): # noqa: E501 """List the G Suite instances bound to a User # noqa: E501 This endpoint will return all G-Suite Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_g_suite(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_g_suite(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_traverse_g_suite_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_traverse_g_suite_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_traverse_g_suite_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_traverse_g_suite_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_traverse_g_suite_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_g_suite_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the G Suite instances bound to a User # noqa: E501 This endpoint will return all G-Suite Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_g_suite_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_g_suite_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['user_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -770,17 +769,7 @@ def graph_user_traverse_g_suite_with_http_info(self, user_id, content_type, acce if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_g_suite`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_traverse_g_suite`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_traverse_g_suite`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_traverse_g_suite`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -799,10 +788,6 @@ def graph_user_traverse_g_suite_with_http_info(self, user_id, content_type, acce header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -812,10 +797,6 @@ def graph_user_traverse_g_suite_with_http_info(self, user_id, content_type, acce header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -835,57 +816,53 @@ def graph_user_traverse_g_suite_with_http_info(self, user_id, content_type, acce _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_traverse_ldap_server(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_ldap_server(self, user_id, **kwargs): # noqa: E501 """List the LDAP servers bound to a User # noqa: E501 This endpoint will return all LDAP Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_ldap_server(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_ldap_server(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_traverse_ldap_server_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_traverse_ldap_server_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_traverse_ldap_server_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_traverse_ldap_server_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_traverse_ldap_server_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_ldap_server_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the LDAP servers bound to a User # noqa: E501 This endpoint will return all LDAP Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_ldap_server_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_ldap_server_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['user_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -904,17 +881,7 @@ def graph_user_traverse_ldap_server_with_http_info(self, user_id, content_type, if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_ldap_server`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_traverse_ldap_server`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_traverse_ldap_server`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_traverse_ldap_server`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -933,10 +900,6 @@ def graph_user_traverse_ldap_server_with_http_info(self, user_id, content_type, header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -946,10 +909,6 @@ def graph_user_traverse_ldap_server_with_http_info(self, user_id, content_type, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -969,57 +928,53 @@ def graph_user_traverse_ldap_server_with_http_info(self, user_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_traverse_office365(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_office365(self, user_id, **kwargs): # noqa: E501 """List the Office 365 instances bound to a User # noqa: E501 This endpoint will return all Office 365 Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_office365(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_office365(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_traverse_office365_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_traverse_office365_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_traverse_office365_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_traverse_office365_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_traverse_office365_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_office365_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the Office 365 instances bound to a User # noqa: E501 This endpoint will return all Office 365 Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_office365_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_office365_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['user_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1038,17 +993,7 @@ def graph_user_traverse_office365_with_http_info(self, user_id, content_type, ac if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_office365`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_traverse_office365`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_traverse_office365`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_traverse_office365`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1067,10 +1012,6 @@ def graph_user_traverse_office365_with_http_info(self, user_id, content_type, ac header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1080,10 +1021,6 @@ def graph_user_traverse_office365_with_http_info(self, user_id, content_type, ac header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1103,57 +1040,53 @@ def graph_user_traverse_office365_with_http_info(self, user_id, content_type, ac _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_traverse_radius_server(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_radius_server(self, user_id, **kwargs): # noqa: E501 """List the RADIUS Servers bound to a User # noqa: E501 This endpoint will return all RADIUS Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_radius_server(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_radius_server(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_traverse_radius_server_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_traverse_radius_server_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_traverse_radius_server_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_traverse_radius_server_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_traverse_radius_server_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_radius_server_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the RADIUS Servers bound to a User # noqa: E501 This endpoint will return all RADIUS Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_radius_server_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_radius_server_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['user_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1172,17 +1105,7 @@ def graph_user_traverse_radius_server_with_http_info(self, user_id, content_type if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_radius_server`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_traverse_radius_server`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_traverse_radius_server`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_traverse_radius_server`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1201,10 +1124,6 @@ def graph_user_traverse_radius_server_with_http_info(self, user_id, content_type header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1214,10 +1133,6 @@ def graph_user_traverse_radius_server_with_http_info(self, user_id, content_type header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1237,57 +1152,53 @@ def graph_user_traverse_radius_server_with_http_info(self, user_id, content_type _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_traverse_system(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_system(self, user_id, **kwargs): # noqa: E501 """List the Systems bound to a User # noqa: E501 This endpoint will return all Systems bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systems\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_system(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_system(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_traverse_system_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_traverse_system_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_traverse_system_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_traverse_system_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_traverse_system_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_system_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the Systems bound to a User # noqa: E501 This endpoint will return all Systems bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systems\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_system_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_system_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['user_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1306,17 +1217,7 @@ def graph_user_traverse_system_with_http_info(self, user_id, content_type, accep if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_system`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_traverse_system`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_traverse_system`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_traverse_system`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1335,10 +1236,6 @@ def graph_user_traverse_system_with_http_info(self, user_id, content_type, accep header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1348,10 +1245,6 @@ def graph_user_traverse_system_with_http_info(self, user_id, content_type, accep header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1371,57 +1264,53 @@ def graph_user_traverse_system_with_http_info(self, user_id, content_type, accep _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def graph_user_traverse_system_group(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_system_group(self, user_id, **kwargs): # noqa: E501 """List the System Groups bound to a User # noqa: E501 This endpoint will return all System Groups bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systemgroups\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_system_group(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_system_group(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.graph_user_traverse_system_group_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.graph_user_traverse_system_group_with_http_info(user_id, **kwargs) # noqa: E501 else: - (data) = self.graph_user_traverse_system_group_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.graph_user_traverse_system_group_with_http_info(user_id, **kwargs) # noqa: E501 return data - def graph_user_traverse_system_group_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 + def graph_user_traverse_system_group_with_http_info(self, user_id, **kwargs): # noqa: E501 """List the System Groups bound to a User # noqa: E501 This endpoint will return all System Groups bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systemgroups\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.graph_user_traverse_system_group_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.graph_user_traverse_system_group_with_http_info(user_id, async_req=True) >>> result = thread.get() :param async_req bool :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :param int skip: The offset into the records to return. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` :return: list[GraphObjectWithPaths] If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 + all_params = ['user_id', 'limit', 'x_org_id', 'skip', 'filter'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1440,17 +1329,7 @@ def graph_user_traverse_system_group_with_http_info(self, user_id, content_type, if ('user_id' not in params or params['user_id'] is None): raise ValueError("Missing the required parameter `user_id` when calling `graph_user_traverse_system_group`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `graph_user_traverse_system_group`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `graph_user_traverse_system_group`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `graph_user_traverse_system_group`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1469,10 +1348,6 @@ def graph_user_traverse_system_group_with_http_info(self, user_id, content_type, header_params = {} if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -1482,10 +1357,6 @@ def graph_user_traverse_system_group_with_http_info(self, user_id, content_type, header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -1505,53 +1376,49 @@ def graph_user_traverse_system_group_with_http_info(self, user_id, content_type, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def users_send_emails(self, user_id, content_type, accept, **kwargs): # noqa: E501 - """Send User Emails # noqa: E501 + def push_endpoints_delete(self, user_id, push_endpoint_id, **kwargs): # noqa: E501 + """Delete a Push Endpoint associated with a User # noqa: E501 - This endpoint allows you to send a specific email to a user without waiting for or triggering a workflow. # noqa: E501 + This endpoint will delete a push endpoint associated with a user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.users_send_emails(user_id, content_type, accept, async_req=True) + >>> thread = api.push_endpoints_delete(user_id, push_endpoint_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) - :param Emailrequest body: - :param str x_org_id: - :return: None + :param str user_id: (required) + :param str push_endpoint_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: PushEndpointResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.users_send_emails_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + return self.push_endpoints_delete_with_http_info(user_id, push_endpoint_id, **kwargs) # noqa: E501 else: - (data) = self.users_send_emails_with_http_info(user_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.push_endpoints_delete_with_http_info(user_id, push_endpoint_id, **kwargs) # noqa: E501 return data - def users_send_emails_with_http_info(self, user_id, content_type, accept, **kwargs): # noqa: E501 - """Send User Emails # noqa: E501 + def push_endpoints_delete_with_http_info(self, user_id, push_endpoint_id, **kwargs): # noqa: E501 + """Delete a Push Endpoint associated with a User # noqa: E501 - This endpoint allows you to send a specific email to a user without waiting for or triggering a workflow. # noqa: E501 + This endpoint will delete a push endpoint associated with a user. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.users_send_emails_with_http_info(user_id, content_type, accept, async_req=True) + >>> thread = api.push_endpoints_delete_with_http_info(user_id, push_endpoint_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str user_id: ObjectID of the User. (required) - :param str content_type: (required) - :param str accept: (required) - :param Emailrequest body: - :param str x_org_id: - :return: None + :param str user_id: (required) + :param str push_endpoint_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: PushEndpointResponse If the method is called asynchronously, returns the request thread. """ - all_params = ['user_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['user_id', 'push_endpoint_id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1562,36 +1429,345 @@ def users_send_emails_with_http_info(self, user_id, content_type, accept, **kwar if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method users_send_emails" % key + " to method push_endpoints_delete" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'user_id' is set if ('user_id' not in params or params['user_id'] is None): - raise ValueError("Missing the required parameter `user_id` when calling `users_send_emails`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `users_send_emails`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `users_send_emails`") # noqa: E501 + raise ValueError("Missing the required parameter `user_id` when calling `push_endpoints_delete`") # noqa: E501 + # verify the required parameter 'push_endpoint_id' is set + if ('push_endpoint_id' not in params or + params['push_endpoint_id'] is None): + raise ValueError("Missing the required parameter `push_endpoint_id` when calling `push_endpoints_delete`") # noqa: E501 collection_formats = {} path_params = {} if 'user_id' in params: path_params['user_id'] = params['user_id'] # noqa: E501 + if 'push_endpoint_id' in params: + path_params['push_endpoint_id'] = params['push_endpoint_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/users/{user_id}/pushendpoints/{push_endpoint_id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PushEndpointResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def push_endpoints_get(self, user_id, push_endpoint_id, **kwargs): # noqa: E501 + """Get a push endpoint associated with a User # noqa: E501 + + This endpoint will retrieve a push endpoint associated with a user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.push_endpoints_get(user_id, push_endpoint_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_id: (required) + :param str push_endpoint_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: PushEndpointResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.push_endpoints_get_with_http_info(user_id, push_endpoint_id, **kwargs) # noqa: E501 + else: + (data) = self.push_endpoints_get_with_http_info(user_id, push_endpoint_id, **kwargs) # noqa: E501 + return data + + def push_endpoints_get_with_http_info(self, user_id, push_endpoint_id, **kwargs): # noqa: E501 + """Get a push endpoint associated with a User # noqa: E501 + + This endpoint will retrieve a push endpoint associated with a user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.push_endpoints_get_with_http_info(user_id, push_endpoint_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_id: (required) + :param str push_endpoint_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: PushEndpointResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['user_id', 'push_endpoint_id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method push_endpoints_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'user_id' is set + if ('user_id' not in params or + params['user_id'] is None): + raise ValueError("Missing the required parameter `user_id` when calling `push_endpoints_get`") # noqa: E501 + # verify the required parameter 'push_endpoint_id' is set + if ('push_endpoint_id' not in params or + params['push_endpoint_id'] is None): + raise ValueError("Missing the required parameter `push_endpoint_id` when calling `push_endpoints_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_id' in params: + path_params['user_id'] = params['user_id'] # noqa: E501 + if 'push_endpoint_id' in params: + path_params['push_endpoint_id'] = params['push_endpoint_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/users/{user_id}/pushendpoints/{push_endpoint_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PushEndpointResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def push_endpoints_list(self, user_id, **kwargs): # noqa: E501 + """List Push Endpoints associated with a User # noqa: E501 + + This endpoint returns the list of push endpoints associated with a user. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/pushendpoints \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: ${API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.push_endpoints_list(user_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[PushEndpointResponse] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.push_endpoints_list_with_http_info(user_id, **kwargs) # noqa: E501 + else: + (data) = self.push_endpoints_list_with_http_info(user_id, **kwargs) # noqa: E501 + return data + + def push_endpoints_list_with_http_info(self, user_id, **kwargs): # noqa: E501 + """List Push Endpoints associated with a User # noqa: E501 + + This endpoint returns the list of push endpoints associated with a user. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/pushendpoints \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: ${API_KEY}' ``` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.push_endpoints_list_with_http_info(user_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_id: (required) + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: list[PushEndpointResponse] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['user_id', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method push_endpoints_list" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'user_id' is set + if ('user_id' not in params or + params['user_id'] is None): + raise ValueError("Missing the required parameter `user_id` when calling `push_endpoints_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_id' in params: + path_params['user_id'] = params['user_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'x_org_id' in params: + header_params['x-org-id'] = params['x_org_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['x-api-key'] # noqa: E501 + + return self.api_client.call_api( + '/users/{user_id}/pushendpoints', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[PushEndpointResponse]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def push_endpoints_patch(self, user_id, push_endpoint_id, **kwargs): # noqa: E501 + """Update a push endpoint associated with a User # noqa: E501 + + This endpoint will update a push endpoint associated with a user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.push_endpoints_patch(user_id, push_endpoint_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_id: (required) + :param str push_endpoint_id: (required) + :param PushendpointsPushEndpointIdBody body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: PushEndpointResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.push_endpoints_patch_with_http_info(user_id, push_endpoint_id, **kwargs) # noqa: E501 + else: + (data) = self.push_endpoints_patch_with_http_info(user_id, push_endpoint_id, **kwargs) # noqa: E501 + return data + + def push_endpoints_patch_with_http_info(self, user_id, push_endpoint_id, **kwargs): # noqa: E501 + """Update a push endpoint associated with a User # noqa: E501 + + This endpoint will update a push endpoint associated with a user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.push_endpoints_patch_with_http_info(user_id, push_endpoint_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str user_id: (required) + :param str push_endpoint_id: (required) + :param PushendpointsPushEndpointIdBody body: + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: PushEndpointResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['user_id', 'push_endpoint_id', 'body', 'x_org_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method push_endpoints_patch" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'user_id' is set + if ('user_id' not in params or + params['user_id'] is None): + raise ValueError("Missing the required parameter `user_id` when calling `push_endpoints_patch`") # noqa: E501 + # verify the required parameter 'push_endpoint_id' is set + if ('push_endpoint_id' not in params or + params['push_endpoint_id'] is None): + raise ValueError("Missing the required parameter `push_endpoint_id` when calling `push_endpoints_patch`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'user_id' in params: + path_params['user_id'] = params['user_id'] # noqa: E501 + if 'push_endpoint_id' in params: + path_params['push_endpoint_id'] = params['push_endpoint_id'] # noqa: E501 query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1613,14 +1789,14 @@ def users_send_emails_with_http_info(self, user_id, content_type, accept, **kwar auth_settings = ['x-api-key'] # noqa: E501 return self.api_client.call_api( - '/users/{user_id}/emails', 'POST', + '/users/{user_id}/pushendpoints/{push_endpoint_id}', 'PATCH', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='PushEndpointResponse', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/jcapiv2/jcapiv2/api/workday_import_api.py b/jcapiv2/jcapiv2/api/workday_import_api.py index 273ffdb..622b55d 100644 --- a/jcapiv2/jcapiv2/api/workday_import_api.py +++ b/jcapiv2/jcapiv2/api/workday_import_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import re # noqa: F401 @@ -33,53 +32,49 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def workdays_authorize(self, workday_id, content_type, accept, **kwargs): # noqa: E501 + def workdays_authorize(self, workday_id, **kwargs): # noqa: E501 """Authorize Workday # noqa: E501 This endpoint adds an authorization method to a workday instance. You must supply a username and password for `Basic Authentication` that is the same as your WorkDay Integrator System User. Failure to provide these credentials will result in the request being rejected. Currently `O-Auth` isn't a supported authentication protocol for WorkDay, but will be in the future. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/auth \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"auth\":{ \"basic\": { \"username\": \"someDeveloper\", \"password\": \"notTheRealPassword\" } } }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_authorize(workday_id, content_type, accept, async_req=True) + >>> thread = api.workdays_authorize(workday_id, async_req=True) >>> result = thread.get() :param async_req bool :param str workday_id: (required) - :param str content_type: (required) - :param str accept: (required) :param AuthInputObject body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.workdays_authorize_with_http_info(workday_id, content_type, accept, **kwargs) # noqa: E501 + return self.workdays_authorize_with_http_info(workday_id, **kwargs) # noqa: E501 else: - (data) = self.workdays_authorize_with_http_info(workday_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.workdays_authorize_with_http_info(workday_id, **kwargs) # noqa: E501 return data - def workdays_authorize_with_http_info(self, workday_id, content_type, accept, **kwargs): # noqa: E501 + def workdays_authorize_with_http_info(self, workday_id, **kwargs): # noqa: E501 """Authorize Workday # noqa: E501 This endpoint adds an authorization method to a workday instance. You must supply a username and password for `Basic Authentication` that is the same as your WorkDay Integrator System User. Failure to provide these credentials will result in the request being rejected. Currently `O-Auth` isn't a supported authentication protocol for WorkDay, but will be in the future. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/auth \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"auth\":{ \"basic\": { \"username\": \"someDeveloper\", \"password\": \"notTheRealPassword\" } } }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_authorize_with_http_info(workday_id, content_type, accept, async_req=True) + >>> thread = api.workdays_authorize_with_http_info(workday_id, async_req=True) >>> result = thread.get() :param async_req bool :param str workday_id: (required) - :param str content_type: (required) - :param str accept: (required) :param AuthInputObject body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['workday_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['workday_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -98,14 +93,6 @@ def workdays_authorize_with_http_info(self, workday_id, content_type, accept, ** if ('workday_id' not in params or params['workday_id'] is None): raise ValueError("Missing the required parameter `workday_id` when calling `workdays_authorize`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `workdays_authorize`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `workdays_authorize`") # noqa: E501 collection_formats = {} @@ -116,10 +103,6 @@ def workdays_authorize_with_http_info(self, workday_id, content_type, accept, ** query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -129,10 +112,6 @@ def workdays_authorize_with_http_info(self, workday_id, content_type, accept, ** body_params = None if 'body' in params: body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 @@ -156,51 +135,47 @@ def workdays_authorize_with_http_info(self, workday_id, content_type, accept, ** _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def workdays_deauthorize(self, workday_id, content_type, accept, **kwargs): # noqa: E501 + def workdays_deauthorize(self, workday_id, **kwargs): # noqa: E501 """Deauthorize Workday # noqa: E501 Removes any and all authorization methods from the workday instance ##### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/auth \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_deauthorize(workday_id, content_type, accept, async_req=True) + >>> thread = api.workdays_deauthorize(workday_id, async_req=True) >>> result = thread.get() :param async_req bool :param str workday_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.workdays_deauthorize_with_http_info(workday_id, content_type, accept, **kwargs) # noqa: E501 + return self.workdays_deauthorize_with_http_info(workday_id, **kwargs) # noqa: E501 else: - (data) = self.workdays_deauthorize_with_http_info(workday_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.workdays_deauthorize_with_http_info(workday_id, **kwargs) # noqa: E501 return data - def workdays_deauthorize_with_http_info(self, workday_id, content_type, accept, **kwargs): # noqa: E501 + def workdays_deauthorize_with_http_info(self, workday_id, **kwargs): # noqa: E501 """Deauthorize Workday # noqa: E501 Removes any and all authorization methods from the workday instance ##### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/auth \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_deauthorize_with_http_info(workday_id, content_type, accept, async_req=True) + >>> thread = api.workdays_deauthorize_with_http_info(workday_id, async_req=True) >>> result = thread.get() :param async_req bool :param str workday_id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['workday_id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['workday_id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -219,14 +194,6 @@ def workdays_deauthorize_with_http_info(self, workday_id, content_type, accept, if ('workday_id' not in params or params['workday_id'] is None): raise ValueError("Missing the required parameter `workday_id` when calling `workdays_deauthorize`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `workdays_deauthorize`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `workdays_deauthorize`") # noqa: E501 collection_formats = {} @@ -237,10 +204,6 @@ def workdays_deauthorize_with_http_info(self, workday_id, content_type, accept, query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -248,14 +211,6 @@ def workdays_deauthorize_with_http_info(self, workday_id, content_type, accept, local_var_files = {} body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -275,170 +230,47 @@ def workdays_deauthorize_with_http_info(self, workday_id, content_type, accept, _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def workdays_delete(self, id, content_type, accept, **kwargs): # noqa: E501 - """Delete Workday # noqa: E501 - - This endpoint allows you to delete an instance of Workday. **This functionality is currently not enable for users.** # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_delete(id, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.workdays_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 - else: - (data) = self.workdays_delete_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 - return data - - def workdays_delete_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 - """Delete Workday # noqa: E501 - - This endpoint allows you to delete an instance of Workday. **This functionality is currently not enable for users.** # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_delete_with_http_info(id, content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method workdays_delete" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `workdays_delete`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `workdays_delete`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `workdays_delete`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - if 'x_org_id' in params: - header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/workdays/{id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def workdays_get(self, id, content_type, accept, **kwargs): # noqa: E501 + def workdays_get(self, id, **kwargs): # noqa: E501 """Get Workday # noqa: E501 This endpoint will return all the available information about an instance of Workday. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_get(id, content_type, accept, async_req=True) + >>> thread = api.workdays_get(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: WorkdayOutput If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.workdays_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.workdays_get_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.workdays_get_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.workdays_get_with_http_info(id, **kwargs) # noqa: E501 return data - def workdays_get_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def workdays_get_with_http_info(self, id, **kwargs): # noqa: E501 """Get Workday # noqa: E501 This endpoint will return all the available information about an instance of Workday. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_get_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.workdays_get_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: WorkdayOutput If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'x_org_id'] # noqa: E501 + all_params = ['id', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -457,14 +289,6 @@ def workdays_get_with_http_info(self, id, content_type, accept, **kwargs): # no if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `workdays_get`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `workdays_get`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `workdays_get`") # noqa: E501 collection_formats = {} @@ -475,10 +299,6 @@ def workdays_get_with_http_info(self, id, content_type, accept, **kwargs): # no query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -490,10 +310,6 @@ def workdays_get_with_http_info(self, id, content_type, accept, **kwargs): # no header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -513,53 +329,49 @@ def workdays_get_with_http_info(self, id, content_type, accept, **kwargs): # no _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def workdays_import(self, workday_id, content_type, accept, **kwargs): # noqa: E501 + def workdays_import(self, workday_id, **kwargs): # noqa: E501 """Workday Import # noqa: E501 The endpoint allows you to create a Workday Import request. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/{WorkdayID}/import \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"email\":\"{email}\", \"firstname\":\"{firstname}\", \"lastname\":\"{firstname}\", \"username\":\"{username}\", \"attributes\":[ {\"name\":\"EmployeeID\",\"value\":\"0000\"}, {\"name\":\"WorkdayID\",\"value\":\"name.name\"} ] } ] ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_import(workday_id, content_type, accept, async_req=True) + >>> thread = api.workdays_import(workday_id, async_req=True) >>> result = thread.get() :param async_req bool :param str workday_id: (required) - :param str content_type: (required) - :param str accept: (required) :param list[BulkUserCreate] body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: JobId If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.workdays_import_with_http_info(workday_id, content_type, accept, **kwargs) # noqa: E501 + return self.workdays_import_with_http_info(workday_id, **kwargs) # noqa: E501 else: - (data) = self.workdays_import_with_http_info(workday_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.workdays_import_with_http_info(workday_id, **kwargs) # noqa: E501 return data - def workdays_import_with_http_info(self, workday_id, content_type, accept, **kwargs): # noqa: E501 + def workdays_import_with_http_info(self, workday_id, **kwargs): # noqa: E501 """Workday Import # noqa: E501 The endpoint allows you to create a Workday Import request. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/{WorkdayID}/import \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"email\":\"{email}\", \"firstname\":\"{firstname}\", \"lastname\":\"{firstname}\", \"username\":\"{username}\", \"attributes\":[ {\"name\":\"EmployeeID\",\"value\":\"0000\"}, {\"name\":\"WorkdayID\",\"value\":\"name.name\"} ] } ] ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_import_with_http_info(workday_id, content_type, accept, async_req=True) + >>> thread = api.workdays_import_with_http_info(workday_id, async_req=True) >>> result = thread.get() :param async_req bool :param str workday_id: (required) - :param str content_type: (required) - :param str accept: (required) :param list[BulkUserCreate] body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: JobId If the method is called asynchronously, returns the request thread. """ - all_params = ['workday_id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['workday_id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -578,14 +390,6 @@ def workdays_import_with_http_info(self, workday_id, content_type, accept, **kwa if ('workday_id' not in params or params['workday_id'] is None): raise ValueError("Missing the required parameter `workday_id` when calling `workdays_import`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `workdays_import`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `workdays_import`") # noqa: E501 collection_formats = {} @@ -596,10 +400,6 @@ def workdays_import_with_http_info(self, workday_id, content_type, accept, **kwa query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -636,57 +436,53 @@ def workdays_import_with_http_info(self, workday_id, content_type, accept, **kwa _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def workdays_importresults(self, id, job_id, content_type, accept, **kwargs): # noqa: E501 + def workdays_importresults(self, id, job_id, **kwargs): # noqa: E501 """List Import Results # noqa: E501 This endpoint provides a list of job results from the workday import and will contain all imported data from Workday. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/{WorkdayID}/import/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_importresults(id, job_id, content_type, accept, async_req=True) + >>> thread = api.workdays_importresults(id, job_id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) :param str job_id: (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[JobWorkresult] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.workdays_importresults_with_http_info(id, job_id, content_type, accept, **kwargs) # noqa: E501 + return self.workdays_importresults_with_http_info(id, job_id, **kwargs) # noqa: E501 else: - (data) = self.workdays_importresults_with_http_info(id, job_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.workdays_importresults_with_http_info(id, job_id, **kwargs) # noqa: E501 return data - def workdays_importresults_with_http_info(self, id, job_id, content_type, accept, **kwargs): # noqa: E501 + def workdays_importresults_with_http_info(self, id, job_id, **kwargs): # noqa: E501 """List Import Results # noqa: E501 This endpoint provides a list of job results from the workday import and will contain all imported data from Workday. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/{WorkdayID}/import/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_importresults_with_http_info(id, job_id, content_type, accept, async_req=True) + >>> thread = api.workdays_importresults_with_http_info(id, job_id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) :param str job_id: (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[JobWorkresult] If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'job_id', 'content_type', 'accept', 'limit', 'skip', 'x_org_id'] # noqa: E501 + all_params = ['id', 'job_id', 'limit', 'skip', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -709,17 +505,7 @@ def workdays_importresults_with_http_info(self, id, job_id, content_type, accept if ('job_id' not in params or params['job_id'] is None): raise ValueError("Missing the required parameter `job_id` when calling `workdays_importresults`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `workdays_importresults`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `workdays_importresults`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `workdays_importresults`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -735,10 +521,6 @@ def workdays_importresults_with_http_info(self, id, job_id, content_type, accept query_params.append(('skip', params['skip'])) # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -750,10 +532,6 @@ def workdays_importresults_with_http_info(self, id, job_id, content_type, accept header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -773,59 +551,55 @@ def workdays_importresults_with_http_info(self, id, job_id, content_type, accept _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def workdays_list(self, content_type, accept, **kwargs): # noqa: E501 + def workdays_list(self, **kwargs): # noqa: E501 """List Workdays # noqa: E501 This endpoint will return all the available information about all your instances of Workday. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_list(content_type, accept, async_req=True) + >>> thread = api.workdays_list(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param str x_org_id: + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[WorkdayOutput] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.workdays_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.workdays_list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.workdays_list_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.workdays_list_with_http_info(**kwargs) # noqa: E501 return data - def workdays_list_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def workdays_list_with_http_info(self, **kwargs): # noqa: E501 """List Workdays # noqa: E501 This endpoint will return all the available information about all your instances of Workday. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_list_with_http_info(content_type, accept, async_req=True) + >>> thread = api.workdays_list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param list[str] fields: The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param list[str] filter: Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - :param str x_org_id: + :param list[str] filter: A filter to apply to the query. **Filter structure**: `::`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[WorkdayOutput] If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'fields', 'limit', 'skip', 'sort', 'filter', 'x_org_id'] # noqa: E501 + all_params = ['fields', 'limit', 'skip', 'sort', 'filter', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -840,17 +614,7 @@ def workdays_list_with_http_info(self, content_type, accept, **kwargs): # noqa: ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `workdays_list`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `workdays_list`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `workdays_list`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -871,10 +635,6 @@ def workdays_list_with_http_info(self, content_type, accept, **kwargs): # noqa: collection_formats['filter'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -886,10 +646,6 @@ def workdays_list_with_http_info(self, content_type, accept, **kwargs): # noqa: header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 @@ -909,51 +665,47 @@ def workdays_list_with_http_info(self, content_type, accept, **kwargs): # noqa: _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def workdays_post(self, content_type, accept, **kwargs): # noqa: E501 + def workdays_post(self, **kwargs): # noqa: E501 """Create new Workday # noqa: E501 - This endpoint allows you to create a new workday instance. You must supply a username and password for `Basic Authentication` that is the same as your WorkDay Integrator System User. Failure to provide these credentials will result in the request being rejected. Currently `O-Auth` isn't a supported authentication protocol for WorkDay, but will be in the future. Currently, only one instance is allowed and it must be `Workday Import`. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Workday2\", \"reportUrl\":\"https://workday.com/ccx/service/customreport2/gms/user/reportname?format=json\", \"auth\": { \"basic\": { \"username\": \"someDeveloper\", \"password\": \"notTheRealPassword\" } } }' ``` # noqa: E501 + This endpoint allows you to create a new workday instance. You must supply a username and password for `Basic Authentication` that is the same as your WorkDay Integrator System User. Failure to provide these credentials will result in the request being rejected. Currently `O-Auth` isn't a supported authentication protocol for WorkDay, but will be in the future. Currently, only one instance is allowed and it must be `Workday Import`. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Workday2\", \"reportUrl\":\"https://workday.com/ccx/service/customreport2/gms/user/reportname?format=json\", \"auth\": { \"basic\": { \"username\": \"someDeveloper\", \"password\": \"notTheRealPassword\" } } }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_post(content_type, accept, async_req=True) + >>> thread = api.workdays_post(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param WorkdayInput body: - :param str x_org_id: - :return: None + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: WorkdayOutput If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.workdays_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + return self.workdays_post_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.workdays_post_with_http_info(content_type, accept, **kwargs) # noqa: E501 + (data) = self.workdays_post_with_http_info(**kwargs) # noqa: E501 return data - def workdays_post_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 + def workdays_post_with_http_info(self, **kwargs): # noqa: E501 """Create new Workday # noqa: E501 - This endpoint allows you to create a new workday instance. You must supply a username and password for `Basic Authentication` that is the same as your WorkDay Integrator System User. Failure to provide these credentials will result in the request being rejected. Currently `O-Auth` isn't a supported authentication protocol for WorkDay, but will be in the future. Currently, only one instance is allowed and it must be `Workday Import`. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Workday2\", \"reportUrl\":\"https://workday.com/ccx/service/customreport2/gms/user/reportname?format=json\", \"auth\": { \"basic\": { \"username\": \"someDeveloper\", \"password\": \"notTheRealPassword\" } } }' ``` # noqa: E501 + This endpoint allows you to create a new workday instance. You must supply a username and password for `Basic Authentication` that is the same as your WorkDay Integrator System User. Failure to provide these credentials will result in the request being rejected. Currently `O-Auth` isn't a supported authentication protocol for WorkDay, but will be in the future. Currently, only one instance is allowed and it must be `Workday Import`. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Workday2\", \"reportUrl\":\"https://workday.com/ccx/service/customreport2/gms/user/reportname?format=json\", \"auth\": { \"basic\": { \"username\": \"someDeveloper\", \"password\": \"notTheRealPassword\" } } }' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_post_with_http_info(content_type, accept, async_req=True) + >>> thread = api.workdays_post_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str content_type: (required) - :param str accept: (required) :param WorkdayInput body: - :param str x_org_id: - :return: None + :param str x_org_id: Organization identifier that can be obtained from console settings. + :return: WorkdayOutput If the method is called asynchronously, returns the request thread. """ - all_params = ['content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -968,14 +720,6 @@ def workdays_post_with_http_info(self, content_type, accept, **kwargs): # noqa: ) params[key] = val del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `workdays_post`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `workdays_post`") # noqa: E501 collection_formats = {} @@ -984,10 +728,6 @@ def workdays_post_with_http_info(self, content_type, accept, **kwargs): # noqa: query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1016,7 +756,7 @@ def workdays_post_with_http_info(self, content_type, accept, **kwargs): # noqa: body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='WorkdayOutput', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1024,53 +764,49 @@ def workdays_post_with_http_info(self, content_type, accept, **kwargs): # noqa: _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def workdays_put(self, id, content_type, accept, **kwargs): # noqa: E501 + def workdays_put(self, id, **kwargs): # noqa: E501 """Update Workday # noqa: E501 This endpoint allows you to update the name and Custom Report URL for a Workday Instance. Currently, the name can not be changed from the default of `Workday Import`. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/workdays/{WorkdayID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"reportUrl\":\"{Report_URL}\", \"name\":\"{Name}\" } ' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_put(id, content_type, accept, async_req=True) + >>> thread = api.workdays_put(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :param WorkdayFields body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: WorkdayOutput If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.workdays_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + return self.workdays_put_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.workdays_put_with_http_info(id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.workdays_put_with_http_info(id, **kwargs) # noqa: E501 return data - def workdays_put_with_http_info(self, id, content_type, accept, **kwargs): # noqa: E501 + def workdays_put_with_http_info(self, id, **kwargs): # noqa: E501 """Update Workday # noqa: E501 This endpoint allows you to update the name and Custom Report URL for a Workday Instance. Currently, the name can not be changed from the default of `Workday Import`. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/workdays/{WorkdayID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"reportUrl\":\"{Report_URL}\", \"name\":\"{Name}\" } ' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_put_with_http_info(id, content_type, accept, async_req=True) + >>> thread = api.workdays_put_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param str id: (required) - :param str content_type: (required) - :param str accept: (required) :param WorkdayFields body: - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: WorkdayOutput If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'content_type', 'accept', 'body', 'x_org_id'] # noqa: E501 + all_params = ['id', 'body', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1089,14 +825,6 @@ def workdays_put_with_http_info(self, id, content_type, accept, **kwargs): # no if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `workdays_put`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `workdays_put`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `workdays_put`") # noqa: E501 collection_formats = {} @@ -1107,10 +835,6 @@ def workdays_put_with_http_info(self, id, content_type, accept, **kwargs): # no query_params = [] header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1147,172 +871,53 @@ def workdays_put_with_http_info(self, id, content_type, accept, **kwargs): # no _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def workdays_settings(self, content_type, accept, **kwargs): # noqa: E501 - """Get Workday Settings (incomplete) # noqa: E501 - - This endpoint allows you to obtain all settings needed for creating a workday instance, specifically the URL to initiate Basic Authentication with WorkDay. **This functionality is currently not enable for users.** # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_settings(content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param str state: - :param str x_org_id: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.workdays_settings_with_http_info(content_type, accept, **kwargs) # noqa: E501 - else: - (data) = self.workdays_settings_with_http_info(content_type, accept, **kwargs) # noqa: E501 - return data - - def workdays_settings_with_http_info(self, content_type, accept, **kwargs): # noqa: E501 - """Get Workday Settings (incomplete) # noqa: E501 - - This endpoint allows you to obtain all settings needed for creating a workday instance, specifically the URL to initiate Basic Authentication with WorkDay. **This functionality is currently not enable for users.** # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_settings_with_http_info(content_type, accept, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str content_type: (required) - :param str accept: (required) - :param str state: - :param str x_org_id: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['content_type', 'accept', 'state', 'x_org_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method workdays_settings" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `workdays_settings`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `workdays_settings`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'state' in params: - query_params.append(('state', params['state'])) # noqa: E501 - - header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 - if 'x_org_id' in params: - header_params['x-org-id'] = params['x_org_id'] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['x-api-key'] # noqa: E501 - - return self.api_client.call_api( - '/workdays/settings', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def workdays_workers(self, workday_id, content_type, accept, **kwargs): # noqa: E501 + def workdays_workers(self, workday_id, **kwargs): # noqa: E501 """List Workday Workers # noqa: E501 This endpoint will return all of the data in your WorkDay Custom Report that has been associated with your WorkDay Instance in JumpCloud. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/workers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_workers(workday_id, content_type, accept, async_req=True) + >>> thread = api.workdays_workers(workday_id, async_req=True) >>> result = thread.get() :param async_req bool :param str workday_id: (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[WorkdayWorker] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.workdays_workers_with_http_info(workday_id, content_type, accept, **kwargs) # noqa: E501 + return self.workdays_workers_with_http_info(workday_id, **kwargs) # noqa: E501 else: - (data) = self.workdays_workers_with_http_info(workday_id, content_type, accept, **kwargs) # noqa: E501 + (data) = self.workdays_workers_with_http_info(workday_id, **kwargs) # noqa: E501 return data - def workdays_workers_with_http_info(self, workday_id, content_type, accept, **kwargs): # noqa: E501 + def workdays_workers_with_http_info(self, workday_id, **kwargs): # noqa: E501 """List Workday Workers # noqa: E501 This endpoint will return all of the data in your WorkDay Custom Report that has been associated with your WorkDay Instance in JumpCloud. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/workers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.workdays_workers_with_http_info(workday_id, content_type, accept, async_req=True) + >>> thread = api.workdays_workers_with_http_info(workday_id, async_req=True) >>> result = thread.get() :param async_req bool :param str workday_id: (required) - :param str content_type: (required) - :param str accept: (required) :param int limit: The number of records to return at once. Limited to 100. :param int skip: The offset into the records to return. :param list[str] sort: The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - :param str x_org_id: + :param str x_org_id: Organization identifier that can be obtained from console settings. :return: list[WorkdayWorker] If the method is called asynchronously, returns the request thread. """ - all_params = ['workday_id', 'content_type', 'accept', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 + all_params = ['workday_id', 'limit', 'skip', 'sort', 'x_org_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1331,17 +936,7 @@ def workdays_workers_with_http_info(self, workday_id, content_type, accept, **kw if ('workday_id' not in params or params['workday_id'] is None): raise ValueError("Missing the required parameter `workday_id` when calling `workdays_workers`") # noqa: E501 - # verify the required parameter 'content_type' is set - if ('content_type' not in params or - params['content_type'] is None): - raise ValueError("Missing the required parameter `content_type` when calling `workdays_workers`") # noqa: E501 - # verify the required parameter 'accept' is set - if ('accept' not in params or - params['accept'] is None): - raise ValueError("Missing the required parameter `accept` when calling `workdays_workers`") # noqa: E501 - - if 'skip' in params and params['skip'] < 0: # noqa: E501 - raise ValueError("Invalid value for parameter `skip` when calling `workdays_workers`, must be a value greater than or equal to `0`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1358,10 +953,6 @@ def workdays_workers_with_http_info(self, workday_id, content_type, accept, **kw collection_formats['sort'] = 'csv' # noqa: E501 header_params = {} - if 'content_type' in params: - header_params['Content-Type'] = params['content_type'] # noqa: E501 - if 'accept' in params: - header_params['Accept'] = params['accept'] # noqa: E501 if 'x_org_id' in params: header_params['x-org-id'] = params['x_org_id'] # noqa: E501 @@ -1373,10 +964,6 @@ def workdays_workers_with_http_info(self, workday_id, content_type, accept, **kw header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['x-api-key'] # noqa: E501 diff --git a/jcapiv2/jcapiv2/api_client.py b/jcapiv2/jcapiv2/api_client.py index 8274cba..9809b65 100644 --- a/jcapiv2/jcapiv2/api_client.py +++ b/jcapiv2/jcapiv2/api_client.py @@ -1,14 +1,13 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import datetime @@ -73,7 +72,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'Swagger-Codegen/4.0.0/python' + self.user_agent = 'Swagger-Codegen/5.0.0/python' def __del__(self): self.pool.close() @@ -524,10 +523,14 @@ def __deserialize_file(self, response): filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).group(1) path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - f.write(response.data) - + response_data = response.data + with open(path, "wb") as f: + if isinstance(response_data, str): + # change str to bytes so we can write it + response_data = response_data.encode('utf-8') + f.write(response_data) + else: + f.write(response_data) return path def __deserialize_primitive(self, data, klass): @@ -592,7 +595,7 @@ def __deserialize_datatime(self, string): ) def __hasattr(self, object, name): - return name in object.__class__.__dict__ + return name in object.__class__.__dict__ def __deserialize_model(self, data, klass): """Deserializes list or dict to model. @@ -602,8 +605,7 @@ def __deserialize_model(self, data, klass): :return: model object. """ - if (not klass.swagger_types and - not self.__hasattr(klass, 'get_real_child_model')): + if not klass.swagger_types and not self.__hasattr(klass, 'get_real_child_model'): return data kwargs = {} diff --git a/jcapiv2/jcapiv2/configuration.py b/jcapiv2/jcapiv2/configuration.py index 9d9f364..f2ff17d 100644 --- a/jcapiv2/jcapiv2/configuration.py +++ b/jcapiv2/jcapiv2/configuration.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import copy @@ -23,22 +22,29 @@ from six.moves import http_client as httplib -class Configuration(object): +class TypeWithDefault(type): + def __init__(cls, name, bases, dct): + super(TypeWithDefault, cls).__init__(name, bases, dct) + cls._default = None + + def __call__(cls): + if cls._default is None: + cls._default = type.__call__(cls) + return copy.copy(cls._default) + + def set_default(cls, default): + cls._default = copy.copy(default) + + +class Configuration(six.with_metaclass(TypeWithDefault, object)): """NOTE: This class is auto generated by the swagger code generator program. Ref: https://github.com/swagger-api/swagger-codegen Do not edit the class manually. """ - _default = None - def __init__(self): """Constructor""" - if self._default: - for key in self._default.__dict__.keys(): - self.__dict__[key] = copy.copy(self._default.__dict__[key]) - return - # Default Base url self.host = "https://console.jumpcloud.com/api/v2" # Temp file folder for downloading files @@ -49,11 +55,12 @@ def __init__(self): self.api_key = {} # dict to store API prefix (e.g. Bearer) self.api_key_prefix = {} + # function to refresh API key if expired + self.refresh_api_key_hook = None # Username for HTTP basic authentication self.username = "" # Password for HTTP basic authentication self.password = "" - # Logging Settings self.logger = {} self.logger["package_logger"] = logging.getLogger("jcapiv2") @@ -94,10 +101,6 @@ def __init__(self): # Safe chars for path_param self.safe_chars_for_path_param = '' - @classmethod - def set_default(cls, default): - cls._default = default - @property def logger_file(self): """The logger file. @@ -200,11 +203,16 @@ def get_api_key_with_prefix(self, identifier): :param identifier: The identifier of apiKey. :return: The token for api key authentication. """ - if (self.api_key.get(identifier) and - self.api_key_prefix.get(identifier)): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 - elif self.api_key.get(identifier): - return self.api_key[identifier] + if self.refresh_api_key_hook: + self.refresh_api_key_hook(self) + + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key def get_basic_auth_token(self): """Gets HTTP basic authentication header (string). @@ -228,7 +236,6 @@ def auth_settings(self): 'key': 'x-api-key', 'value': self.get_api_key_with_prefix('x-api-key') }, - } def to_debug_report(self): @@ -240,5 +247,5 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 2.0\n"\ - "SDK Package Version: 4.0.0".\ + "SDK Package Version: 5.0.0".\ format(env=sys.platform, pyversion=sys.version) diff --git a/jcapiv2/jcapiv2/models/__init__.py b/jcapiv2/jcapiv2/models/__init__.py index 3599d4d..4ededd0 100644 --- a/jcapiv2/jcapiv2/models/__init__.py +++ b/jcapiv2/jcapiv2/models/__init__.py @@ -2,79 +2,232 @@ # flake8: noqa """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import # import models into model package +from jcapiv2.models.ade import ADE +from jcapiv2.models.ades import ADES from jcapiv2.models.active_directory_agent_get_output import ActiveDirectoryAgentGetOutput from jcapiv2.models.active_directory_agent_input import ActiveDirectoryAgentInput from jcapiv2.models.active_directory_agent_list_output import ActiveDirectoryAgentListOutput from jcapiv2.models.active_directory_input import ActiveDirectoryInput +from jcapiv2.models.active_directory_output import ActiveDirectoryOutput +from jcapiv2.models.address import Address from jcapiv2.models.administrator import Administrator +from jcapiv2.models.administrator_organization_link import AdministratorOrganizationLink +from jcapiv2.models.administrator_organization_link_req import AdministratorOrganizationLinkReq +from jcapiv2.models.all_of_autotask_ticketing_alert_configuration_list_records_items import AllOfAutotaskTicketingAlertConfigurationListRecordsItems +from jcapiv2.models.all_of_connect_wise_ticketing_alert_configuration_list_records_items import AllOfConnectWiseTicketingAlertConfigurationListRecordsItems +from jcapiv2.models.any_value import AnyValue from jcapiv2.models.apple_mdm import AppleMDM +from jcapiv2.models.apple_mdm_device import AppleMdmDevice +from jcapiv2.models.apple_mdm_device_info import AppleMdmDeviceInfo +from jcapiv2.models.apple_mdm_device_security_info import AppleMdmDeviceSecurityInfo from jcapiv2.models.apple_mdm_patch_input import AppleMdmPatchInput +from jcapiv2.models.apple_mdm_public_key_cert import AppleMdmPublicKeyCert +from jcapiv2.models.apple_mdm_signed_csr_plist import AppleMdmSignedCsrPlist +from jcapiv2.models.application_id_logo_body import ApplicationIdLogoBody from jcapiv2.models.auth_info import AuthInfo from jcapiv2.models.auth_input import AuthInput from jcapiv2.models.auth_input_object import AuthInputObject from jcapiv2.models.authinput_basic import AuthinputBasic from jcapiv2.models.authinput_oauth import AuthinputOauth -from jcapiv2.models.body import Body -from jcapiv2.models.body1 import Body1 -from jcapiv2.models.body2 import Body2 -from jcapiv2.models.body3 import Body3 +from jcapiv2.models.authn_policy import AuthnPolicy +from jcapiv2.models.authn_policy_effect import AuthnPolicyEffect +from jcapiv2.models.authn_policy_input import AuthnPolicyInput +from jcapiv2.models.authn_policy_obligations import AuthnPolicyObligations +from jcapiv2.models.authn_policy_obligations_mfa import AuthnPolicyObligationsMfa +from jcapiv2.models.authn_policy_obligations_user_verification import AuthnPolicyObligationsUserVerification +from jcapiv2.models.authn_policy_resource_target import AuthnPolicyResourceTarget +from jcapiv2.models.authn_policy_targets import AuthnPolicyTargets +from jcapiv2.models.authn_policy_type import AuthnPolicyType +from jcapiv2.models.authn_policy_user_attribute_filter import AuthnPolicyUserAttributeFilter +from jcapiv2.models.authn_policy_user_attribute_target import AuthnPolicyUserAttributeTarget +from jcapiv2.models.authn_policy_user_group_target import AuthnPolicyUserGroupTarget +from jcapiv2.models.authn_policy_user_target import AuthnPolicyUserTarget +from jcapiv2.models.autotask_company import AutotaskCompany +from jcapiv2.models.autotask_company_resp import AutotaskCompanyResp +from jcapiv2.models.autotask_company_type_resp import AutotaskCompanyTypeResp +from jcapiv2.models.autotask_contract import AutotaskContract +from jcapiv2.models.autotask_contract_field import AutotaskContractField +from jcapiv2.models.autotask_contract_field_values import AutotaskContractFieldValues +from jcapiv2.models.autotask_integration import AutotaskIntegration +from jcapiv2.models.autotask_integration_patch_req import AutotaskIntegrationPatchReq +from jcapiv2.models.autotask_integration_req import AutotaskIntegrationReq +from jcapiv2.models.autotask_mapping_request import AutotaskMappingRequest +from jcapiv2.models.autotask_mapping_request_company import AutotaskMappingRequestCompany +from jcapiv2.models.autotask_mapping_request_contract import AutotaskMappingRequestContract +from jcapiv2.models.autotask_mapping_request_data import AutotaskMappingRequestData +from jcapiv2.models.autotask_mapping_request_organization import AutotaskMappingRequestOrganization +from jcapiv2.models.autotask_mapping_request_service import AutotaskMappingRequestService +from jcapiv2.models.autotask_mapping_response import AutotaskMappingResponse +from jcapiv2.models.autotask_mapping_response_company import AutotaskMappingResponseCompany +from jcapiv2.models.autotask_mapping_response_contract import AutotaskMappingResponseContract +from jcapiv2.models.autotask_mapping_response_organization import AutotaskMappingResponseOrganization +from jcapiv2.models.autotask_mapping_response_service import AutotaskMappingResponseService +from jcapiv2.models.autotask_service import AutotaskService +from jcapiv2.models.autotask_settings import AutotaskSettings +from jcapiv2.models.autotask_settings_patch_req import AutotaskSettingsPatchReq +from jcapiv2.models.autotask_ticketing_alert_configuration import AutotaskTicketingAlertConfiguration +from jcapiv2.models.autotask_ticketing_alert_configuration_list import AutotaskTicketingAlertConfigurationList +from jcapiv2.models.autotask_ticketing_alert_configuration_option import AutotaskTicketingAlertConfigurationOption +from jcapiv2.models.autotask_ticketing_alert_configuration_option_values import AutotaskTicketingAlertConfigurationOptionValues +from jcapiv2.models.autotask_ticketing_alert_configuration_options import AutotaskTicketingAlertConfigurationOptions +from jcapiv2.models.autotask_ticketing_alert_configuration_priority import AutotaskTicketingAlertConfigurationPriority +from jcapiv2.models.autotask_ticketing_alert_configuration_request import AutotaskTicketingAlertConfigurationRequest +from jcapiv2.models.autotask_ticketing_alert_configuration_resource import AutotaskTicketingAlertConfigurationResource +from jcapiv2.models.billing_integration_company_type import BillingIntegrationCompanyType +from jcapiv2.models.bulk_scheduled_statechange_create import BulkScheduledStatechangeCreate from jcapiv2.models.bulk_user_create import BulkUserCreate from jcapiv2.models.bulk_user_update import BulkUserUpdate +from jcapiv2.models.command_result_list import CommandResultList +from jcapiv2.models.command_result_list_results import CommandResultListResults +from jcapiv2.models.connect_wise_mapping_request import ConnectWiseMappingRequest +from jcapiv2.models.connect_wise_mapping_request_company import ConnectWiseMappingRequestCompany +from jcapiv2.models.connect_wise_mapping_request_data import ConnectWiseMappingRequestData +from jcapiv2.models.connect_wise_mapping_request_organization import ConnectWiseMappingRequestOrganization +from jcapiv2.models.connect_wise_mapping_response import ConnectWiseMappingResponse +from jcapiv2.models.connect_wise_mapping_response_addition import ConnectWiseMappingResponseAddition +from jcapiv2.models.connect_wise_settings import ConnectWiseSettings +from jcapiv2.models.connect_wise_settings_patch_req import ConnectWiseSettingsPatchReq +from jcapiv2.models.connect_wise_ticketing_alert_configuration import ConnectWiseTicketingAlertConfiguration +from jcapiv2.models.connect_wise_ticketing_alert_configuration_list import ConnectWiseTicketingAlertConfigurationList +from jcapiv2.models.connect_wise_ticketing_alert_configuration_option import ConnectWiseTicketingAlertConfigurationOption +from jcapiv2.models.connect_wise_ticketing_alert_configuration_options import ConnectWiseTicketingAlertConfigurationOptions +from jcapiv2.models.connect_wise_ticketing_alert_configuration_request import ConnectWiseTicketingAlertConfigurationRequest +from jcapiv2.models.connectwise_addition import ConnectwiseAddition +from jcapiv2.models.connectwise_agreement import ConnectwiseAgreement +from jcapiv2.models.connectwise_company import ConnectwiseCompany +from jcapiv2.models.connectwise_company_resp import ConnectwiseCompanyResp +from jcapiv2.models.connectwise_company_type_resp import ConnectwiseCompanyTypeResp +from jcapiv2.models.connectwise_integration import ConnectwiseIntegration +from jcapiv2.models.connectwise_integration_patch_req import ConnectwiseIntegrationPatchReq +from jcapiv2.models.connectwise_integration_req import ConnectwiseIntegrationReq +from jcapiv2.models.custom_email import CustomEmail +from jcapiv2.models.custom_email_template import CustomEmailTemplate +from jcapiv2.models.custom_email_template_field import CustomEmailTemplateField +from jcapiv2.models.custom_email_type import CustomEmailType +from jcapiv2.models.dep import DEP +from jcapiv2.models.dep_setup_assistant_option import DEPSetupAssistantOption +from jcapiv2.models.dep_welcome_screen import DEPWelcomeScreen +from jcapiv2.models.device_id_erase_body import DeviceIdEraseBody +from jcapiv2.models.device_id_lock_body import DeviceIdLockBody +from jcapiv2.models.device_id_restart_body import DeviceIdRestartBody from jcapiv2.models.directory import Directory from jcapiv2.models.duo_account import DuoAccount from jcapiv2.models.duo_application import DuoApplication from jcapiv2.models.duo_application_req import DuoApplicationReq from jcapiv2.models.duo_application_update_req import DuoApplicationUpdateReq -from jcapiv2.models.duo_registration_application import DuoRegistrationApplication -from jcapiv2.models.duo_registration_application_req import DuoRegistrationApplicationReq -from jcapiv2.models.emailrequest import Emailrequest -from jcapiv2.models.enrollment_profile import EnrollmentProfile from jcapiv2.models.error import Error -from jcapiv2.models.errorresponse import Errorresponse +from jcapiv2.models.error_details import ErrorDetails +from jcapiv2.models.feature import Feature +from jcapiv2.models.filter import Filter +from jcapiv2.models.filter_query import FilterQuery from jcapiv2.models.g_suite_builtin_translation import GSuiteBuiltinTranslation +from jcapiv2.models.g_suite_direction_translation import GSuiteDirectionTranslation from jcapiv2.models.g_suite_translation_rule import GSuiteTranslationRule from jcapiv2.models.g_suite_translation_rule_request import GSuiteTranslationRuleRequest +from jcapiv2.models.graph_attribute_ldap_groups import GraphAttributeLdapGroups +from jcapiv2.models.graph_attribute_posix_groups import GraphAttributePosixGroups +from jcapiv2.models.graph_attribute_posix_groups_posix_groups import GraphAttributePosixGroupsPosixGroups +from jcapiv2.models.graph_attribute_radius import GraphAttributeRadius +from jcapiv2.models.graph_attribute_radius_radius import GraphAttributeRadiusRadius +from jcapiv2.models.graph_attribute_radius_radius_reply import GraphAttributeRadiusRadiusReply +from jcapiv2.models.graph_attribute_samba_enabled import GraphAttributeSambaEnabled +from jcapiv2.models.graph_attribute_sudo import GraphAttributeSudo +from jcapiv2.models.graph_attribute_sudo_sudo import GraphAttributeSudoSudo +from jcapiv2.models.graph_attributes import GraphAttributes from jcapiv2.models.graph_connection import GraphConnection -from jcapiv2.models.graph_management_req import GraphManagementReq from jcapiv2.models.graph_object import GraphObject from jcapiv2.models.graph_object_with_paths import GraphObjectWithPaths +from jcapiv2.models.graph_operation import GraphOperation +from jcapiv2.models.graph_operation_active_directory import GraphOperationActiveDirectory +from jcapiv2.models.graph_operation_application import GraphOperationApplication +from jcapiv2.models.graph_operation_command import GraphOperationCommand +from jcapiv2.models.graph_operation_g_suite import GraphOperationGSuite +from jcapiv2.models.graph_operation_ldap_server import GraphOperationLdapServer +from jcapiv2.models.graph_operation_office365 import GraphOperationOffice365 +from jcapiv2.models.graph_operation_policy import GraphOperationPolicy +from jcapiv2.models.graph_operation_policy_group import GraphOperationPolicyGroup +from jcapiv2.models.graph_operation_policy_group_member import GraphOperationPolicyGroupMember +from jcapiv2.models.graph_operation_radius_server import GraphOperationRadiusServer +from jcapiv2.models.graph_operation_software_app import GraphOperationSoftwareApp +from jcapiv2.models.graph_operation_system import GraphOperationSystem +from jcapiv2.models.graph_operation_system_group import GraphOperationSystemGroup +from jcapiv2.models.graph_operation_system_group_member import GraphOperationSystemGroupMember +from jcapiv2.models.graph_operation_user import GraphOperationUser +from jcapiv2.models.graph_operation_user_group import GraphOperationUserGroup +from jcapiv2.models.graph_operation_user_group_member import GraphOperationUserGroupMember from jcapiv2.models.graph_type import GraphType from jcapiv2.models.group import Group +from jcapiv2.models.group_attributes_user_group import GroupAttributesUserGroup +from jcapiv2.models.group_id_suggestions_body import GroupIdSuggestionsBody from jcapiv2.models.group_type import GroupType from jcapiv2.models.gsuite_output import GsuiteOutput from jcapiv2.models.gsuite_patch_input import GsuitePatchInput +from jcapiv2.models.ip_list import IPList +from jcapiv2.models.ip_list_request import IPListRequest +from jcapiv2.models.import_user import ImportUser +from jcapiv2.models.import_user_address import ImportUserAddress +from jcapiv2.models.import_user_phone_number import ImportUserPhoneNumber +from jcapiv2.models.import_users_response import ImportUsersResponse from jcapiv2.models.inline_response200 import InlineResponse200 from jcapiv2.models.inline_response2001 import InlineResponse2001 +from jcapiv2.models.inline_response20010 import InlineResponse20010 +from jcapiv2.models.inline_response20011 import InlineResponse20011 +from jcapiv2.models.inline_response20011_users import InlineResponse20011Users +from jcapiv2.models.inline_response20012 import InlineResponse20012 +from jcapiv2.models.inline_response20013 import InlineResponse20013 +from jcapiv2.models.inline_response2002 import InlineResponse2002 +from jcapiv2.models.inline_response2002_users import InlineResponse2002Users +from jcapiv2.models.inline_response2003 import InlineResponse2003 +from jcapiv2.models.inline_response2004 import InlineResponse2004 +from jcapiv2.models.inline_response2005 import InlineResponse2005 +from jcapiv2.models.inline_response2006 import InlineResponse2006 +from jcapiv2.models.inline_response2007 import InlineResponse2007 +from jcapiv2.models.inline_response2008 import InlineResponse2008 +from jcapiv2.models.inline_response2009 import InlineResponse2009 from jcapiv2.models.inline_response201 import InlineResponse201 from jcapiv2.models.inline_response400 import InlineResponse400 -from jcapiv2.models.jc_enrollment_profile import JcEnrollmentProfile -from jcapiv2.models.job_details import JobDetails +from jcapiv2.models.integration import Integration +from jcapiv2.models.integration_sync_error import IntegrationSyncError +from jcapiv2.models.integration_sync_error_resp import IntegrationSyncErrorResp +from jcapiv2.models.integration_type import IntegrationType +from jcapiv2.models.integrations_response import IntegrationsResponse from jcapiv2.models.job_id import JobId from jcapiv2.models.job_workresult import JobWorkresult +from jcapiv2.models.ldap_group import LdapGroup from jcapiv2.models.ldap_server_action import LdapServerAction from jcapiv2.models.ldap_server_input import LdapServerInput -from jcapiv2.models.mfa import Mfa +from jcapiv2.models.ldap_server_output import LdapServerOutput +from jcapiv2.models.ldapservers_id_body import LdapserversIdBody +from jcapiv2.models.member_suggestion import MemberSuggestion +from jcapiv2.models.member_suggestions_post_result import MemberSuggestionsPostResult from jcapiv2.models.mobileconfig import Mobileconfig -from jcapiv2.models.oauth_code_input import OauthCodeInput +from jcapiv2.models.os_restriction import OSRestriction +from jcapiv2.models.os_restriction_apple_restrictions import OSRestrictionAppleRestrictions from jcapiv2.models.office365_builtin_translation import Office365BuiltinTranslation +from jcapiv2.models.office365_direction_translation import Office365DirectionTranslation +from jcapiv2.models.office365_output import Office365Output +from jcapiv2.models.office365_patch_input import Office365PatchInput from jcapiv2.models.office365_translation_rule import Office365TranslationRule from jcapiv2.models.office365_translation_rule_request import Office365TranslationRuleRequest -from jcapiv2.models.org_crypto_settings import OrgCryptoSettings -from jcapiv2.models.orgcryptosettings_ssh_keys import OrgcryptosettingsSshKeys +from jcapiv2.models.organization import Organization +from jcapiv2.models.organization_case import OrganizationCase +from jcapiv2.models.organization_cases_response import OrganizationCasesResponse +from jcapiv2.models.phone_number import PhoneNumber from jcapiv2.models.policy import Policy +from jcapiv2.models.policy_group import PolicyGroup +from jcapiv2.models.policy_group_data import PolicyGroupData from jcapiv2.models.policy_request import PolicyRequest from jcapiv2.models.policy_request_template import PolicyRequestTemplate from jcapiv2.models.policy_result import PolicyResult @@ -87,66 +240,112 @@ from jcapiv2.models.policy_with_details import PolicyWithDetails from jcapiv2.models.provider import Provider from jcapiv2.models.provider_admin_req import ProviderAdminReq -from jcapiv2.models.provider_contact import ProviderContact -from jcapiv2.models.salesforce_knowledge_list_output import SalesforceKnowledgeListOutput -from jcapiv2.models.salesforceknowledgelistoutput_inner import SalesforceknowledgelistoutputInner +from jcapiv2.models.provider_invoice import ProviderInvoice +from jcapiv2.models.provider_invoice_response import ProviderInvoiceResponse +from jcapiv2.models.push_endpoint_response import PushEndpointResponse +from jcapiv2.models.push_endpoint_response_device import PushEndpointResponseDevice +from jcapiv2.models.pushendpoints_push_endpoint_id_body import PushendpointsPushEndpointIdBody +from jcapiv2.models.pwm_all_users import PwmAllUsers +from jcapiv2.models.pwm_all_users_groups import PwmAllUsersGroups +from jcapiv2.models.pwm_all_users_results import PwmAllUsersResults +from jcapiv2.models.pwm_overview_app_versions import PwmOverviewAppVersions +from jcapiv2.models.pwm_overview_app_versions_results import PwmOverviewAppVersionsResults +from jcapiv2.models.pwm_overview_main import PwmOverviewMain +from jcapiv2.models.pwm_overview_main_devices import PwmOverviewMainDevices +from jcapiv2.models.query import Query +from jcapiv2.models.queued_command_list import QueuedCommandList +from jcapiv2.models.queued_command_list_results import QueuedCommandListResults from jcapiv2.models.samba_domain_input import SambaDomainInput -from jcapiv2.models.sshkeylist import Sshkeylist -from jcapiv2.models.system_graph_management_req import SystemGraphManagementReq -from jcapiv2.models.system_graph_management_req_attributes import SystemGraphManagementReqAttributes -from jcapiv2.models.system_graph_management_req_attributes_sudo import SystemGraphManagementReqAttributesSudo +from jcapiv2.models.samba_domain_output import SambaDomainOutput +from jcapiv2.models.scheduled_userstate_result import ScheduledUserstateResult +from jcapiv2.models.setup_assistant_option import SetupAssistantOption +from jcapiv2.models.shared_folder_access_levels import SharedFolderAccessLevels +from jcapiv2.models.shared_folder_access_levels_results import SharedFolderAccessLevelsResults +from jcapiv2.models.shared_folder_details import SharedFolderDetails +from jcapiv2.models.shared_folder_users import SharedFolderUsers +from jcapiv2.models.shared_folder_users_results import SharedFolderUsersResults +from jcapiv2.models.shared_folders_list import SharedFoldersList +from jcapiv2.models.shared_folders_list_results import SharedFoldersListResults +from jcapiv2.models.software_app import SoftwareApp +from jcapiv2.models.software_app_apple_vpp import SoftwareAppAppleVpp +from jcapiv2.models.software_app_reclaim_licenses import SoftwareAppReclaimLicenses +from jcapiv2.models.software_app_settings import SoftwareAppSettings +from jcapiv2.models.software_app_status import SoftwareAppStatus +from jcapiv2.models.software_app_with_status import SoftwareAppWithStatus +from jcapiv2.models.software_apps_retry_installation_request import SoftwareAppsRetryInstallationRequest +from jcapiv2.models.subscription import Subscription +from jcapiv2.models.suggestion_counts import SuggestionCounts from jcapiv2.models.system_group import SystemGroup from jcapiv2.models.system_group_data import SystemGroupData -from jcapiv2.models.system_group_graph_management_req import SystemGroupGraphManagementReq -from jcapiv2.models.system_group_members_req import SystemGroupMembersReq +from jcapiv2.models.system_insights_alf import SystemInsightsAlf +from jcapiv2.models.system_insights_alf_exceptions import SystemInsightsAlfExceptions +from jcapiv2.models.system_insights_alf_explicit_auths import SystemInsightsAlfExplicitAuths +from jcapiv2.models.system_insights_appcompat_shims import SystemInsightsAppcompatShims from jcapiv2.models.system_insights_apps import SystemInsightsApps +from jcapiv2.models.system_insights_authorized_keys import SystemInsightsAuthorizedKeys +from jcapiv2.models.system_insights_azure_instance_metadata import SystemInsightsAzureInstanceMetadata +from jcapiv2.models.system_insights_azure_instance_tags import SystemInsightsAzureInstanceTags from jcapiv2.models.system_insights_battery import SystemInsightsBattery from jcapiv2.models.system_insights_bitlocker_info import SystemInsightsBitlockerInfo from jcapiv2.models.system_insights_browser_plugins import SystemInsightsBrowserPlugins +from jcapiv2.models.system_insights_certificates import SystemInsightsCertificates +from jcapiv2.models.system_insights_chassis_info import SystemInsightsChassisInfo from jcapiv2.models.system_insights_chrome_extensions import SystemInsightsChromeExtensions +from jcapiv2.models.system_insights_connectivity import SystemInsightsConnectivity from jcapiv2.models.system_insights_crashes import SystemInsightsCrashes +from jcapiv2.models.system_insights_cups_destinations import SystemInsightsCupsDestinations from jcapiv2.models.system_insights_disk_encryption import SystemInsightsDiskEncryption from jcapiv2.models.system_insights_disk_info import SystemInsightsDiskInfo +from jcapiv2.models.system_insights_dns_resolvers import SystemInsightsDnsResolvers from jcapiv2.models.system_insights_etc_hosts import SystemInsightsEtcHosts from jcapiv2.models.system_insights_firefox_addons import SystemInsightsFirefoxAddons from jcapiv2.models.system_insights_groups import SystemInsightsGroups from jcapiv2.models.system_insights_ie_extensions import SystemInsightsIeExtensions from jcapiv2.models.system_insights_interface_addresses import SystemInsightsInterfaceAddresses +from jcapiv2.models.system_insights_interface_details import SystemInsightsInterfaceDetails from jcapiv2.models.system_insights_kernel_info import SystemInsightsKernelInfo from jcapiv2.models.system_insights_launchd import SystemInsightsLaunchd +from jcapiv2.models.system_insights_linux_packages import SystemInsightsLinuxPackages from jcapiv2.models.system_insights_logged_in_users import SystemInsightsLoggedInUsers -from jcapiv2.models.system_insights_logical_drvies import SystemInsightsLogicalDrvies +from jcapiv2.models.system_insights_logical_drives import SystemInsightsLogicalDrives +from jcapiv2.models.system_insights_managed_policies import SystemInsightsManagedPolicies from jcapiv2.models.system_insights_mounts import SystemInsightsMounts from jcapiv2.models.system_insights_os_version import SystemInsightsOsVersion from jcapiv2.models.system_insights_patches import SystemInsightsPatches from jcapiv2.models.system_insights_programs import SystemInsightsPrograms +from jcapiv2.models.system_insights_python_packages import SystemInsightsPythonPackages from jcapiv2.models.system_insights_safari_extensions import SystemInsightsSafariExtensions +from jcapiv2.models.system_insights_scheduled_tasks import SystemInsightsScheduledTasks +from jcapiv2.models.system_insights_secureboot import SystemInsightsSecureboot +from jcapiv2.models.system_insights_services import SystemInsightsServices +from jcapiv2.models.system_insights_shadow import SystemInsightsShadow +from jcapiv2.models.system_insights_shared_folders import SystemInsightsSharedFolders +from jcapiv2.models.system_insights_shared_resources import SystemInsightsSharedResources +from jcapiv2.models.system_insights_sharing_preferences import SystemInsightsSharingPreferences +from jcapiv2.models.system_insights_sip_config import SystemInsightsSipConfig +from jcapiv2.models.system_insights_startup_items import SystemInsightsStartupItems from jcapiv2.models.system_insights_system_controls import SystemInsightsSystemControls from jcapiv2.models.system_insights_system_info import SystemInsightsSystemInfo +from jcapiv2.models.system_insights_tpm_info import SystemInsightsTpmInfo from jcapiv2.models.system_insights_uptime import SystemInsightsUptime from jcapiv2.models.system_insights_usb_devices import SystemInsightsUsbDevices from jcapiv2.models.system_insights_user_groups import SystemInsightsUserGroups +from jcapiv2.models.system_insights_user_ssh_keys import SystemInsightsUserSshKeys +from jcapiv2.models.system_insights_userassist import SystemInsightsUserassist from jcapiv2.models.system_insights_users import SystemInsightsUsers -from jcapiv2.models.system_insights_windows_crashes import SystemInsightsWindowsCrashes +from jcapiv2.models.system_insights_wifi_networks import SystemInsightsWifiNetworks +from jcapiv2.models.system_insights_wifi_status import SystemInsightsWifiStatus +from jcapiv2.models.system_insights_windows_security_center import SystemInsightsWindowsSecurityCenter +from jcapiv2.models.system_insights_windows_security_products import SystemInsightsWindowsSecurityProducts from jcapiv2.models.systemfdekey import Systemfdekey -from jcapiv2.models.systemuser import Systemuser -from jcapiv2.models.systemuserputpost import Systemuserputpost -from jcapiv2.models.systemuserputpost_addresses import SystemuserputpostAddresses -from jcapiv2.models.systemuserputpost_phone_numbers import SystemuserputpostPhoneNumbers -from jcapiv2.models.user_graph_management_req import UserGraphManagementReq +from jcapiv2.models.ticketing_integration_alert import TicketingIntegrationAlert +from jcapiv2.models.ticketing_integration_alerts_resp import TicketingIntegrationAlertsResp +from jcapiv2.models.user import User from jcapiv2.models.user_group import UserGroup -from jcapiv2.models.user_group_attributes import UserGroupAttributes -from jcapiv2.models.user_group_attributes_posix_groups import UserGroupAttributesPosixGroups -from jcapiv2.models.user_group_graph_management_req import UserGroupGraphManagementReq -from jcapiv2.models.user_group_members_req import UserGroupMembersReq from jcapiv2.models.user_group_post import UserGroupPost from jcapiv2.models.user_group_put import UserGroupPut from jcapiv2.models.workday_fields import WorkdayFields from jcapiv2.models.workday_input import WorkdayInput from jcapiv2.models.workday_output import WorkdayOutput -from jcapiv2.models.workday_request import WorkdayRequest from jcapiv2.models.workday_worker import WorkdayWorker from jcapiv2.models.workdayoutput_auth import WorkdayoutputAuth -from jcapiv2.models.active_directory_output import ActiveDirectoryOutput -from jcapiv2.models.ldap_server_output import LdapServerOutput -from jcapiv2.models.samba_domain_output import SambaDomainOutput diff --git a/jcapiv2/jcapiv2/models/active_directory_agent_get_output.py b/jcapiv2/jcapiv2/models/active_directory_agent_get_output.py index 805e7dd..cdde61f 100644 --- a/jcapiv2/jcapiv2/models/active_directory_agent_get_output.py +++ b/jcapiv2/jcapiv2/models/active_directory_agent_get_output.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class ActiveDirectoryAgentGetOutput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -32,24 +29,47 @@ class ActiveDirectoryAgentGetOutput(object): """ swagger_types = { 'connect_key': 'str', - 'id': 'str' + 'contact_at': 'str', + 'hostname': 'str', + 'id': 'str', + 'source_ip': 'str', + 'state': 'str', + 'version': 'str' } attribute_map = { 'connect_key': 'connectKey', - 'id': 'id' + 'contact_at': 'contactAt', + 'hostname': 'hostname', + 'id': 'id', + 'source_ip': 'source_ip', + 'state': 'state', + 'version': 'version' } - def __init__(self, connect_key=None, id=None): # noqa: E501 + def __init__(self, connect_key=None, contact_at=None, hostname=None, id=None, source_ip=None, state=None, version=None): # noqa: E501 """ActiveDirectoryAgentGetOutput - a model defined in Swagger""" # noqa: E501 - self._connect_key = None + self._contact_at = None + self._hostname = None self._id = None + self._source_ip = None + self._state = None + self._version = None self.discriminator = None - if connect_key is not None: self.connect_key = connect_key + if contact_at is not None: + self.contact_at = contact_at + if hostname is not None: + self.hostname = hostname self.id = id + if source_ip is not None: + self.source_ip = source_ip + if state is not None: + self.state = state + if version is not None: + self.version = version @property def connect_key(self): @@ -74,6 +94,48 @@ def connect_key(self, connect_key): self._connect_key = connect_key + @property + def contact_at(self): + """Gets the contact_at of this ActiveDirectoryAgentGetOutput. # noqa: E501 + + + :return: The contact_at of this ActiveDirectoryAgentGetOutput. # noqa: E501 + :rtype: str + """ + return self._contact_at + + @contact_at.setter + def contact_at(self, contact_at): + """Sets the contact_at of this ActiveDirectoryAgentGetOutput. + + + :param contact_at: The contact_at of this ActiveDirectoryAgentGetOutput. # noqa: E501 + :type: str + """ + + self._contact_at = contact_at + + @property + def hostname(self): + """Gets the hostname of this ActiveDirectoryAgentGetOutput. # noqa: E501 + + + :return: The hostname of this ActiveDirectoryAgentGetOutput. # noqa: E501 + :rtype: str + """ + return self._hostname + + @hostname.setter + def hostname(self, hostname): + """Sets the hostname of this ActiveDirectoryAgentGetOutput. + + + :param hostname: The hostname of this ActiveDirectoryAgentGetOutput. # noqa: E501 + :type: str + """ + + self._hostname = hostname + @property def id(self): """Gets the id of this ActiveDirectoryAgentGetOutput. # noqa: E501 @@ -99,6 +161,75 @@ def id(self, id): self._id = id + @property + def source_ip(self): + """Gets the source_ip of this ActiveDirectoryAgentGetOutput. # noqa: E501 + + + :return: The source_ip of this ActiveDirectoryAgentGetOutput. # noqa: E501 + :rtype: str + """ + return self._source_ip + + @source_ip.setter + def source_ip(self, source_ip): + """Sets the source_ip of this ActiveDirectoryAgentGetOutput. + + + :param source_ip: The source_ip of this ActiveDirectoryAgentGetOutput. # noqa: E501 + :type: str + """ + + self._source_ip = source_ip + + @property + def state(self): + """Gets the state of this ActiveDirectoryAgentGetOutput. # noqa: E501 + + + :return: The state of this ActiveDirectoryAgentGetOutput. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this ActiveDirectoryAgentGetOutput. + + + :param state: The state of this ActiveDirectoryAgentGetOutput. # noqa: E501 + :type: str + """ + allowed_values = ["unsealed", "active", "inactive"] # noqa: E501 + if state not in allowed_values: + raise ValueError( + "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 + .format(state, allowed_values) + ) + + self._state = state + + @property + def version(self): + """Gets the version of this ActiveDirectoryAgentGetOutput. # noqa: E501 + + + :return: The version of this ActiveDirectoryAgentGetOutput. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this ActiveDirectoryAgentGetOutput. + + + :param version: The version of this ActiveDirectoryAgentGetOutput. # noqa: E501 + :type: str + """ + + self._version = version + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/jcapiv2/jcapiv2/models/active_directory_agent_input.py b/jcapiv2/jcapiv2/models/active_directory_agent_input.py index 15bf7fd..f1f76f8 100644 --- a/jcapiv2/jcapiv2/models/active_directory_agent_input.py +++ b/jcapiv2/jcapiv2/models/active_directory_agent_input.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class ActiveDirectoryAgentInput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name diff --git a/jcapiv2/jcapiv2/models/active_directory_agent_list_output.py b/jcapiv2/jcapiv2/models/active_directory_agent_list_output.py index 1290849..d8a0db7 100644 --- a/jcapiv2/jcapiv2/models/active_directory_agent_list_output.py +++ b/jcapiv2/jcapiv2/models/active_directory_agent_list_output.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class ActiveDirectoryAgentListOutput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,26 +28,86 @@ class ActiveDirectoryAgentListOutput(object): and the value is json key in definition. """ swagger_types = { + 'contact_at': 'str', + 'hostname': 'str', 'id': 'str', - 'state': 'str' + 'source_ip': 'str', + 'state': 'str', + 'version': 'str' } attribute_map = { + 'contact_at': 'contactAt', + 'hostname': 'hostname', 'id': 'id', - 'state': 'state' + 'source_ip': 'source_ip', + 'state': 'state', + 'version': 'version' } - def __init__(self, id=None, state=None): # noqa: E501 + def __init__(self, contact_at=None, hostname=None, id=None, source_ip=None, state=None, version=None): # noqa: E501 """ActiveDirectoryAgentListOutput - a model defined in Swagger""" # noqa: E501 - + self._contact_at = None + self._hostname = None self._id = None + self._source_ip = None self._state = None + self._version = None self.discriminator = None - + if contact_at is not None: + self.contact_at = contact_at + if hostname is not None: + self.hostname = hostname if id is not None: self.id = id + if source_ip is not None: + self.source_ip = source_ip if state is not None: self.state = state + if version is not None: + self.version = version + + @property + def contact_at(self): + """Gets the contact_at of this ActiveDirectoryAgentListOutput. # noqa: E501 + + + :return: The contact_at of this ActiveDirectoryAgentListOutput. # noqa: E501 + :rtype: str + """ + return self._contact_at + + @contact_at.setter + def contact_at(self, contact_at): + """Sets the contact_at of this ActiveDirectoryAgentListOutput. + + + :param contact_at: The contact_at of this ActiveDirectoryAgentListOutput. # noqa: E501 + :type: str + """ + + self._contact_at = contact_at + + @property + def hostname(self): + """Gets the hostname of this ActiveDirectoryAgentListOutput. # noqa: E501 + + + :return: The hostname of this ActiveDirectoryAgentListOutput. # noqa: E501 + :rtype: str + """ + return self._hostname + + @hostname.setter + def hostname(self, hostname): + """Sets the hostname of this ActiveDirectoryAgentListOutput. + + + :param hostname: The hostname of this ActiveDirectoryAgentListOutput. # noqa: E501 + :type: str + """ + + self._hostname = hostname @property def id(self): @@ -75,6 +132,27 @@ def id(self, id): self._id = id + @property + def source_ip(self): + """Gets the source_ip of this ActiveDirectoryAgentListOutput. # noqa: E501 + + + :return: The source_ip of this ActiveDirectoryAgentListOutput. # noqa: E501 + :rtype: str + """ + return self._source_ip + + @source_ip.setter + def source_ip(self, source_ip): + """Sets the source_ip of this ActiveDirectoryAgentListOutput. + + + :param source_ip: The source_ip of this ActiveDirectoryAgentListOutput. # noqa: E501 + :type: str + """ + + self._source_ip = source_ip + @property def state(self): """Gets the state of this ActiveDirectoryAgentListOutput. # noqa: E501 @@ -102,6 +180,27 @@ def state(self, state): self._state = state + @property + def version(self): + """Gets the version of this ActiveDirectoryAgentListOutput. # noqa: E501 + + + :return: The version of this ActiveDirectoryAgentListOutput. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this ActiveDirectoryAgentListOutput. + + + :param version: The version of this ActiveDirectoryAgentListOutput. # noqa: E501 + :type: str + """ + + self._version = version + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/jcapiv2/jcapiv2/models/active_directory_input.py b/jcapiv2/jcapiv2/models/active_directory_input.py index 9c27348..198e777 100644 --- a/jcapiv2/jcapiv2/models/active_directory_input.py +++ b/jcapiv2/jcapiv2/models/active_directory_input.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class ActiveDirectoryInput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,10 +37,8 @@ class ActiveDirectoryInput(object): def __init__(self, domain=None): # noqa: E501 """ActiveDirectoryInput - a model defined in Swagger""" # noqa: E501 - self._domain = None self.discriminator = None - if domain is not None: self.domain = domain diff --git a/jcapiv2/jcapiv2/models/active_directory_output.py b/jcapiv2/jcapiv2/models/active_directory_output.py index f963a4a..4dbc9bd 100644 --- a/jcapiv2/jcapiv2/models/active_directory_output.py +++ b/jcapiv2/jcapiv2/models/active_directory_output.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.active_directory_input import ActiveDirectoryInput # noqa: F401,E501 - - class ActiveDirectoryOutput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,25 +28,19 @@ class ActiveDirectoryOutput(object): and the value is json key in definition. """ swagger_types = { - 'domain': 'str', - 'id': 'str' + 'domain': 'str' } attribute_map = { - 'domain': 'domain', - 'id': 'id' + 'domain': 'domain' } - def __init__(self, domain=None, id=None): # noqa: E501 + def __init__(self, domain=None): # noqa: E501 """ActiveDirectoryOutput - a model defined in Swagger""" # noqa: E501 - self._domain = None - self._id = None self.discriminator = None - if domain is not None: self.domain = domain - self.id = id @property def domain(self): @@ -76,31 +65,6 @@ def domain(self, domain): self._domain = domain - @property - def id(self): - """Gets the id of this ActiveDirectoryOutput. # noqa: E501 - - ObjectID of this Active Directory instance. # noqa: E501 - - :return: The id of this ActiveDirectoryOutput. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this ActiveDirectoryOutput. - - ObjectID of this Active Directory instance. # noqa: E501 - - :param id: The id of this ActiveDirectoryOutput. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/jcapiv2/jcapiv2/models/address.py b/jcapiv2/jcapiv2/models/address.py new file mode 100644 index 0000000..0a0358e --- /dev/null +++ b/jcapiv2/jcapiv2/models/address.py @@ -0,0 +1,318 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Address(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'country': 'str', + 'extended_address': 'str', + 'id': 'str', + 'locality': 'str', + 'po_box': 'str', + 'postal_code': 'str', + 'region': 'str', + 'street_address': 'str', + 'type': 'str' + } + + attribute_map = { + 'country': 'country', + 'extended_address': 'extendedAddress', + 'id': 'id', + 'locality': 'locality', + 'po_box': 'poBox', + 'postal_code': 'postalCode', + 'region': 'region', + 'street_address': 'streetAddress', + 'type': 'type' + } + + def __init__(self, country=None, extended_address=None, id=None, locality=None, po_box=None, postal_code=None, region=None, street_address=None, type=None): # noqa: E501 + """Address - a model defined in Swagger""" # noqa: E501 + self._country = None + self._extended_address = None + self._id = None + self._locality = None + self._po_box = None + self._postal_code = None + self._region = None + self._street_address = None + self._type = None + self.discriminator = None + if country is not None: + self.country = country + if extended_address is not None: + self.extended_address = extended_address + if id is not None: + self.id = id + if locality is not None: + self.locality = locality + if po_box is not None: + self.po_box = po_box + if postal_code is not None: + self.postal_code = postal_code + if region is not None: + self.region = region + if street_address is not None: + self.street_address = street_address + if type is not None: + self.type = type + + @property + def country(self): + """Gets the country of this Address. # noqa: E501 + + + :return: The country of this Address. # noqa: E501 + :rtype: str + """ + return self._country + + @country.setter + def country(self, country): + """Sets the country of this Address. + + + :param country: The country of this Address. # noqa: E501 + :type: str + """ + + self._country = country + + @property + def extended_address(self): + """Gets the extended_address of this Address. # noqa: E501 + + + :return: The extended_address of this Address. # noqa: E501 + :rtype: str + """ + return self._extended_address + + @extended_address.setter + def extended_address(self, extended_address): + """Sets the extended_address of this Address. + + + :param extended_address: The extended_address of this Address. # noqa: E501 + :type: str + """ + + self._extended_address = extended_address + + @property + def id(self): + """Gets the id of this Address. # noqa: E501 + + + :return: The id of this Address. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Address. + + + :param id: The id of this Address. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def locality(self): + """Gets the locality of this Address. # noqa: E501 + + + :return: The locality of this Address. # noqa: E501 + :rtype: str + """ + return self._locality + + @locality.setter + def locality(self, locality): + """Sets the locality of this Address. + + + :param locality: The locality of this Address. # noqa: E501 + :type: str + """ + + self._locality = locality + + @property + def po_box(self): + """Gets the po_box of this Address. # noqa: E501 + + + :return: The po_box of this Address. # noqa: E501 + :rtype: str + """ + return self._po_box + + @po_box.setter + def po_box(self, po_box): + """Sets the po_box of this Address. + + + :param po_box: The po_box of this Address. # noqa: E501 + :type: str + """ + + self._po_box = po_box + + @property + def postal_code(self): + """Gets the postal_code of this Address. # noqa: E501 + + + :return: The postal_code of this Address. # noqa: E501 + :rtype: str + """ + return self._postal_code + + @postal_code.setter + def postal_code(self, postal_code): + """Sets the postal_code of this Address. + + + :param postal_code: The postal_code of this Address. # noqa: E501 + :type: str + """ + + self._postal_code = postal_code + + @property + def region(self): + """Gets the region of this Address. # noqa: E501 + + + :return: The region of this Address. # noqa: E501 + :rtype: str + """ + return self._region + + @region.setter + def region(self, region): + """Sets the region of this Address. + + + :param region: The region of this Address. # noqa: E501 + :type: str + """ + + self._region = region + + @property + def street_address(self): + """Gets the street_address of this Address. # noqa: E501 + + + :return: The street_address of this Address. # noqa: E501 + :rtype: str + """ + return self._street_address + + @street_address.setter + def street_address(self, street_address): + """Sets the street_address of this Address. + + + :param street_address: The street_address of this Address. # noqa: E501 + :type: str + """ + + self._street_address = street_address + + @property + def type(self): + """Gets the type of this Address. # noqa: E501 + + + :return: The type of this Address. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Address. + + + :param type: The type of this Address. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Address, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Address): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/ade.py b/jcapiv2/jcapiv2/models/ade.py new file mode 100644 index 0000000..23727d6 --- /dev/null +++ b/jcapiv2/jcapiv2/models/ade.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ADE(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'default_device_group_object_ids': 'list[str]', + 'enable_zero_touch_enrollment': 'bool', + 'setup_assistant_options': 'list[DEPSetupAssistantOption]', + 'welcome_screen': 'DEPWelcomeScreen' + } + + attribute_map = { + 'default_device_group_object_ids': 'defaultDeviceGroupObjectIds', + 'enable_zero_touch_enrollment': 'enableZeroTouchEnrollment', + 'setup_assistant_options': 'setupAssistantOptions', + 'welcome_screen': 'welcomeScreen' + } + + def __init__(self, default_device_group_object_ids=None, enable_zero_touch_enrollment=None, setup_assistant_options=None, welcome_screen=None): # noqa: E501 + """ADE - a model defined in Swagger""" # noqa: E501 + self._default_device_group_object_ids = None + self._enable_zero_touch_enrollment = None + self._setup_assistant_options = None + self._welcome_screen = None + self.discriminator = None + if default_device_group_object_ids is not None: + self.default_device_group_object_ids = default_device_group_object_ids + if enable_zero_touch_enrollment is not None: + self.enable_zero_touch_enrollment = enable_zero_touch_enrollment + if setup_assistant_options is not None: + self.setup_assistant_options = setup_assistant_options + if welcome_screen is not None: + self.welcome_screen = welcome_screen + + @property + def default_device_group_object_ids(self): + """Gets the default_device_group_object_ids of this ADE. # noqa: E501 + + An array of ObjectIDs identifying the default device groups for this specific type (based on the OS family) of automated device enrollment. Currently, only a single DeviceGroupID is supported. # noqa: E501 + + :return: The default_device_group_object_ids of this ADE. # noqa: E501 + :rtype: list[str] + """ + return self._default_device_group_object_ids + + @default_device_group_object_ids.setter + def default_device_group_object_ids(self, default_device_group_object_ids): + """Sets the default_device_group_object_ids of this ADE. + + An array of ObjectIDs identifying the default device groups for this specific type (based on the OS family) of automated device enrollment. Currently, only a single DeviceGroupID is supported. # noqa: E501 + + :param default_device_group_object_ids: The default_device_group_object_ids of this ADE. # noqa: E501 + :type: list[str] + """ + + self._default_device_group_object_ids = default_device_group_object_ids + + @property + def enable_zero_touch_enrollment(self): + """Gets the enable_zero_touch_enrollment of this ADE. # noqa: E501 + + A toggle to determine if ADE registered devices should go through JumpCloud Zero Touch Enrollment. # noqa: E501 + + :return: The enable_zero_touch_enrollment of this ADE. # noqa: E501 + :rtype: bool + """ + return self._enable_zero_touch_enrollment + + @enable_zero_touch_enrollment.setter + def enable_zero_touch_enrollment(self, enable_zero_touch_enrollment): + """Sets the enable_zero_touch_enrollment of this ADE. + + A toggle to determine if ADE registered devices should go through JumpCloud Zero Touch Enrollment. # noqa: E501 + + :param enable_zero_touch_enrollment: The enable_zero_touch_enrollment of this ADE. # noqa: E501 + :type: bool + """ + + self._enable_zero_touch_enrollment = enable_zero_touch_enrollment + + @property + def setup_assistant_options(self): + """Gets the setup_assistant_options of this ADE. # noqa: E501 + + + :return: The setup_assistant_options of this ADE. # noqa: E501 + :rtype: list[DEPSetupAssistantOption] + """ + return self._setup_assistant_options + + @setup_assistant_options.setter + def setup_assistant_options(self, setup_assistant_options): + """Sets the setup_assistant_options of this ADE. + + + :param setup_assistant_options: The setup_assistant_options of this ADE. # noqa: E501 + :type: list[DEPSetupAssistantOption] + """ + + self._setup_assistant_options = setup_assistant_options + + @property + def welcome_screen(self): + """Gets the welcome_screen of this ADE. # noqa: E501 + + + :return: The welcome_screen of this ADE. # noqa: E501 + :rtype: DEPWelcomeScreen + """ + return self._welcome_screen + + @welcome_screen.setter + def welcome_screen(self, welcome_screen): + """Sets the welcome_screen of this ADE. + + + :param welcome_screen: The welcome_screen of this ADE. # noqa: E501 + :type: DEPWelcomeScreen + """ + + self._welcome_screen = welcome_screen + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ADE, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ADE): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/ades.py b/jcapiv2/jcapiv2/models/ades.py new file mode 100644 index 0000000..4efa10b --- /dev/null +++ b/jcapiv2/jcapiv2/models/ades.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ADES(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'ios': 'ADE', + 'macos': 'ADE' + } + + attribute_map = { + 'ios': 'ios', + 'macos': 'macos' + } + + def __init__(self, ios=None, macos=None): # noqa: E501 + """ADES - a model defined in Swagger""" # noqa: E501 + self._ios = None + self._macos = None + self.discriminator = None + if ios is not None: + self.ios = ios + if macos is not None: + self.macos = macos + + @property + def ios(self): + """Gets the ios of this ADES. # noqa: E501 + + + :return: The ios of this ADES. # noqa: E501 + :rtype: ADE + """ + return self._ios + + @ios.setter + def ios(self, ios): + """Sets the ios of this ADES. + + + :param ios: The ios of this ADES. # noqa: E501 + :type: ADE + """ + + self._ios = ios + + @property + def macos(self): + """Gets the macos of this ADES. # noqa: E501 + + + :return: The macos of this ADES. # noqa: E501 + :rtype: ADE + """ + return self._macos + + @macos.setter + def macos(self, macos): + """Sets the macos of this ADES. + + + :param macos: The macos of this ADES. # noqa: E501 + :type: ADE + """ + + self._macos = macos + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ADES, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ADES): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/administrator.py b/jcapiv2/jcapiv2/models/administrator.py index 1a7c029..26f3022 100644 --- a/jcapiv2/jcapiv2/models/administrator.py +++ b/jcapiv2/jcapiv2/models/administrator.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class Administrator(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -36,7 +33,11 @@ class Administrator(object): 'firstname': 'str', 'id': 'str', 'lastname': 'str', - 'registered': 'bool' + 'organization_access_total': 'float', + 'registered': 'bool', + 'role': 'str', + 'role_name': 'str', + 'suspended': 'bool' } attribute_map = { @@ -45,20 +46,26 @@ class Administrator(object): 'firstname': 'firstname', 'id': 'id', 'lastname': 'lastname', - 'registered': 'registered' + 'organization_access_total': 'organizationAccessTotal', + 'registered': 'registered', + 'role': 'role', + 'role_name': 'roleName', + 'suspended': 'suspended' } - def __init__(self, email=None, enable_multi_factor=None, firstname=None, id=None, lastname=None, registered=None): # noqa: E501 + def __init__(self, email=None, enable_multi_factor=None, firstname=None, id=None, lastname=None, organization_access_total=None, registered=None, role=None, role_name=None, suspended=None): # noqa: E501 """Administrator - a model defined in Swagger""" # noqa: E501 - self._email = None self._enable_multi_factor = None self._firstname = None self._id = None self._lastname = None + self._organization_access_total = None self._registered = None + self._role = None + self._role_name = None + self._suspended = None self.discriminator = None - if email is not None: self.email = email if enable_multi_factor is not None: @@ -69,8 +76,16 @@ def __init__(self, email=None, enable_multi_factor=None, firstname=None, id=None self.id = id if lastname is not None: self.lastname = lastname + if organization_access_total is not None: + self.organization_access_total = organization_access_total if registered is not None: self.registered = registered + if role is not None: + self.role = role + if role_name is not None: + self.role_name = role_name + if suspended is not None: + self.suspended = suspended @property def email(self): @@ -177,6 +192,27 @@ def lastname(self, lastname): self._lastname = lastname + @property + def organization_access_total(self): + """Gets the organization_access_total of this Administrator. # noqa: E501 + + + :return: The organization_access_total of this Administrator. # noqa: E501 + :rtype: float + """ + return self._organization_access_total + + @organization_access_total.setter + def organization_access_total(self, organization_access_total): + """Sets the organization_access_total of this Administrator. + + + :param organization_access_total: The organization_access_total of this Administrator. # noqa: E501 + :type: float + """ + + self._organization_access_total = organization_access_total + @property def registered(self): """Gets the registered of this Administrator. # noqa: E501 @@ -198,6 +234,69 @@ def registered(self, registered): self._registered = registered + @property + def role(self): + """Gets the role of this Administrator. # noqa: E501 + + + :return: The role of this Administrator. # noqa: E501 + :rtype: str + """ + return self._role + + @role.setter + def role(self, role): + """Sets the role of this Administrator. + + + :param role: The role of this Administrator. # noqa: E501 + :type: str + """ + + self._role = role + + @property + def role_name(self): + """Gets the role_name of this Administrator. # noqa: E501 + + + :return: The role_name of this Administrator. # noqa: E501 + :rtype: str + """ + return self._role_name + + @role_name.setter + def role_name(self, role_name): + """Sets the role_name of this Administrator. + + + :param role_name: The role_name of this Administrator. # noqa: E501 + :type: str + """ + + self._role_name = role_name + + @property + def suspended(self): + """Gets the suspended of this Administrator. # noqa: E501 + + + :return: The suspended of this Administrator. # noqa: E501 + :rtype: bool + """ + return self._suspended + + @suspended.setter + def suspended(self, suspended): + """Sets the suspended of this Administrator. + + + :param suspended: The suspended of this Administrator. # noqa: E501 + :type: bool + """ + + self._suspended = suspended + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/jcapiv2/jcapiv2/models/administrator_organization_link.py b/jcapiv2/jcapiv2/models/administrator_organization_link.py new file mode 100644 index 0000000..53ad5d2 --- /dev/null +++ b/jcapiv2/jcapiv2/models/administrator_organization_link.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AdministratorOrganizationLink(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'administrator': 'str', + 'organization': 'str' + } + + attribute_map = { + 'administrator': 'administrator', + 'organization': 'organization' + } + + def __init__(self, administrator=None, organization=None): # noqa: E501 + """AdministratorOrganizationLink - a model defined in Swagger""" # noqa: E501 + self._administrator = None + self._organization = None + self.discriminator = None + if administrator is not None: + self.administrator = administrator + if organization is not None: + self.organization = organization + + @property + def administrator(self): + """Gets the administrator of this AdministratorOrganizationLink. # noqa: E501 + + The identifier for an administrator # noqa: E501 + + :return: The administrator of this AdministratorOrganizationLink. # noqa: E501 + :rtype: str + """ + return self._administrator + + @administrator.setter + def administrator(self, administrator): + """Sets the administrator of this AdministratorOrganizationLink. + + The identifier for an administrator # noqa: E501 + + :param administrator: The administrator of this AdministratorOrganizationLink. # noqa: E501 + :type: str + """ + + self._administrator = administrator + + @property + def organization(self): + """Gets the organization of this AdministratorOrganizationLink. # noqa: E501 + + The identifier for an organization # noqa: E501 + + :return: The organization of this AdministratorOrganizationLink. # noqa: E501 + :rtype: str + """ + return self._organization + + @organization.setter + def organization(self, organization): + """Sets the organization of this AdministratorOrganizationLink. + + The identifier for an organization # noqa: E501 + + :param organization: The organization of this AdministratorOrganizationLink. # noqa: E501 + :type: str + """ + + self._organization = organization + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AdministratorOrganizationLink, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdministratorOrganizationLink): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/administrator_organization_link_req.py b/jcapiv2/jcapiv2/models/administrator_organization_link_req.py new file mode 100644 index 0000000..b5db246 --- /dev/null +++ b/jcapiv2/jcapiv2/models/administrator_organization_link_req.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AdministratorOrganizationLinkReq(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'organization': 'str' + } + + attribute_map = { + 'organization': 'organization' + } + + def __init__(self, organization=None): # noqa: E501 + """AdministratorOrganizationLinkReq - a model defined in Swagger""" # noqa: E501 + self._organization = None + self.discriminator = None + if organization is not None: + self.organization = organization + + @property + def organization(self): + """Gets the organization of this AdministratorOrganizationLinkReq. # noqa: E501 + + The identifier for an organization to link this administrator to. # noqa: E501 + + :return: The organization of this AdministratorOrganizationLinkReq. # noqa: E501 + :rtype: str + """ + return self._organization + + @organization.setter + def organization(self, organization): + """Sets the organization of this AdministratorOrganizationLinkReq. + + The identifier for an organization to link this administrator to. # noqa: E501 + + :param organization: The organization of this AdministratorOrganizationLinkReq. # noqa: E501 + :type: str + """ + + self._organization = organization + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AdministratorOrganizationLinkReq, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdministratorOrganizationLinkReq): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/all_of_autotask_ticketing_alert_configuration_list_records_items.py b/jcapiv2/jcapiv2/models/all_of_autotask_ticketing_alert_configuration_list_records_items.py new file mode 100644 index 0000000..57ccfd1 --- /dev/null +++ b/jcapiv2/jcapiv2/models/all_of_autotask_ticketing_alert_configuration_list_records_items.py @@ -0,0 +1,402 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AllOfAutotaskTicketingAlertConfigurationListRecordsItems(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'category': 'str', + 'description': 'str', + 'destination': 'str', + 'display_name': 'str', + 'due_days': 'int', + 'id': 'int', + 'priority': 'AutotaskTicketingAlertConfigurationPriority', + 'queue': 'AutotaskTicketingAlertConfigurationPriority', + 'resource': 'AutotaskTicketingAlertConfigurationResource', + 'should_create_tickets': 'bool', + 'source': 'AutotaskTicketingAlertConfigurationPriority', + 'status': 'AutotaskTicketingAlertConfigurationPriority' + } + + attribute_map = { + 'category': 'category', + 'description': 'description', + 'destination': 'destination', + 'display_name': 'displayName', + 'due_days': 'dueDays', + 'id': 'id', + 'priority': 'priority', + 'queue': 'queue', + 'resource': 'resource', + 'should_create_tickets': 'shouldCreateTickets', + 'source': 'source', + 'status': 'status' + } + + def __init__(self, category=None, description=None, destination=None, display_name=None, due_days=None, id=None, priority=None, queue=None, resource=None, should_create_tickets=None, source=None, status=None): # noqa: E501 + """AllOfAutotaskTicketingAlertConfigurationListRecordsItems - a model defined in Swagger""" # noqa: E501 + self._category = None + self._description = None + self._destination = None + self._display_name = None + self._due_days = None + self._id = None + self._priority = None + self._queue = None + self._resource = None + self._should_create_tickets = None + self._source = None + self._status = None + self.discriminator = None + if category is not None: + self.category = category + if description is not None: + self.description = description + if destination is not None: + self.destination = destination + if display_name is not None: + self.display_name = display_name + if due_days is not None: + self.due_days = due_days + if id is not None: + self.id = id + if priority is not None: + self.priority = priority + if queue is not None: + self.queue = queue + if resource is not None: + self.resource = resource + if should_create_tickets is not None: + self.should_create_tickets = should_create_tickets + if source is not None: + self.source = source + if status is not None: + self.status = status + + @property + def category(self): + """Gets the category of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The category of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. + + + :param category: The category of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: str + """ + + self._category = category + + @property + def description(self): + """Gets the description of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The description of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. + + + :param description: The description of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def destination(self): + """Gets the destination of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The destination of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: str + """ + return self._destination + + @destination.setter + def destination(self, destination): + """Sets the destination of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. + + + :param destination: The destination of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: str + """ + allowed_values = ["queue", "resource"] # noqa: E501 + if destination not in allowed_values: + raise ValueError( + "Invalid value for `destination` ({0}), must be one of {1}" # noqa: E501 + .format(destination, allowed_values) + ) + + self._destination = destination + + @property + def display_name(self): + """Gets the display_name of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The display_name of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. + + + :param display_name: The display_name of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: str + """ + + self._display_name = display_name + + @property + def due_days(self): + """Gets the due_days of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The due_days of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: int + """ + return self._due_days + + @due_days.setter + def due_days(self, due_days): + """Sets the due_days of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. + + + :param due_days: The due_days of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: int + """ + + self._due_days = due_days + + @property + def id(self): + """Gets the id of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The id of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. + + + :param id: The id of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def priority(self): + """Gets the priority of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The priority of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. + + + :param priority: The priority of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + + self._priority = priority + + @property + def queue(self): + """Gets the queue of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The queue of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._queue + + @queue.setter + def queue(self, queue): + """Sets the queue of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. + + + :param queue: The queue of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + + self._queue = queue + + @property + def resource(self): + """Gets the resource of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The resource of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationResource + """ + return self._resource + + @resource.setter + def resource(self, resource): + """Sets the resource of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. + + + :param resource: The resource of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationResource + """ + + self._resource = resource + + @property + def should_create_tickets(self): + """Gets the should_create_tickets of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The should_create_tickets of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: bool + """ + return self._should_create_tickets + + @should_create_tickets.setter + def should_create_tickets(self, should_create_tickets): + """Sets the should_create_tickets of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. + + + :param should_create_tickets: The should_create_tickets of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: bool + """ + + self._should_create_tickets = should_create_tickets + + @property + def source(self): + """Gets the source of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The source of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. + + + :param source: The source of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + + self._source = source + + @property + def status(self): + """Gets the status of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The status of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. + + + :param status: The status of this AllOfAutotaskTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AllOfAutotaskTicketingAlertConfigurationListRecordsItems, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AllOfAutotaskTicketingAlertConfigurationListRecordsItems): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/all_of_connect_wise_ticketing_alert_configuration_list_records_items.py b/jcapiv2/jcapiv2/models/all_of_connect_wise_ticketing_alert_configuration_list_records_items.py new file mode 100644 index 0000000..7f1b49c --- /dev/null +++ b/jcapiv2/jcapiv2/models/all_of_connect_wise_ticketing_alert_configuration_list_records_items.py @@ -0,0 +1,293 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AllOfConnectWiseTicketingAlertConfigurationListRecordsItems(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'category': 'str', + 'description': 'str', + 'display_name': 'str', + 'due_days': 'int', + 'id': 'int', + 'priority': 'AutotaskTicketingAlertConfigurationPriority', + 'should_create_tickets': 'bool', + 'source': 'AutotaskTicketingAlertConfigurationPriority' + } + + attribute_map = { + 'category': 'category', + 'description': 'description', + 'display_name': 'displayName', + 'due_days': 'dueDays', + 'id': 'id', + 'priority': 'priority', + 'should_create_tickets': 'shouldCreateTickets', + 'source': 'source' + } + + def __init__(self, category=None, description=None, display_name=None, due_days=None, id=None, priority=None, should_create_tickets=None, source=None): # noqa: E501 + """AllOfConnectWiseTicketingAlertConfigurationListRecordsItems - a model defined in Swagger""" # noqa: E501 + self._category = None + self._description = None + self._display_name = None + self._due_days = None + self._id = None + self._priority = None + self._should_create_tickets = None + self._source = None + self.discriminator = None + if category is not None: + self.category = category + if description is not None: + self.description = description + if display_name is not None: + self.display_name = display_name + if due_days is not None: + self.due_days = due_days + if id is not None: + self.id = id + if priority is not None: + self.priority = priority + self.should_create_tickets = should_create_tickets + if source is not None: + self.source = source + + @property + def category(self): + """Gets the category of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The category of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. + + + :param category: The category of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: str + """ + + self._category = category + + @property + def description(self): + """Gets the description of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The description of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. + + + :param description: The description of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def display_name(self): + """Gets the display_name of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The display_name of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. + + + :param display_name: The display_name of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: str + """ + + self._display_name = display_name + + @property + def due_days(self): + """Gets the due_days of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The due_days of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: int + """ + return self._due_days + + @due_days.setter + def due_days(self, due_days): + """Sets the due_days of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. + + + :param due_days: The due_days of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: int + """ + + self._due_days = due_days + + @property + def id(self): + """Gets the id of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The id of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. + + + :param id: The id of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def priority(self): + """Gets the priority of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The priority of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. + + + :param priority: The priority of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + + self._priority = priority + + @property + def should_create_tickets(self): + """Gets the should_create_tickets of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The should_create_tickets of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: bool + """ + return self._should_create_tickets + + @should_create_tickets.setter + def should_create_tickets(self, should_create_tickets): + """Sets the should_create_tickets of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. + + + :param should_create_tickets: The should_create_tickets of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: bool + """ + if should_create_tickets is None: + raise ValueError("Invalid value for `should_create_tickets`, must not be `None`") # noqa: E501 + + self._should_create_tickets = should_create_tickets + + @property + def source(self): + """Gets the source of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + + + :return: The source of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. + + + :param source: The source of this AllOfConnectWiseTicketingAlertConfigurationListRecordsItems. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + + self._source = source + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AllOfConnectWiseTicketingAlertConfigurationListRecordsItems, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AllOfConnectWiseTicketingAlertConfigurationListRecordsItems): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/any_value.py b/jcapiv2/jcapiv2/models/any_value.py new file mode 100644 index 0000000..5de9180 --- /dev/null +++ b/jcapiv2/jcapiv2/models/any_value.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AnyValue(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """AnyValue - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AnyValue, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AnyValue): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/apple_mdm.py b/jcapiv2/jcapiv2/models/apple_mdm.py index 340c252..f821994 100644 --- a/jcapiv2/jcapiv2/models/apple_mdm.py +++ b/jcapiv2/jcapiv2/models/apple_mdm.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class AppleMDM(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,31 +28,136 @@ class AppleMDM(object): and the value is json key in definition. """ swagger_types = { + 'ades': 'ADES', + 'allow_mobile_user_enrollment': 'bool', + 'apns_cert_expiry': 'str', 'apns_push_topic': 'str', + 'default_ios_user_enrollment_device_group_id': 'str', + 'default_system_group_id': 'str', + 'dep': 'DEP', + 'dep_access_token_expiry': 'str', + 'dep_server_token_state': 'str', 'id': 'str', 'name': 'str' } attribute_map = { + 'ades': 'ades', + 'allow_mobile_user_enrollment': 'allowMobileUserEnrollment', + 'apns_cert_expiry': 'apnsCertExpiry', 'apns_push_topic': 'apnsPushTopic', + 'default_ios_user_enrollment_device_group_id': 'defaultIosUserEnrollmentDeviceGroupID', + 'default_system_group_id': 'defaultSystemGroupID', + 'dep': 'dep', + 'dep_access_token_expiry': 'depAccessTokenExpiry', + 'dep_server_token_state': 'depServerTokenState', 'id': 'id', 'name': 'name' } - def __init__(self, apns_push_topic=None, id=None, name=None): # noqa: E501 + def __init__(self, ades=None, allow_mobile_user_enrollment=None, apns_cert_expiry=None, apns_push_topic=None, default_ios_user_enrollment_device_group_id=None, default_system_group_id=None, dep=None, dep_access_token_expiry=None, dep_server_token_state=None, id=None, name=None): # noqa: E501 """AppleMDM - a model defined in Swagger""" # noqa: E501 - + self._ades = None + self._allow_mobile_user_enrollment = None + self._apns_cert_expiry = None self._apns_push_topic = None + self._default_ios_user_enrollment_device_group_id = None + self._default_system_group_id = None + self._dep = None + self._dep_access_token_expiry = None + self._dep_server_token_state = None self._id = None self._name = None self.discriminator = None - + if ades is not None: + self.ades = ades + if allow_mobile_user_enrollment is not None: + self.allow_mobile_user_enrollment = allow_mobile_user_enrollment + if apns_cert_expiry is not None: + self.apns_cert_expiry = apns_cert_expiry if apns_push_topic is not None: self.apns_push_topic = apns_push_topic + if default_ios_user_enrollment_device_group_id is not None: + self.default_ios_user_enrollment_device_group_id = default_ios_user_enrollment_device_group_id + if default_system_group_id is not None: + self.default_system_group_id = default_system_group_id + if dep is not None: + self.dep = dep + if dep_access_token_expiry is not None: + self.dep_access_token_expiry = dep_access_token_expiry + if dep_server_token_state is not None: + self.dep_server_token_state = dep_server_token_state self.id = id if name is not None: self.name = name + @property + def ades(self): + """Gets the ades of this AppleMDM. # noqa: E501 + + + :return: The ades of this AppleMDM. # noqa: E501 + :rtype: ADES + """ + return self._ades + + @ades.setter + def ades(self, ades): + """Sets the ades of this AppleMDM. + + + :param ades: The ades of this AppleMDM. # noqa: E501 + :type: ADES + """ + + self._ades = ades + + @property + def allow_mobile_user_enrollment(self): + """Gets the allow_mobile_user_enrollment of this AppleMDM. # noqa: E501 + + A toggle to allow mobile device enrollment for an organization. # noqa: E501 + + :return: The allow_mobile_user_enrollment of this AppleMDM. # noqa: E501 + :rtype: bool + """ + return self._allow_mobile_user_enrollment + + @allow_mobile_user_enrollment.setter + def allow_mobile_user_enrollment(self, allow_mobile_user_enrollment): + """Sets the allow_mobile_user_enrollment of this AppleMDM. + + A toggle to allow mobile device enrollment for an organization. # noqa: E501 + + :param allow_mobile_user_enrollment: The allow_mobile_user_enrollment of this AppleMDM. # noqa: E501 + :type: bool + """ + + self._allow_mobile_user_enrollment = allow_mobile_user_enrollment + + @property + def apns_cert_expiry(self): + """Gets the apns_cert_expiry of this AppleMDM. # noqa: E501 + + The expiration date and time for the APNS Certificate. # noqa: E501 + + :return: The apns_cert_expiry of this AppleMDM. # noqa: E501 + :rtype: str + """ + return self._apns_cert_expiry + + @apns_cert_expiry.setter + def apns_cert_expiry(self, apns_cert_expiry): + """Sets the apns_cert_expiry of this AppleMDM. + + The expiration date and time for the APNS Certificate. # noqa: E501 + + :param apns_cert_expiry: The apns_cert_expiry of this AppleMDM. # noqa: E501 + :type: str + """ + + self._apns_cert_expiry = apns_cert_expiry + @property def apns_push_topic(self): """Gets the apns_push_topic of this AppleMDM. # noqa: E501 @@ -79,6 +181,125 @@ def apns_push_topic(self, apns_push_topic): self._apns_push_topic = apns_push_topic + @property + def default_ios_user_enrollment_device_group_id(self): + """Gets the default_ios_user_enrollment_device_group_id of this AppleMDM. # noqa: E501 + + ObjectId uniquely identifying the MDM default iOS user enrollment device group. # noqa: E501 + + :return: The default_ios_user_enrollment_device_group_id of this AppleMDM. # noqa: E501 + :rtype: str + """ + return self._default_ios_user_enrollment_device_group_id + + @default_ios_user_enrollment_device_group_id.setter + def default_ios_user_enrollment_device_group_id(self, default_ios_user_enrollment_device_group_id): + """Sets the default_ios_user_enrollment_device_group_id of this AppleMDM. + + ObjectId uniquely identifying the MDM default iOS user enrollment device group. # noqa: E501 + + :param default_ios_user_enrollment_device_group_id: The default_ios_user_enrollment_device_group_id of this AppleMDM. # noqa: E501 + :type: str + """ + + self._default_ios_user_enrollment_device_group_id = default_ios_user_enrollment_device_group_id + + @property + def default_system_group_id(self): + """Gets the default_system_group_id of this AppleMDM. # noqa: E501 + + ObjectId uniquely identifying the MDM default System Group. # noqa: E501 + + :return: The default_system_group_id of this AppleMDM. # noqa: E501 + :rtype: str + """ + return self._default_system_group_id + + @default_system_group_id.setter + def default_system_group_id(self, default_system_group_id): + """Sets the default_system_group_id of this AppleMDM. + + ObjectId uniquely identifying the MDM default System Group. # noqa: E501 + + :param default_system_group_id: The default_system_group_id of this AppleMDM. # noqa: E501 + :type: str + """ + + self._default_system_group_id = default_system_group_id + + @property + def dep(self): + """Gets the dep of this AppleMDM. # noqa: E501 + + + :return: The dep of this AppleMDM. # noqa: E501 + :rtype: DEP + """ + return self._dep + + @dep.setter + def dep(self, dep): + """Sets the dep of this AppleMDM. + + + :param dep: The dep of this AppleMDM. # noqa: E501 + :type: DEP + """ + + self._dep = dep + + @property + def dep_access_token_expiry(self): + """Gets the dep_access_token_expiry of this AppleMDM. # noqa: E501 + + The expiration date and time for the DEP Access Token. This aligns with the DEP Server Token State. # noqa: E501 + + :return: The dep_access_token_expiry of this AppleMDM. # noqa: E501 + :rtype: str + """ + return self._dep_access_token_expiry + + @dep_access_token_expiry.setter + def dep_access_token_expiry(self, dep_access_token_expiry): + """Sets the dep_access_token_expiry of this AppleMDM. + + The expiration date and time for the DEP Access Token. This aligns with the DEP Server Token State. # noqa: E501 + + :param dep_access_token_expiry: The dep_access_token_expiry of this AppleMDM. # noqa: E501 + :type: str + """ + + self._dep_access_token_expiry = dep_access_token_expiry + + @property + def dep_server_token_state(self): + """Gets the dep_server_token_state of this AppleMDM. # noqa: E501 + + The state of the dep server token, presence and expiry. # noqa: E501 + + :return: The dep_server_token_state of this AppleMDM. # noqa: E501 + :rtype: str + """ + return self._dep_server_token_state + + @dep_server_token_state.setter + def dep_server_token_state(self, dep_server_token_state): + """Sets the dep_server_token_state of this AppleMDM. + + The state of the dep server token, presence and expiry. # noqa: E501 + + :param dep_server_token_state: The dep_server_token_state of this AppleMDM. # noqa: E501 + :type: str + """ + allowed_values = ["unknown", "missing", "valid", "expired"] # noqa: E501 + if dep_server_token_state not in allowed_values: + raise ValueError( + "Invalid value for `dep_server_token_state` ({0}), must be one of {1}" # noqa: E501 + .format(dep_server_token_state, allowed_values) + ) + + self._dep_server_token_state = dep_server_token_state + @property def id(self): """Gets the id of this AppleMDM. # noqa: E501 @@ -124,8 +345,6 @@ def name(self, name): :param name: The name of this AppleMDM. # noqa: E501 :type: str """ - if name is not None and len(name) > 255: - raise ValueError("Invalid value for `name`, length must be less than or equal to `255`") # noqa: E501 self._name = name diff --git a/jcapiv2/jcapiv2/models/apple_mdm_device.py b/jcapiv2/jcapiv2/models/apple_mdm_device.py new file mode 100644 index 0000000..163f14b --- /dev/null +++ b/jcapiv2/jcapiv2/models/apple_mdm_device.py @@ -0,0 +1,344 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AppleMdmDevice(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'str', + 'dep_registered': 'bool', + 'device_information': 'AppleMdmDeviceInfo', + 'enrolled': 'bool', + 'has_activation_lock_bypass_codes': 'bool', + 'id': 'str', + 'os_version': 'str', + 'security_info': 'AppleMdmDeviceSecurityInfo', + 'serial_number': 'str', + 'udid': 'str' + } + + attribute_map = { + 'created_at': 'createdAt', + 'dep_registered': 'depRegistered', + 'device_information': 'deviceInformation', + 'enrolled': 'enrolled', + 'has_activation_lock_bypass_codes': 'hasActivationLockBypassCodes', + 'id': 'id', + 'os_version': 'osVersion', + 'security_info': 'securityInfo', + 'serial_number': 'serialNumber', + 'udid': 'udid' + } + + def __init__(self, created_at=None, dep_registered=None, device_information=None, enrolled=None, has_activation_lock_bypass_codes=None, id=None, os_version=None, security_info=None, serial_number=None, udid=None): # noqa: E501 + """AppleMdmDevice - a model defined in Swagger""" # noqa: E501 + self._created_at = None + self._dep_registered = None + self._device_information = None + self._enrolled = None + self._has_activation_lock_bypass_codes = None + self._id = None + self._os_version = None + self._security_info = None + self._serial_number = None + self._udid = None + self.discriminator = None + if created_at is not None: + self.created_at = created_at + if dep_registered is not None: + self.dep_registered = dep_registered + if device_information is not None: + self.device_information = device_information + if enrolled is not None: + self.enrolled = enrolled + if has_activation_lock_bypass_codes is not None: + self.has_activation_lock_bypass_codes = has_activation_lock_bypass_codes + if id is not None: + self.id = id + if os_version is not None: + self.os_version = os_version + if security_info is not None: + self.security_info = security_info + if serial_number is not None: + self.serial_number = serial_number + if udid is not None: + self.udid = udid + + @property + def created_at(self): + """Gets the created_at of this AppleMdmDevice. # noqa: E501 + + + :return: The created_at of this AppleMdmDevice. # noqa: E501 + :rtype: str + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this AppleMdmDevice. + + + :param created_at: The created_at of this AppleMdmDevice. # noqa: E501 + :type: str + """ + + self._created_at = created_at + + @property + def dep_registered(self): + """Gets the dep_registered of this AppleMdmDevice. # noqa: E501 + + + :return: The dep_registered of this AppleMdmDevice. # noqa: E501 + :rtype: bool + """ + return self._dep_registered + + @dep_registered.setter + def dep_registered(self, dep_registered): + """Sets the dep_registered of this AppleMdmDevice. + + + :param dep_registered: The dep_registered of this AppleMdmDevice. # noqa: E501 + :type: bool + """ + + self._dep_registered = dep_registered + + @property + def device_information(self): + """Gets the device_information of this AppleMdmDevice. # noqa: E501 + + + :return: The device_information of this AppleMdmDevice. # noqa: E501 + :rtype: AppleMdmDeviceInfo + """ + return self._device_information + + @device_information.setter + def device_information(self, device_information): + """Sets the device_information of this AppleMdmDevice. + + + :param device_information: The device_information of this AppleMdmDevice. # noqa: E501 + :type: AppleMdmDeviceInfo + """ + + self._device_information = device_information + + @property + def enrolled(self): + """Gets the enrolled of this AppleMdmDevice. # noqa: E501 + + + :return: The enrolled of this AppleMdmDevice. # noqa: E501 + :rtype: bool + """ + return self._enrolled + + @enrolled.setter + def enrolled(self, enrolled): + """Sets the enrolled of this AppleMdmDevice. + + + :param enrolled: The enrolled of this AppleMdmDevice. # noqa: E501 + :type: bool + """ + + self._enrolled = enrolled + + @property + def has_activation_lock_bypass_codes(self): + """Gets the has_activation_lock_bypass_codes of this AppleMdmDevice. # noqa: E501 + + + :return: The has_activation_lock_bypass_codes of this AppleMdmDevice. # noqa: E501 + :rtype: bool + """ + return self._has_activation_lock_bypass_codes + + @has_activation_lock_bypass_codes.setter + def has_activation_lock_bypass_codes(self, has_activation_lock_bypass_codes): + """Sets the has_activation_lock_bypass_codes of this AppleMdmDevice. + + + :param has_activation_lock_bypass_codes: The has_activation_lock_bypass_codes of this AppleMdmDevice. # noqa: E501 + :type: bool + """ + + self._has_activation_lock_bypass_codes = has_activation_lock_bypass_codes + + @property + def id(self): + """Gets the id of this AppleMdmDevice. # noqa: E501 + + + :return: The id of this AppleMdmDevice. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AppleMdmDevice. + + + :param id: The id of this AppleMdmDevice. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def os_version(self): + """Gets the os_version of this AppleMdmDevice. # noqa: E501 + + + :return: The os_version of this AppleMdmDevice. # noqa: E501 + :rtype: str + """ + return self._os_version + + @os_version.setter + def os_version(self, os_version): + """Sets the os_version of this AppleMdmDevice. + + + :param os_version: The os_version of this AppleMdmDevice. # noqa: E501 + :type: str + """ + + self._os_version = os_version + + @property + def security_info(self): + """Gets the security_info of this AppleMdmDevice. # noqa: E501 + + + :return: The security_info of this AppleMdmDevice. # noqa: E501 + :rtype: AppleMdmDeviceSecurityInfo + """ + return self._security_info + + @security_info.setter + def security_info(self, security_info): + """Sets the security_info of this AppleMdmDevice. + + + :param security_info: The security_info of this AppleMdmDevice. # noqa: E501 + :type: AppleMdmDeviceSecurityInfo + """ + + self._security_info = security_info + + @property + def serial_number(self): + """Gets the serial_number of this AppleMdmDevice. # noqa: E501 + + + :return: The serial_number of this AppleMdmDevice. # noqa: E501 + :rtype: str + """ + return self._serial_number + + @serial_number.setter + def serial_number(self, serial_number): + """Sets the serial_number of this AppleMdmDevice. + + + :param serial_number: The serial_number of this AppleMdmDevice. # noqa: E501 + :type: str + """ + + self._serial_number = serial_number + + @property + def udid(self): + """Gets the udid of this AppleMdmDevice. # noqa: E501 + + + :return: The udid of this AppleMdmDevice. # noqa: E501 + :rtype: str + """ + return self._udid + + @udid.setter + def udid(self, udid): + """Sets the udid of this AppleMdmDevice. + + + :param udid: The udid of this AppleMdmDevice. # noqa: E501 + :type: str + """ + + self._udid = udid + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AppleMdmDevice, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AppleMdmDevice): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/apple_mdm_device_info.py b/jcapiv2/jcapiv2/models/apple_mdm_device_info.py new file mode 100644 index 0000000..46ef2a2 --- /dev/null +++ b/jcapiv2/jcapiv2/models/apple_mdm_device_info.py @@ -0,0 +1,448 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AppleMdmDeviceInfo(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'activation_lock_allowed_while_supervised': 'bool', + 'available_device_capacity': 'float', + 'device_capacity': 'float', + 'device_name': 'str', + 'iccid': 'str', + 'imei': 'str', + 'is_activation_lock_enabled': 'bool', + 'is_supervised': 'bool', + 'model_name': 'str', + 'second_iccid': 'str', + 'second_imei': 'str', + 'second_subscriber_carrier_network': 'str', + 'subscriber_carrier_network': 'str', + 'wifi_mac': 'str' + } + + attribute_map = { + 'activation_lock_allowed_while_supervised': 'activationLockAllowedWhileSupervised', + 'available_device_capacity': 'availableDeviceCapacity', + 'device_capacity': 'deviceCapacity', + 'device_name': 'deviceName', + 'iccid': 'iccid', + 'imei': 'imei', + 'is_activation_lock_enabled': 'isActivationLockEnabled', + 'is_supervised': 'isSupervised', + 'model_name': 'modelName', + 'second_iccid': 'secondIccid', + 'second_imei': 'secondImei', + 'second_subscriber_carrier_network': 'secondSubscriberCarrierNetwork', + 'subscriber_carrier_network': 'subscriberCarrierNetwork', + 'wifi_mac': 'wifiMac' + } + + def __init__(self, activation_lock_allowed_while_supervised=None, available_device_capacity=None, device_capacity=None, device_name=None, iccid=None, imei=None, is_activation_lock_enabled=None, is_supervised=None, model_name=None, second_iccid=None, second_imei=None, second_subscriber_carrier_network=None, subscriber_carrier_network=None, wifi_mac=None): # noqa: E501 + """AppleMdmDeviceInfo - a model defined in Swagger""" # noqa: E501 + self._activation_lock_allowed_while_supervised = None + self._available_device_capacity = None + self._device_capacity = None + self._device_name = None + self._iccid = None + self._imei = None + self._is_activation_lock_enabled = None + self._is_supervised = None + self._model_name = None + self._second_iccid = None + self._second_imei = None + self._second_subscriber_carrier_network = None + self._subscriber_carrier_network = None + self._wifi_mac = None + self.discriminator = None + if activation_lock_allowed_while_supervised is not None: + self.activation_lock_allowed_while_supervised = activation_lock_allowed_while_supervised + if available_device_capacity is not None: + self.available_device_capacity = available_device_capacity + if device_capacity is not None: + self.device_capacity = device_capacity + if device_name is not None: + self.device_name = device_name + if iccid is not None: + self.iccid = iccid + if imei is not None: + self.imei = imei + if is_activation_lock_enabled is not None: + self.is_activation_lock_enabled = is_activation_lock_enabled + if is_supervised is not None: + self.is_supervised = is_supervised + if model_name is not None: + self.model_name = model_name + if second_iccid is not None: + self.second_iccid = second_iccid + if second_imei is not None: + self.second_imei = second_imei + if second_subscriber_carrier_network is not None: + self.second_subscriber_carrier_network = second_subscriber_carrier_network + if subscriber_carrier_network is not None: + self.subscriber_carrier_network = subscriber_carrier_network + if wifi_mac is not None: + self.wifi_mac = wifi_mac + + @property + def activation_lock_allowed_while_supervised(self): + """Gets the activation_lock_allowed_while_supervised of this AppleMdmDeviceInfo. # noqa: E501 + + + :return: The activation_lock_allowed_while_supervised of this AppleMdmDeviceInfo. # noqa: E501 + :rtype: bool + """ + return self._activation_lock_allowed_while_supervised + + @activation_lock_allowed_while_supervised.setter + def activation_lock_allowed_while_supervised(self, activation_lock_allowed_while_supervised): + """Sets the activation_lock_allowed_while_supervised of this AppleMdmDeviceInfo. + + + :param activation_lock_allowed_while_supervised: The activation_lock_allowed_while_supervised of this AppleMdmDeviceInfo. # noqa: E501 + :type: bool + """ + + self._activation_lock_allowed_while_supervised = activation_lock_allowed_while_supervised + + @property + def available_device_capacity(self): + """Gets the available_device_capacity of this AppleMdmDeviceInfo. # noqa: E501 + + + :return: The available_device_capacity of this AppleMdmDeviceInfo. # noqa: E501 + :rtype: float + """ + return self._available_device_capacity + + @available_device_capacity.setter + def available_device_capacity(self, available_device_capacity): + """Sets the available_device_capacity of this AppleMdmDeviceInfo. + + + :param available_device_capacity: The available_device_capacity of this AppleMdmDeviceInfo. # noqa: E501 + :type: float + """ + + self._available_device_capacity = available_device_capacity + + @property + def device_capacity(self): + """Gets the device_capacity of this AppleMdmDeviceInfo. # noqa: E501 + + + :return: The device_capacity of this AppleMdmDeviceInfo. # noqa: E501 + :rtype: float + """ + return self._device_capacity + + @device_capacity.setter + def device_capacity(self, device_capacity): + """Sets the device_capacity of this AppleMdmDeviceInfo. + + + :param device_capacity: The device_capacity of this AppleMdmDeviceInfo. # noqa: E501 + :type: float + """ + + self._device_capacity = device_capacity + + @property + def device_name(self): + """Gets the device_name of this AppleMdmDeviceInfo. # noqa: E501 + + + :return: The device_name of this AppleMdmDeviceInfo. # noqa: E501 + :rtype: str + """ + return self._device_name + + @device_name.setter + def device_name(self, device_name): + """Sets the device_name of this AppleMdmDeviceInfo. + + + :param device_name: The device_name of this AppleMdmDeviceInfo. # noqa: E501 + :type: str + """ + + self._device_name = device_name + + @property + def iccid(self): + """Gets the iccid of this AppleMdmDeviceInfo. # noqa: E501 + + + :return: The iccid of this AppleMdmDeviceInfo. # noqa: E501 + :rtype: str + """ + return self._iccid + + @iccid.setter + def iccid(self, iccid): + """Sets the iccid of this AppleMdmDeviceInfo. + + + :param iccid: The iccid of this AppleMdmDeviceInfo. # noqa: E501 + :type: str + """ + + self._iccid = iccid + + @property + def imei(self): + """Gets the imei of this AppleMdmDeviceInfo. # noqa: E501 + + + :return: The imei of this AppleMdmDeviceInfo. # noqa: E501 + :rtype: str + """ + return self._imei + + @imei.setter + def imei(self, imei): + """Sets the imei of this AppleMdmDeviceInfo. + + + :param imei: The imei of this AppleMdmDeviceInfo. # noqa: E501 + :type: str + """ + + self._imei = imei + + @property + def is_activation_lock_enabled(self): + """Gets the is_activation_lock_enabled of this AppleMdmDeviceInfo. # noqa: E501 + + + :return: The is_activation_lock_enabled of this AppleMdmDeviceInfo. # noqa: E501 + :rtype: bool + """ + return self._is_activation_lock_enabled + + @is_activation_lock_enabled.setter + def is_activation_lock_enabled(self, is_activation_lock_enabled): + """Sets the is_activation_lock_enabled of this AppleMdmDeviceInfo. + + + :param is_activation_lock_enabled: The is_activation_lock_enabled of this AppleMdmDeviceInfo. # noqa: E501 + :type: bool + """ + + self._is_activation_lock_enabled = is_activation_lock_enabled + + @property + def is_supervised(self): + """Gets the is_supervised of this AppleMdmDeviceInfo. # noqa: E501 + + + :return: The is_supervised of this AppleMdmDeviceInfo. # noqa: E501 + :rtype: bool + """ + return self._is_supervised + + @is_supervised.setter + def is_supervised(self, is_supervised): + """Sets the is_supervised of this AppleMdmDeviceInfo. + + + :param is_supervised: The is_supervised of this AppleMdmDeviceInfo. # noqa: E501 + :type: bool + """ + + self._is_supervised = is_supervised + + @property + def model_name(self): + """Gets the model_name of this AppleMdmDeviceInfo. # noqa: E501 + + + :return: The model_name of this AppleMdmDeviceInfo. # noqa: E501 + :rtype: str + """ + return self._model_name + + @model_name.setter + def model_name(self, model_name): + """Sets the model_name of this AppleMdmDeviceInfo. + + + :param model_name: The model_name of this AppleMdmDeviceInfo. # noqa: E501 + :type: str + """ + + self._model_name = model_name + + @property + def second_iccid(self): + """Gets the second_iccid of this AppleMdmDeviceInfo. # noqa: E501 + + + :return: The second_iccid of this AppleMdmDeviceInfo. # noqa: E501 + :rtype: str + """ + return self._second_iccid + + @second_iccid.setter + def second_iccid(self, second_iccid): + """Sets the second_iccid of this AppleMdmDeviceInfo. + + + :param second_iccid: The second_iccid of this AppleMdmDeviceInfo. # noqa: E501 + :type: str + """ + + self._second_iccid = second_iccid + + @property + def second_imei(self): + """Gets the second_imei of this AppleMdmDeviceInfo. # noqa: E501 + + + :return: The second_imei of this AppleMdmDeviceInfo. # noqa: E501 + :rtype: str + """ + return self._second_imei + + @second_imei.setter + def second_imei(self, second_imei): + """Sets the second_imei of this AppleMdmDeviceInfo. + + + :param second_imei: The second_imei of this AppleMdmDeviceInfo. # noqa: E501 + :type: str + """ + + self._second_imei = second_imei + + @property + def second_subscriber_carrier_network(self): + """Gets the second_subscriber_carrier_network of this AppleMdmDeviceInfo. # noqa: E501 + + + :return: The second_subscriber_carrier_network of this AppleMdmDeviceInfo. # noqa: E501 + :rtype: str + """ + return self._second_subscriber_carrier_network + + @second_subscriber_carrier_network.setter + def second_subscriber_carrier_network(self, second_subscriber_carrier_network): + """Sets the second_subscriber_carrier_network of this AppleMdmDeviceInfo. + + + :param second_subscriber_carrier_network: The second_subscriber_carrier_network of this AppleMdmDeviceInfo. # noqa: E501 + :type: str + """ + + self._second_subscriber_carrier_network = second_subscriber_carrier_network + + @property + def subscriber_carrier_network(self): + """Gets the subscriber_carrier_network of this AppleMdmDeviceInfo. # noqa: E501 + + + :return: The subscriber_carrier_network of this AppleMdmDeviceInfo. # noqa: E501 + :rtype: str + """ + return self._subscriber_carrier_network + + @subscriber_carrier_network.setter + def subscriber_carrier_network(self, subscriber_carrier_network): + """Sets the subscriber_carrier_network of this AppleMdmDeviceInfo. + + + :param subscriber_carrier_network: The subscriber_carrier_network of this AppleMdmDeviceInfo. # noqa: E501 + :type: str + """ + + self._subscriber_carrier_network = subscriber_carrier_network + + @property + def wifi_mac(self): + """Gets the wifi_mac of this AppleMdmDeviceInfo. # noqa: E501 + + + :return: The wifi_mac of this AppleMdmDeviceInfo. # noqa: E501 + :rtype: str + """ + return self._wifi_mac + + @wifi_mac.setter + def wifi_mac(self, wifi_mac): + """Sets the wifi_mac of this AppleMdmDeviceInfo. + + + :param wifi_mac: The wifi_mac of this AppleMdmDeviceInfo. # noqa: E501 + :type: str + """ + + self._wifi_mac = wifi_mac + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AppleMdmDeviceInfo, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AppleMdmDeviceInfo): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/apple_mdm_device_security_info.py b/jcapiv2/jcapiv2/models/apple_mdm_device_security_info.py new file mode 100644 index 0000000..40d05fe --- /dev/null +++ b/jcapiv2/jcapiv2/models/apple_mdm_device_security_info.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AppleMdmDeviceSecurityInfo(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'enrolled_via_dep': 'bool', + 'is_activation_lock_manageable': 'bool', + 'is_user_enrollment': 'bool', + 'passcode_present': 'bool', + 'user_approved_enrollment': 'bool' + } + + attribute_map = { + 'enrolled_via_dep': 'enrolledViaDep', + 'is_activation_lock_manageable': 'isActivationLockManageable', + 'is_user_enrollment': 'isUserEnrollment', + 'passcode_present': 'passcodePresent', + 'user_approved_enrollment': 'userApprovedEnrollment' + } + + def __init__(self, enrolled_via_dep=None, is_activation_lock_manageable=None, is_user_enrollment=None, passcode_present=None, user_approved_enrollment=None): # noqa: E501 + """AppleMdmDeviceSecurityInfo - a model defined in Swagger""" # noqa: E501 + self._enrolled_via_dep = None + self._is_activation_lock_manageable = None + self._is_user_enrollment = None + self._passcode_present = None + self._user_approved_enrollment = None + self.discriminator = None + if enrolled_via_dep is not None: + self.enrolled_via_dep = enrolled_via_dep + if is_activation_lock_manageable is not None: + self.is_activation_lock_manageable = is_activation_lock_manageable + if is_user_enrollment is not None: + self.is_user_enrollment = is_user_enrollment + if passcode_present is not None: + self.passcode_present = passcode_present + if user_approved_enrollment is not None: + self.user_approved_enrollment = user_approved_enrollment + + @property + def enrolled_via_dep(self): + """Gets the enrolled_via_dep of this AppleMdmDeviceSecurityInfo. # noqa: E501 + + + :return: The enrolled_via_dep of this AppleMdmDeviceSecurityInfo. # noqa: E501 + :rtype: bool + """ + return self._enrolled_via_dep + + @enrolled_via_dep.setter + def enrolled_via_dep(self, enrolled_via_dep): + """Sets the enrolled_via_dep of this AppleMdmDeviceSecurityInfo. + + + :param enrolled_via_dep: The enrolled_via_dep of this AppleMdmDeviceSecurityInfo. # noqa: E501 + :type: bool + """ + + self._enrolled_via_dep = enrolled_via_dep + + @property + def is_activation_lock_manageable(self): + """Gets the is_activation_lock_manageable of this AppleMdmDeviceSecurityInfo. # noqa: E501 + + + :return: The is_activation_lock_manageable of this AppleMdmDeviceSecurityInfo. # noqa: E501 + :rtype: bool + """ + return self._is_activation_lock_manageable + + @is_activation_lock_manageable.setter + def is_activation_lock_manageable(self, is_activation_lock_manageable): + """Sets the is_activation_lock_manageable of this AppleMdmDeviceSecurityInfo. + + + :param is_activation_lock_manageable: The is_activation_lock_manageable of this AppleMdmDeviceSecurityInfo. # noqa: E501 + :type: bool + """ + + self._is_activation_lock_manageable = is_activation_lock_manageable + + @property + def is_user_enrollment(self): + """Gets the is_user_enrollment of this AppleMdmDeviceSecurityInfo. # noqa: E501 + + + :return: The is_user_enrollment of this AppleMdmDeviceSecurityInfo. # noqa: E501 + :rtype: bool + """ + return self._is_user_enrollment + + @is_user_enrollment.setter + def is_user_enrollment(self, is_user_enrollment): + """Sets the is_user_enrollment of this AppleMdmDeviceSecurityInfo. + + + :param is_user_enrollment: The is_user_enrollment of this AppleMdmDeviceSecurityInfo. # noqa: E501 + :type: bool + """ + + self._is_user_enrollment = is_user_enrollment + + @property + def passcode_present(self): + """Gets the passcode_present of this AppleMdmDeviceSecurityInfo. # noqa: E501 + + + :return: The passcode_present of this AppleMdmDeviceSecurityInfo. # noqa: E501 + :rtype: bool + """ + return self._passcode_present + + @passcode_present.setter + def passcode_present(self, passcode_present): + """Sets the passcode_present of this AppleMdmDeviceSecurityInfo. + + + :param passcode_present: The passcode_present of this AppleMdmDeviceSecurityInfo. # noqa: E501 + :type: bool + """ + + self._passcode_present = passcode_present + + @property + def user_approved_enrollment(self): + """Gets the user_approved_enrollment of this AppleMdmDeviceSecurityInfo. # noqa: E501 + + + :return: The user_approved_enrollment of this AppleMdmDeviceSecurityInfo. # noqa: E501 + :rtype: bool + """ + return self._user_approved_enrollment + + @user_approved_enrollment.setter + def user_approved_enrollment(self, user_approved_enrollment): + """Sets the user_approved_enrollment of this AppleMdmDeviceSecurityInfo. + + + :param user_approved_enrollment: The user_approved_enrollment of this AppleMdmDeviceSecurityInfo. # noqa: E501 + :type: bool + """ + + self._user_approved_enrollment = user_approved_enrollment + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AppleMdmDeviceSecurityInfo, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AppleMdmDeviceSecurityInfo): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/apple_mdm_patch_input.py b/jcapiv2/jcapiv2/models/apple_mdm_patch_input.py index e947481..17b15db 100644 --- a/jcapiv2/jcapiv2/models/apple_mdm_patch_input.py +++ b/jcapiv2/jcapiv2/models/apple_mdm_patch_input.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class AppleMdmPatchInput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,27 +28,99 @@ class AppleMdmPatchInput(object): and the value is json key in definition. """ swagger_types = { + 'ades': 'ADES', + 'allow_mobile_user_enrollment': 'bool', 'apple_signed_cert': 'str', + 'default_ios_user_enrollment_device_group_id': 'str', + 'default_system_group_id': 'str', + 'dep': 'DEP', + 'encrypted_dep_server_token': 'str', 'name': 'str' } attribute_map = { + 'ades': 'ades', + 'allow_mobile_user_enrollment': 'allowMobileUserEnrollment', 'apple_signed_cert': 'appleSignedCert', + 'default_ios_user_enrollment_device_group_id': 'defaultIosUserEnrollmentDeviceGroupID', + 'default_system_group_id': 'defaultSystemGroupID', + 'dep': 'dep', + 'encrypted_dep_server_token': 'encryptedDepServerToken', 'name': 'name' } - def __init__(self, apple_signed_cert=None, name=None): # noqa: E501 + def __init__(self, ades=None, allow_mobile_user_enrollment=None, apple_signed_cert=None, default_ios_user_enrollment_device_group_id=None, default_system_group_id=None, dep=None, encrypted_dep_server_token=None, name=None): # noqa: E501 """AppleMdmPatchInput - a model defined in Swagger""" # noqa: E501 - + self._ades = None + self._allow_mobile_user_enrollment = None self._apple_signed_cert = None + self._default_ios_user_enrollment_device_group_id = None + self._default_system_group_id = None + self._dep = None + self._encrypted_dep_server_token = None self._name = None self.discriminator = None - + if ades is not None: + self.ades = ades + if allow_mobile_user_enrollment is not None: + self.allow_mobile_user_enrollment = allow_mobile_user_enrollment if apple_signed_cert is not None: self.apple_signed_cert = apple_signed_cert + if default_ios_user_enrollment_device_group_id is not None: + self.default_ios_user_enrollment_device_group_id = default_ios_user_enrollment_device_group_id + if default_system_group_id is not None: + self.default_system_group_id = default_system_group_id + if dep is not None: + self.dep = dep + if encrypted_dep_server_token is not None: + self.encrypted_dep_server_token = encrypted_dep_server_token if name is not None: self.name = name + @property + def ades(self): + """Gets the ades of this AppleMdmPatchInput. # noqa: E501 + + + :return: The ades of this AppleMdmPatchInput. # noqa: E501 + :rtype: ADES + """ + return self._ades + + @ades.setter + def ades(self, ades): + """Sets the ades of this AppleMdmPatchInput. + + + :param ades: The ades of this AppleMdmPatchInput. # noqa: E501 + :type: ADES + """ + + self._ades = ades + + @property + def allow_mobile_user_enrollment(self): + """Gets the allow_mobile_user_enrollment of this AppleMdmPatchInput. # noqa: E501 + + A toggle to allow mobile device enrollment for an organization. # noqa: E501 + + :return: The allow_mobile_user_enrollment of this AppleMdmPatchInput. # noqa: E501 + :rtype: bool + """ + return self._allow_mobile_user_enrollment + + @allow_mobile_user_enrollment.setter + def allow_mobile_user_enrollment(self, allow_mobile_user_enrollment): + """Sets the allow_mobile_user_enrollment of this AppleMdmPatchInput. + + A toggle to allow mobile device enrollment for an organization. # noqa: E501 + + :param allow_mobile_user_enrollment: The allow_mobile_user_enrollment of this AppleMdmPatchInput. # noqa: E501 + :type: bool + """ + + self._allow_mobile_user_enrollment = allow_mobile_user_enrollment + @property def apple_signed_cert(self): """Gets the apple_signed_cert of this AppleMdmPatchInput. # noqa: E501 @@ -75,6 +144,96 @@ def apple_signed_cert(self, apple_signed_cert): self._apple_signed_cert = apple_signed_cert + @property + def default_ios_user_enrollment_device_group_id(self): + """Gets the default_ios_user_enrollment_device_group_id of this AppleMdmPatchInput. # noqa: E501 + + ObjectId uniquely identifying the MDM default iOS user enrollment device group. # noqa: E501 + + :return: The default_ios_user_enrollment_device_group_id of this AppleMdmPatchInput. # noqa: E501 + :rtype: str + """ + return self._default_ios_user_enrollment_device_group_id + + @default_ios_user_enrollment_device_group_id.setter + def default_ios_user_enrollment_device_group_id(self, default_ios_user_enrollment_device_group_id): + """Sets the default_ios_user_enrollment_device_group_id of this AppleMdmPatchInput. + + ObjectId uniquely identifying the MDM default iOS user enrollment device group. # noqa: E501 + + :param default_ios_user_enrollment_device_group_id: The default_ios_user_enrollment_device_group_id of this AppleMdmPatchInput. # noqa: E501 + :type: str + """ + + self._default_ios_user_enrollment_device_group_id = default_ios_user_enrollment_device_group_id + + @property + def default_system_group_id(self): + """Gets the default_system_group_id of this AppleMdmPatchInput. # noqa: E501 + + ObjectId uniquely identifying the MDM default System Group. # noqa: E501 + + :return: The default_system_group_id of this AppleMdmPatchInput. # noqa: E501 + :rtype: str + """ + return self._default_system_group_id + + @default_system_group_id.setter + def default_system_group_id(self, default_system_group_id): + """Sets the default_system_group_id of this AppleMdmPatchInput. + + ObjectId uniquely identifying the MDM default System Group. # noqa: E501 + + :param default_system_group_id: The default_system_group_id of this AppleMdmPatchInput. # noqa: E501 + :type: str + """ + + self._default_system_group_id = default_system_group_id + + @property + def dep(self): + """Gets the dep of this AppleMdmPatchInput. # noqa: E501 + + + :return: The dep of this AppleMdmPatchInput. # noqa: E501 + :rtype: DEP + """ + return self._dep + + @dep.setter + def dep(self, dep): + """Sets the dep of this AppleMdmPatchInput. + + + :param dep: The dep of this AppleMdmPatchInput. # noqa: E501 + :type: DEP + """ + + self._dep = dep + + @property + def encrypted_dep_server_token(self): + """Gets the encrypted_dep_server_token of this AppleMdmPatchInput. # noqa: E501 + + The S/MIME encoded DEP Server Token returned by Apple Business Manager when creating an MDM instance. # noqa: E501 + + :return: The encrypted_dep_server_token of this AppleMdmPatchInput. # noqa: E501 + :rtype: str + """ + return self._encrypted_dep_server_token + + @encrypted_dep_server_token.setter + def encrypted_dep_server_token(self, encrypted_dep_server_token): + """Sets the encrypted_dep_server_token of this AppleMdmPatchInput. + + The S/MIME encoded DEP Server Token returned by Apple Business Manager when creating an MDM instance. # noqa: E501 + + :param encrypted_dep_server_token: The encrypted_dep_server_token of this AppleMdmPatchInput. # noqa: E501 + :type: str + """ + + self._encrypted_dep_server_token = encrypted_dep_server_token + @property def name(self): """Gets the name of this AppleMdmPatchInput. # noqa: E501 @@ -95,8 +254,6 @@ def name(self, name): :param name: The name of this AppleMdmPatchInput. # noqa: E501 :type: str """ - if name is not None and len(name) > 255: - raise ValueError("Invalid value for `name`, length must be less than or equal to `255`") # noqa: E501 self._name = name diff --git a/jcapiv2/jcapiv2/models/apple_mdm_public_key_cert.py b/jcapiv2/jcapiv2/models/apple_mdm_public_key_cert.py new file mode 100644 index 0000000..14d45da --- /dev/null +++ b/jcapiv2/jcapiv2/models/apple_mdm_public_key_cert.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AppleMdmPublicKeyCert(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """AppleMdmPublicKeyCert - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AppleMdmPublicKeyCert, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AppleMdmPublicKeyCert): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/apple_mdm_signed_csr_plist.py b/jcapiv2/jcapiv2/models/apple_mdm_signed_csr_plist.py new file mode 100644 index 0000000..1e9cb34 --- /dev/null +++ b/jcapiv2/jcapiv2/models/apple_mdm_signed_csr_plist.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AppleMdmSignedCsrPlist(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """AppleMdmSignedCsrPlist - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AppleMdmSignedCsrPlist, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AppleMdmSignedCsrPlist): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/application_id_logo_body.py b/jcapiv2/jcapiv2/models/application_id_logo_body.py new file mode 100644 index 0000000..479519f --- /dev/null +++ b/jcapiv2/jcapiv2/models/application_id_logo_body.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ApplicationIdLogoBody(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'image': 'str' + } + + attribute_map = { + 'image': 'image' + } + + def __init__(self, image=None): # noqa: E501 + """ApplicationIdLogoBody - a model defined in Swagger""" # noqa: E501 + self._image = None + self.discriminator = None + if image is not None: + self.image = image + + @property + def image(self): + """Gets the image of this ApplicationIdLogoBody. # noqa: E501 + + The file to upload. # noqa: E501 + + :return: The image of this ApplicationIdLogoBody. # noqa: E501 + :rtype: str + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this ApplicationIdLogoBody. + + The file to upload. # noqa: E501 + + :param image: The image of this ApplicationIdLogoBody. # noqa: E501 + :type: str + """ + + self._image = image + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ApplicationIdLogoBody, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApplicationIdLogoBody): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/auth_info.py b/jcapiv2/jcapiv2/models/auth_info.py index 6720fbb..3894ed5 100644 --- a/jcapiv2/jcapiv2/models/auth_info.py +++ b/jcapiv2/jcapiv2/models/auth_info.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class AuthInfo(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,12 +41,10 @@ class AuthInfo(object): def __init__(self, expiry=None, is_valid=None, message=None): # noqa: E501 """AuthInfo - a model defined in Swagger""" # noqa: E501 - self._expiry = None self._is_valid = None self._message = None self.discriminator = None - if expiry is not None: self.expiry = expiry if is_valid is not None: diff --git a/jcapiv2/jcapiv2/models/auth_input.py b/jcapiv2/jcapiv2/models/auth_input.py index f2d2993..2afe0ce 100644 --- a/jcapiv2/jcapiv2/models/auth_input.py +++ b/jcapiv2/jcapiv2/models/auth_input.py @@ -1,31 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.authinput_basic import AuthinputBasic # noqa: F401,E501 -from jcapiv2.models.authinput_oauth import AuthinputOauth # noqa: F401,E501 - - class AuthInput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -45,11 +39,9 @@ class AuthInput(object): def __init__(self, basic=None, oauth=None): # noqa: E501 """AuthInput - a model defined in Swagger""" # noqa: E501 - self._basic = None self._oauth = None self.discriminator = None - if basic is not None: self.basic = basic if oauth is not None: diff --git a/jcapiv2/jcapiv2/models/auth_input_object.py b/jcapiv2/jcapiv2/models/auth_input_object.py index e2b1d12..186f4a8 100644 --- a/jcapiv2/jcapiv2/models/auth_input_object.py +++ b/jcapiv2/jcapiv2/models/auth_input_object.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.auth_input import AuthInput # noqa: F401,E501 - - class AuthInputObject(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,10 +37,8 @@ class AuthInputObject(object): def __init__(self, auth=None): # noqa: E501 """AuthInputObject - a model defined in Swagger""" # noqa: E501 - self._auth = None self.discriminator = None - if auth is not None: self.auth = auth diff --git a/jcapiv2/jcapiv2/models/authinput_basic.py b/jcapiv2/jcapiv2/models/authinput_basic.py index b954288..8fb1df0 100644 --- a/jcapiv2/jcapiv2/models/authinput_basic.py +++ b/jcapiv2/jcapiv2/models/authinput_basic.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class AuthinputBasic(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,11 +39,9 @@ class AuthinputBasic(object): def __init__(self, password=None, username=None): # noqa: E501 """AuthinputBasic - a model defined in Swagger""" # noqa: E501 - self._password = None self._username = None self.discriminator = None - if password is not None: self.password = password if username is not None: diff --git a/jcapiv2/jcapiv2/models/authinput_oauth.py b/jcapiv2/jcapiv2/models/authinput_oauth.py index 253dc84..5e7169c 100644 --- a/jcapiv2/jcapiv2/models/authinput_oauth.py +++ b/jcapiv2/jcapiv2/models/authinput_oauth.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class AuthinputOauth(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,10 +37,8 @@ class AuthinputOauth(object): def __init__(self, code=None): # noqa: E501 """AuthinputOauth - a model defined in Swagger""" # noqa: E501 - self._code = None self.discriminator = None - if code is not None: self.code = code diff --git a/jcapiv2/jcapiv2/models/authn_policy.py b/jcapiv2/jcapiv2/models/authn_policy.py new file mode 100644 index 0000000..fd2c78c --- /dev/null +++ b/jcapiv2/jcapiv2/models/authn_policy.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AuthnPolicy(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'conditions': 'object', + 'description': 'str', + 'disabled': 'bool', + 'effect': 'AuthnPolicyEffect', + 'id': 'str', + 'name': 'str', + 'targets': 'AuthnPolicyTargets', + 'type': 'AuthnPolicyType' + } + + attribute_map = { + 'conditions': 'conditions', + 'description': 'description', + 'disabled': 'disabled', + 'effect': 'effect', + 'id': 'id', + 'name': 'name', + 'targets': 'targets', + 'type': 'type' + } + + def __init__(self, conditions=None, description=None, disabled=None, effect=None, id=None, name=None, targets=None, type=None): # noqa: E501 + """AuthnPolicy - a model defined in Swagger""" # noqa: E501 + self._conditions = None + self._description = None + self._disabled = None + self._effect = None + self._id = None + self._name = None + self._targets = None + self._type = None + self.discriminator = None + if conditions is not None: + self.conditions = conditions + if description is not None: + self.description = description + if disabled is not None: + self.disabled = disabled + if effect is not None: + self.effect = effect + if id is not None: + self.id = id + if name is not None: + self.name = name + if targets is not None: + self.targets = targets + if type is not None: + self.type = type + + @property + def conditions(self): + """Gets the conditions of this AuthnPolicy. # noqa: E501 + + + :return: The conditions of this AuthnPolicy. # noqa: E501 + :rtype: object + """ + return self._conditions + + @conditions.setter + def conditions(self, conditions): + """Sets the conditions of this AuthnPolicy. + + + :param conditions: The conditions of this AuthnPolicy. # noqa: E501 + :type: object + """ + + self._conditions = conditions + + @property + def description(self): + """Gets the description of this AuthnPolicy. # noqa: E501 + + + :return: The description of this AuthnPolicy. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this AuthnPolicy. + + + :param description: The description of this AuthnPolicy. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def disabled(self): + """Gets the disabled of this AuthnPolicy. # noqa: E501 + + + :return: The disabled of this AuthnPolicy. # noqa: E501 + :rtype: bool + """ + return self._disabled + + @disabled.setter + def disabled(self, disabled): + """Sets the disabled of this AuthnPolicy. + + + :param disabled: The disabled of this AuthnPolicy. # noqa: E501 + :type: bool + """ + + self._disabled = disabled + + @property + def effect(self): + """Gets the effect of this AuthnPolicy. # noqa: E501 + + + :return: The effect of this AuthnPolicy. # noqa: E501 + :rtype: AuthnPolicyEffect + """ + return self._effect + + @effect.setter + def effect(self, effect): + """Sets the effect of this AuthnPolicy. + + + :param effect: The effect of this AuthnPolicy. # noqa: E501 + :type: AuthnPolicyEffect + """ + + self._effect = effect + + @property + def id(self): + """Gets the id of this AuthnPolicy. # noqa: E501 + + + :return: The id of this AuthnPolicy. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AuthnPolicy. + + + :param id: The id of this AuthnPolicy. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this AuthnPolicy. # noqa: E501 + + + :return: The name of this AuthnPolicy. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AuthnPolicy. + + + :param name: The name of this AuthnPolicy. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def targets(self): + """Gets the targets of this AuthnPolicy. # noqa: E501 + + + :return: The targets of this AuthnPolicy. # noqa: E501 + :rtype: AuthnPolicyTargets + """ + return self._targets + + @targets.setter + def targets(self, targets): + """Sets the targets of this AuthnPolicy. + + + :param targets: The targets of this AuthnPolicy. # noqa: E501 + :type: AuthnPolicyTargets + """ + + self._targets = targets + + @property + def type(self): + """Gets the type of this AuthnPolicy. # noqa: E501 + + + :return: The type of this AuthnPolicy. # noqa: E501 + :rtype: AuthnPolicyType + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this AuthnPolicy. + + + :param type: The type of this AuthnPolicy. # noqa: E501 + :type: AuthnPolicyType + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AuthnPolicy, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AuthnPolicy): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/authn_policy_effect.py b/jcapiv2/jcapiv2/models/authn_policy_effect.py new file mode 100644 index 0000000..ff45196 --- /dev/null +++ b/jcapiv2/jcapiv2/models/authn_policy_effect.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AuthnPolicyEffect(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'action': 'str', + 'obligations': 'AuthnPolicyObligations' + } + + attribute_map = { + 'action': 'action', + 'obligations': 'obligations' + } + + def __init__(self, action=None, obligations=None): # noqa: E501 + """AuthnPolicyEffect - a model defined in Swagger""" # noqa: E501 + self._action = None + self._obligations = None + self.discriminator = None + self.action = action + if obligations is not None: + self.obligations = obligations + + @property + def action(self): + """Gets the action of this AuthnPolicyEffect. # noqa: E501 + + + :return: The action of this AuthnPolicyEffect. # noqa: E501 + :rtype: str + """ + return self._action + + @action.setter + def action(self, action): + """Sets the action of this AuthnPolicyEffect. + + + :param action: The action of this AuthnPolicyEffect. # noqa: E501 + :type: str + """ + if action is None: + raise ValueError("Invalid value for `action`, must not be `None`") # noqa: E501 + allowed_values = ["allow", "deny", "unknown"] # noqa: E501 + if action not in allowed_values: + raise ValueError( + "Invalid value for `action` ({0}), must be one of {1}" # noqa: E501 + .format(action, allowed_values) + ) + + self._action = action + + @property + def obligations(self): + """Gets the obligations of this AuthnPolicyEffect. # noqa: E501 + + + :return: The obligations of this AuthnPolicyEffect. # noqa: E501 + :rtype: AuthnPolicyObligations + """ + return self._obligations + + @obligations.setter + def obligations(self, obligations): + """Sets the obligations of this AuthnPolicyEffect. + + + :param obligations: The obligations of this AuthnPolicyEffect. # noqa: E501 + :type: AuthnPolicyObligations + """ + + self._obligations = obligations + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AuthnPolicyEffect, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AuthnPolicyEffect): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/authn_policy_input.py b/jcapiv2/jcapiv2/models/authn_policy_input.py new file mode 100644 index 0000000..066a152 --- /dev/null +++ b/jcapiv2/jcapiv2/models/authn_policy_input.py @@ -0,0 +1,266 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AuthnPolicyInput(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'conditions': 'object', + 'description': 'str', + 'disabled': 'bool', + 'effect': 'AuthnPolicyEffect', + 'name': 'str', + 'targets': 'AuthnPolicyTargets', + 'type': 'AuthnPolicyType' + } + + attribute_map = { + 'conditions': 'conditions', + 'description': 'description', + 'disabled': 'disabled', + 'effect': 'effect', + 'name': 'name', + 'targets': 'targets', + 'type': 'type' + } + + def __init__(self, conditions=None, description=None, disabled=None, effect=None, name=None, targets=None, type=None): # noqa: E501 + """AuthnPolicyInput - a model defined in Swagger""" # noqa: E501 + self._conditions = None + self._description = None + self._disabled = None + self._effect = None + self._name = None + self._targets = None + self._type = None + self.discriminator = None + if conditions is not None: + self.conditions = conditions + if description is not None: + self.description = description + if disabled is not None: + self.disabled = disabled + if effect is not None: + self.effect = effect + if name is not None: + self.name = name + if targets is not None: + self.targets = targets + if type is not None: + self.type = type + + @property + def conditions(self): + """Gets the conditions of this AuthnPolicyInput. # noqa: E501 + + + :return: The conditions of this AuthnPolicyInput. # noqa: E501 + :rtype: object + """ + return self._conditions + + @conditions.setter + def conditions(self, conditions): + """Sets the conditions of this AuthnPolicyInput. + + + :param conditions: The conditions of this AuthnPolicyInput. # noqa: E501 + :type: object + """ + + self._conditions = conditions + + @property + def description(self): + """Gets the description of this AuthnPolicyInput. # noqa: E501 + + + :return: The description of this AuthnPolicyInput. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this AuthnPolicyInput. + + + :param description: The description of this AuthnPolicyInput. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def disabled(self): + """Gets the disabled of this AuthnPolicyInput. # noqa: E501 + + + :return: The disabled of this AuthnPolicyInput. # noqa: E501 + :rtype: bool + """ + return self._disabled + + @disabled.setter + def disabled(self, disabled): + """Sets the disabled of this AuthnPolicyInput. + + + :param disabled: The disabled of this AuthnPolicyInput. # noqa: E501 + :type: bool + """ + + self._disabled = disabled + + @property + def effect(self): + """Gets the effect of this AuthnPolicyInput. # noqa: E501 + + + :return: The effect of this AuthnPolicyInput. # noqa: E501 + :rtype: AuthnPolicyEffect + """ + return self._effect + + @effect.setter + def effect(self, effect): + """Sets the effect of this AuthnPolicyInput. + + + :param effect: The effect of this AuthnPolicyInput. # noqa: E501 + :type: AuthnPolicyEffect + """ + + self._effect = effect + + @property + def name(self): + """Gets the name of this AuthnPolicyInput. # noqa: E501 + + + :return: The name of this AuthnPolicyInput. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AuthnPolicyInput. + + + :param name: The name of this AuthnPolicyInput. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def targets(self): + """Gets the targets of this AuthnPolicyInput. # noqa: E501 + + + :return: The targets of this AuthnPolicyInput. # noqa: E501 + :rtype: AuthnPolicyTargets + """ + return self._targets + + @targets.setter + def targets(self, targets): + """Sets the targets of this AuthnPolicyInput. + + + :param targets: The targets of this AuthnPolicyInput. # noqa: E501 + :type: AuthnPolicyTargets + """ + + self._targets = targets + + @property + def type(self): + """Gets the type of this AuthnPolicyInput. # noqa: E501 + + + :return: The type of this AuthnPolicyInput. # noqa: E501 + :rtype: AuthnPolicyType + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this AuthnPolicyInput. + + + :param type: The type of this AuthnPolicyInput. # noqa: E501 + :type: AuthnPolicyType + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AuthnPolicyInput, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AuthnPolicyInput): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/authn_policy_obligations.py b/jcapiv2/jcapiv2/models/authn_policy_obligations.py new file mode 100644 index 0000000..0d550d9 --- /dev/null +++ b/jcapiv2/jcapiv2/models/authn_policy_obligations.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AuthnPolicyObligations(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'mfa': 'AuthnPolicyObligationsMfa', + 'user_verification': 'AuthnPolicyObligationsUserVerification' + } + + attribute_map = { + 'mfa': 'mfa', + 'user_verification': 'userVerification' + } + + def __init__(self, mfa=None, user_verification=None): # noqa: E501 + """AuthnPolicyObligations - a model defined in Swagger""" # noqa: E501 + self._mfa = None + self._user_verification = None + self.discriminator = None + if mfa is not None: + self.mfa = mfa + if user_verification is not None: + self.user_verification = user_verification + + @property + def mfa(self): + """Gets the mfa of this AuthnPolicyObligations. # noqa: E501 + + + :return: The mfa of this AuthnPolicyObligations. # noqa: E501 + :rtype: AuthnPolicyObligationsMfa + """ + return self._mfa + + @mfa.setter + def mfa(self, mfa): + """Sets the mfa of this AuthnPolicyObligations. + + + :param mfa: The mfa of this AuthnPolicyObligations. # noqa: E501 + :type: AuthnPolicyObligationsMfa + """ + + self._mfa = mfa + + @property + def user_verification(self): + """Gets the user_verification of this AuthnPolicyObligations. # noqa: E501 + + + :return: The user_verification of this AuthnPolicyObligations. # noqa: E501 + :rtype: AuthnPolicyObligationsUserVerification + """ + return self._user_verification + + @user_verification.setter + def user_verification(self, user_verification): + """Sets the user_verification of this AuthnPolicyObligations. + + + :param user_verification: The user_verification of this AuthnPolicyObligations. # noqa: E501 + :type: AuthnPolicyObligationsUserVerification + """ + + self._user_verification = user_verification + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AuthnPolicyObligations, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AuthnPolicyObligations): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/authn_policy_obligations_mfa.py b/jcapiv2/jcapiv2/models/authn_policy_obligations_mfa.py new file mode 100644 index 0000000..32660ff --- /dev/null +++ b/jcapiv2/jcapiv2/models/authn_policy_obligations_mfa.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AuthnPolicyObligationsMfa(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'required': 'bool' + } + + attribute_map = { + 'required': 'required' + } + + def __init__(self, required=None): # noqa: E501 + """AuthnPolicyObligationsMfa - a model defined in Swagger""" # noqa: E501 + self._required = None + self.discriminator = None + if required is not None: + self.required = required + + @property + def required(self): + """Gets the required of this AuthnPolicyObligationsMfa. # noqa: E501 + + + :return: The required of this AuthnPolicyObligationsMfa. # noqa: E501 + :rtype: bool + """ + return self._required + + @required.setter + def required(self, required): + """Sets the required of this AuthnPolicyObligationsMfa. + + + :param required: The required of this AuthnPolicyObligationsMfa. # noqa: E501 + :type: bool + """ + + self._required = required + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AuthnPolicyObligationsMfa, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AuthnPolicyObligationsMfa): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/authn_policy_obligations_user_verification.py b/jcapiv2/jcapiv2/models/authn_policy_obligations_user_verification.py new file mode 100644 index 0000000..378f130 --- /dev/null +++ b/jcapiv2/jcapiv2/models/authn_policy_obligations_user_verification.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AuthnPolicyObligationsUserVerification(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'requirement': 'str' + } + + attribute_map = { + 'requirement': 'requirement' + } + + def __init__(self, requirement=None): # noqa: E501 + """AuthnPolicyObligationsUserVerification - a model defined in Swagger""" # noqa: E501 + self._requirement = None + self.discriminator = None + if requirement is not None: + self.requirement = requirement + + @property + def requirement(self): + """Gets the requirement of this AuthnPolicyObligationsUserVerification. # noqa: E501 + + + :return: The requirement of this AuthnPolicyObligationsUserVerification. # noqa: E501 + :rtype: str + """ + return self._requirement + + @requirement.setter + def requirement(self, requirement): + """Sets the requirement of this AuthnPolicyObligationsUserVerification. + + + :param requirement: The requirement of this AuthnPolicyObligationsUserVerification. # noqa: E501 + :type: str + """ + allowed_values = ["none", "optional", "required"] # noqa: E501 + if requirement not in allowed_values: + raise ValueError( + "Invalid value for `requirement` ({0}), must be one of {1}" # noqa: E501 + .format(requirement, allowed_values) + ) + + self._requirement = requirement + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AuthnPolicyObligationsUserVerification, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AuthnPolicyObligationsUserVerification): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/authn_policy_resource_target.py b/jcapiv2/jcapiv2/models/authn_policy_resource_target.py new file mode 100644 index 0000000..9a2456e --- /dev/null +++ b/jcapiv2/jcapiv2/models/authn_policy_resource_target.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AuthnPolicyResourceTarget(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'type': 'str' + } + + attribute_map = { + 'id': 'id', + 'type': 'type' + } + + def __init__(self, id=None, type=None): # noqa: E501 + """AuthnPolicyResourceTarget - a model defined in Swagger""" # noqa: E501 + self._id = None + self._type = None + self.discriminator = None + if id is not None: + self.id = id + self.type = type + + @property + def id(self): + """Gets the id of this AuthnPolicyResourceTarget. # noqa: E501 + + Object ID of the resource target. If undefined, then all resources of the given type are targeted. # noqa: E501 + + :return: The id of this AuthnPolicyResourceTarget. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AuthnPolicyResourceTarget. + + Object ID of the resource target. If undefined, then all resources of the given type are targeted. # noqa: E501 + + :param id: The id of this AuthnPolicyResourceTarget. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def type(self): + """Gets the type of this AuthnPolicyResourceTarget. # noqa: E501 + + + :return: The type of this AuthnPolicyResourceTarget. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this AuthnPolicyResourceTarget. + + + :param type: The type of this AuthnPolicyResourceTarget. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["user_portal", "application", "ldap"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AuthnPolicyResourceTarget, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AuthnPolicyResourceTarget): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/authn_policy_targets.py b/jcapiv2/jcapiv2/models/authn_policy_targets.py new file mode 100644 index 0000000..df96920 --- /dev/null +++ b/jcapiv2/jcapiv2/models/authn_policy_targets.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AuthnPolicyTargets(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'resources': 'list[AuthnPolicyResourceTarget]', + 'user_attributes': 'AuthnPolicyUserAttributeTarget', + 'user_groups': 'AuthnPolicyUserGroupTarget', + 'users': 'AuthnPolicyUserTarget' + } + + attribute_map = { + 'resources': 'resources', + 'user_attributes': 'userAttributes', + 'user_groups': 'userGroups', + 'users': 'users' + } + + def __init__(self, resources=None, user_attributes=None, user_groups=None, users=None): # noqa: E501 + """AuthnPolicyTargets - a model defined in Swagger""" # noqa: E501 + self._resources = None + self._user_attributes = None + self._user_groups = None + self._users = None + self.discriminator = None + if resources is not None: + self.resources = resources + if user_attributes is not None: + self.user_attributes = user_attributes + if user_groups is not None: + self.user_groups = user_groups + if users is not None: + self.users = users + + @property + def resources(self): + """Gets the resources of this AuthnPolicyTargets. # noqa: E501 + + + :return: The resources of this AuthnPolicyTargets. # noqa: E501 + :rtype: list[AuthnPolicyResourceTarget] + """ + return self._resources + + @resources.setter + def resources(self, resources): + """Sets the resources of this AuthnPolicyTargets. + + + :param resources: The resources of this AuthnPolicyTargets. # noqa: E501 + :type: list[AuthnPolicyResourceTarget] + """ + + self._resources = resources + + @property + def user_attributes(self): + """Gets the user_attributes of this AuthnPolicyTargets. # noqa: E501 + + + :return: The user_attributes of this AuthnPolicyTargets. # noqa: E501 + :rtype: AuthnPolicyUserAttributeTarget + """ + return self._user_attributes + + @user_attributes.setter + def user_attributes(self, user_attributes): + """Sets the user_attributes of this AuthnPolicyTargets. + + + :param user_attributes: The user_attributes of this AuthnPolicyTargets. # noqa: E501 + :type: AuthnPolicyUserAttributeTarget + """ + + self._user_attributes = user_attributes + + @property + def user_groups(self): + """Gets the user_groups of this AuthnPolicyTargets. # noqa: E501 + + + :return: The user_groups of this AuthnPolicyTargets. # noqa: E501 + :rtype: AuthnPolicyUserGroupTarget + """ + return self._user_groups + + @user_groups.setter + def user_groups(self, user_groups): + """Sets the user_groups of this AuthnPolicyTargets. + + + :param user_groups: The user_groups of this AuthnPolicyTargets. # noqa: E501 + :type: AuthnPolicyUserGroupTarget + """ + + self._user_groups = user_groups + + @property + def users(self): + """Gets the users of this AuthnPolicyTargets. # noqa: E501 + + + :return: The users of this AuthnPolicyTargets. # noqa: E501 + :rtype: AuthnPolicyUserTarget + """ + return self._users + + @users.setter + def users(self, users): + """Sets the users of this AuthnPolicyTargets. + + + :param users: The users of this AuthnPolicyTargets. # noqa: E501 + :type: AuthnPolicyUserTarget + """ + + self._users = users + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AuthnPolicyTargets, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AuthnPolicyTargets): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/authn_policy_type.py b/jcapiv2/jcapiv2/models/authn_policy_type.py new file mode 100644 index 0000000..feaf414 --- /dev/null +++ b/jcapiv2/jcapiv2/models/authn_policy_type.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AuthnPolicyType(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + USER_PORTAL = "user_portal" + APPLICATION = "application" + LDAP = "ldap" + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """AuthnPolicyType - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AuthnPolicyType, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AuthnPolicyType): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/authn_policy_user_attribute_filter.py b/jcapiv2/jcapiv2/models/authn_policy_user_attribute_filter.py new file mode 100644 index 0000000..8161c7b --- /dev/null +++ b/jcapiv2/jcapiv2/models/authn_policy_user_attribute_filter.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AuthnPolicyUserAttributeFilter(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'field': 'str', + 'operator': 'str', + 'value': 'AnyValue' + } + + attribute_map = { + 'field': 'field', + 'operator': 'operator', + 'value': 'value' + } + + def __init__(self, field=None, operator=None, value=None): # noqa: E501 + """AuthnPolicyUserAttributeFilter - a model defined in Swagger""" # noqa: E501 + self._field = None + self._operator = None + self._value = None + self.discriminator = None + if field is not None: + self.field = field + if operator is not None: + self.operator = operator + if value is not None: + self.value = value + + @property + def field(self): + """Gets the field of this AuthnPolicyUserAttributeFilter. # noqa: E501 + + The only field that is currently supported is ldap_binding_user # noqa: E501 + + :return: The field of this AuthnPolicyUserAttributeFilter. # noqa: E501 + :rtype: str + """ + return self._field + + @field.setter + def field(self, field): + """Sets the field of this AuthnPolicyUserAttributeFilter. + + The only field that is currently supported is ldap_binding_user # noqa: E501 + + :param field: The field of this AuthnPolicyUserAttributeFilter. # noqa: E501 + :type: str + """ + + self._field = field + + @property + def operator(self): + """Gets the operator of this AuthnPolicyUserAttributeFilter. # noqa: E501 + + + :return: The operator of this AuthnPolicyUserAttributeFilter. # noqa: E501 + :rtype: str + """ + return self._operator + + @operator.setter + def operator(self, operator): + """Sets the operator of this AuthnPolicyUserAttributeFilter. + + + :param operator: The operator of this AuthnPolicyUserAttributeFilter. # noqa: E501 + :type: str + """ + allowed_values = ["EQ"] # noqa: E501 + if operator not in allowed_values: + raise ValueError( + "Invalid value for `operator` ({0}), must be one of {1}" # noqa: E501 + .format(operator, allowed_values) + ) + + self._operator = operator + + @property + def value(self): + """Gets the value of this AuthnPolicyUserAttributeFilter. # noqa: E501 + + + :return: The value of this AuthnPolicyUserAttributeFilter. # noqa: E501 + :rtype: AnyValue + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this AuthnPolicyUserAttributeFilter. + + + :param value: The value of this AuthnPolicyUserAttributeFilter. # noqa: E501 + :type: AnyValue + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AuthnPolicyUserAttributeFilter, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AuthnPolicyUserAttributeFilter): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/authn_policy_user_attribute_target.py b/jcapiv2/jcapiv2/models/authn_policy_user_attribute_target.py new file mode 100644 index 0000000..fc911a8 --- /dev/null +++ b/jcapiv2/jcapiv2/models/authn_policy_user_attribute_target.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AuthnPolicyUserAttributeTarget(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'exclusions': 'list[AuthnPolicyUserAttributeFilter]', + 'inclusions': 'list[AuthnPolicyUserAttributeFilter]' + } + + attribute_map = { + 'exclusions': 'exclusions', + 'inclusions': 'inclusions' + } + + def __init__(self, exclusions=None, inclusions=None): # noqa: E501 + """AuthnPolicyUserAttributeTarget - a model defined in Swagger""" # noqa: E501 + self._exclusions = None + self._inclusions = None + self.discriminator = None + if exclusions is not None: + self.exclusions = exclusions + if inclusions is not None: + self.inclusions = inclusions + + @property + def exclusions(self): + """Gets the exclusions of this AuthnPolicyUserAttributeTarget. # noqa: E501 + + + :return: The exclusions of this AuthnPolicyUserAttributeTarget. # noqa: E501 + :rtype: list[AuthnPolicyUserAttributeFilter] + """ + return self._exclusions + + @exclusions.setter + def exclusions(self, exclusions): + """Sets the exclusions of this AuthnPolicyUserAttributeTarget. + + + :param exclusions: The exclusions of this AuthnPolicyUserAttributeTarget. # noqa: E501 + :type: list[AuthnPolicyUserAttributeFilter] + """ + + self._exclusions = exclusions + + @property + def inclusions(self): + """Gets the inclusions of this AuthnPolicyUserAttributeTarget. # noqa: E501 + + + :return: The inclusions of this AuthnPolicyUserAttributeTarget. # noqa: E501 + :rtype: list[AuthnPolicyUserAttributeFilter] + """ + return self._inclusions + + @inclusions.setter + def inclusions(self, inclusions): + """Sets the inclusions of this AuthnPolicyUserAttributeTarget. + + + :param inclusions: The inclusions of this AuthnPolicyUserAttributeTarget. # noqa: E501 + :type: list[AuthnPolicyUserAttributeFilter] + """ + + self._inclusions = inclusions + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AuthnPolicyUserAttributeTarget, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AuthnPolicyUserAttributeTarget): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/authn_policy_user_group_target.py b/jcapiv2/jcapiv2/models/authn_policy_user_group_target.py new file mode 100644 index 0000000..6556ca9 --- /dev/null +++ b/jcapiv2/jcapiv2/models/authn_policy_user_group_target.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AuthnPolicyUserGroupTarget(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'exclusions': 'list[str]', + 'inclusions': 'list[str]' + } + + attribute_map = { + 'exclusions': 'exclusions', + 'inclusions': 'inclusions' + } + + def __init__(self, exclusions=None, inclusions=None): # noqa: E501 + """AuthnPolicyUserGroupTarget - a model defined in Swagger""" # noqa: E501 + self._exclusions = None + self._inclusions = None + self.discriminator = None + if exclusions is not None: + self.exclusions = exclusions + if inclusions is not None: + self.inclusions = inclusions + + @property + def exclusions(self): + """Gets the exclusions of this AuthnPolicyUserGroupTarget. # noqa: E501 + + + :return: The exclusions of this AuthnPolicyUserGroupTarget. # noqa: E501 + :rtype: list[str] + """ + return self._exclusions + + @exclusions.setter + def exclusions(self, exclusions): + """Sets the exclusions of this AuthnPolicyUserGroupTarget. + + + :param exclusions: The exclusions of this AuthnPolicyUserGroupTarget. # noqa: E501 + :type: list[str] + """ + + self._exclusions = exclusions + + @property + def inclusions(self): + """Gets the inclusions of this AuthnPolicyUserGroupTarget. # noqa: E501 + + + :return: The inclusions of this AuthnPolicyUserGroupTarget. # noqa: E501 + :rtype: list[str] + """ + return self._inclusions + + @inclusions.setter + def inclusions(self, inclusions): + """Sets the inclusions of this AuthnPolicyUserGroupTarget. + + + :param inclusions: The inclusions of this AuthnPolicyUserGroupTarget. # noqa: E501 + :type: list[str] + """ + + self._inclusions = inclusions + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AuthnPolicyUserGroupTarget, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AuthnPolicyUserGroupTarget): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/authn_policy_user_target.py b/jcapiv2/jcapiv2/models/authn_policy_user_target.py new file mode 100644 index 0000000..56539a6 --- /dev/null +++ b/jcapiv2/jcapiv2/models/authn_policy_user_target.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AuthnPolicyUserTarget(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'inclusions': 'list[str]' + } + + attribute_map = { + 'inclusions': 'inclusions' + } + + def __init__(self, inclusions=None): # noqa: E501 + """AuthnPolicyUserTarget - a model defined in Swagger""" # noqa: E501 + self._inclusions = None + self.discriminator = None + if inclusions is not None: + self.inclusions = inclusions + + @property + def inclusions(self): + """Gets the inclusions of this AuthnPolicyUserTarget. # noqa: E501 + + + :return: The inclusions of this AuthnPolicyUserTarget. # noqa: E501 + :rtype: list[str] + """ + return self._inclusions + + @inclusions.setter + def inclusions(self, inclusions): + """Sets the inclusions of this AuthnPolicyUserTarget. + + + :param inclusions: The inclusions of this AuthnPolicyUserTarget. # noqa: E501 + :type: list[str] + """ + + self._inclusions = inclusions + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AuthnPolicyUserTarget, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AuthnPolicyUserTarget): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_company.py b/jcapiv2/jcapiv2/models/autotask_company.py new file mode 100644 index 0000000..7fbd590 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_company.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskCompany(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """AutotaskCompany - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + self.id = id + self.name = name + + @property + def id(self): + """Gets the id of this AutotaskCompany. # noqa: E501 + + The autotask company identifier. # noqa: E501 + + :return: The id of this AutotaskCompany. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AutotaskCompany. + + The autotask company identifier. # noqa: E501 + + :param id: The id of this AutotaskCompany. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this AutotaskCompany. # noqa: E501 + + The autotask company name. # noqa: E501 + + :return: The name of this AutotaskCompany. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AutotaskCompany. + + The autotask company name. # noqa: E501 + + :param name: The name of this AutotaskCompany. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskCompany, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskCompany): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_company_resp.py b/jcapiv2/jcapiv2/models/autotask_company_resp.py new file mode 100644 index 0000000..88ba8b0 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_company_resp.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskCompanyResp(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'records': 'list[AutotaskCompany]', + 'total_count': 'int' + } + + attribute_map = { + 'records': 'records', + 'total_count': 'totalCount' + } + + def __init__(self, records=None, total_count=None): # noqa: E501 + """AutotaskCompanyResp - a model defined in Swagger""" # noqa: E501 + self._records = None + self._total_count = None + self.discriminator = None + self.records = records + self.total_count = total_count + + @property + def records(self): + """Gets the records of this AutotaskCompanyResp. # noqa: E501 + + + :return: The records of this AutotaskCompanyResp. # noqa: E501 + :rtype: list[AutotaskCompany] + """ + return self._records + + @records.setter + def records(self, records): + """Sets the records of this AutotaskCompanyResp. + + + :param records: The records of this AutotaskCompanyResp. # noqa: E501 + :type: list[AutotaskCompany] + """ + if records is None: + raise ValueError("Invalid value for `records`, must not be `None`") # noqa: E501 + + self._records = records + + @property + def total_count(self): + """Gets the total_count of this AutotaskCompanyResp. # noqa: E501 + + + :return: The total_count of this AutotaskCompanyResp. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this AutotaskCompanyResp. + + + :param total_count: The total_count of this AutotaskCompanyResp. # noqa: E501 + :type: int + """ + if total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskCompanyResp, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskCompanyResp): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_company_type_resp.py b/jcapiv2/jcapiv2/models/autotask_company_type_resp.py new file mode 100644 index 0000000..6e6f015 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_company_type_resp.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskCompanyTypeResp(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'records': 'list[BillingIntegrationCompanyType]', + 'total_count': 'int' + } + + attribute_map = { + 'records': 'records', + 'total_count': 'totalCount' + } + + def __init__(self, records=None, total_count=None): # noqa: E501 + """AutotaskCompanyTypeResp - a model defined in Swagger""" # noqa: E501 + self._records = None + self._total_count = None + self.discriminator = None + self.records = records + self.total_count = total_count + + @property + def records(self): + """Gets the records of this AutotaskCompanyTypeResp. # noqa: E501 + + + :return: The records of this AutotaskCompanyTypeResp. # noqa: E501 + :rtype: list[BillingIntegrationCompanyType] + """ + return self._records + + @records.setter + def records(self, records): + """Sets the records of this AutotaskCompanyTypeResp. + + + :param records: The records of this AutotaskCompanyTypeResp. # noqa: E501 + :type: list[BillingIntegrationCompanyType] + """ + if records is None: + raise ValueError("Invalid value for `records`, must not be `None`") # noqa: E501 + + self._records = records + + @property + def total_count(self): + """Gets the total_count of this AutotaskCompanyTypeResp. # noqa: E501 + + + :return: The total_count of this AutotaskCompanyTypeResp. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this AutotaskCompanyTypeResp. + + + :param total_count: The total_count of this AutotaskCompanyTypeResp. # noqa: E501 + :type: int + """ + if total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskCompanyTypeResp, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskCompanyTypeResp): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_contract.py b/jcapiv2/jcapiv2/models/autotask_contract.py new file mode 100644 index 0000000..1f16a55 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_contract.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskContract(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'company_id': 'str', + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'company_id': 'companyId', + 'id': 'id', + 'name': 'name' + } + + def __init__(self, company_id=None, id=None, name=None): # noqa: E501 + """AutotaskContract - a model defined in Swagger""" # noqa: E501 + self._company_id = None + self._id = None + self._name = None + self.discriminator = None + self.company_id = company_id + self.id = id + self.name = name + + @property + def company_id(self): + """Gets the company_id of this AutotaskContract. # noqa: E501 + + The Autotask company identifier linked to contract. # noqa: E501 + + :return: The company_id of this AutotaskContract. # noqa: E501 + :rtype: str + """ + return self._company_id + + @company_id.setter + def company_id(self, company_id): + """Sets the company_id of this AutotaskContract. + + The Autotask company identifier linked to contract. # noqa: E501 + + :param company_id: The company_id of this AutotaskContract. # noqa: E501 + :type: str + """ + if company_id is None: + raise ValueError("Invalid value for `company_id`, must not be `None`") # noqa: E501 + + self._company_id = company_id + + @property + def id(self): + """Gets the id of this AutotaskContract. # noqa: E501 + + The contract identifier. # noqa: E501 + + :return: The id of this AutotaskContract. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AutotaskContract. + + The contract identifier. # noqa: E501 + + :param id: The id of this AutotaskContract. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this AutotaskContract. # noqa: E501 + + The contract name. # noqa: E501 + + :return: The name of this AutotaskContract. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AutotaskContract. + + The contract name. # noqa: E501 + + :param name: The name of this AutotaskContract. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskContract, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskContract): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_contract_field.py b/jcapiv2/jcapiv2/models/autotask_contract_field.py new file mode 100644 index 0000000..1be380f --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_contract_field.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskContractField(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'values': 'list[AutotaskContractFieldValues]' + } + + attribute_map = { + 'name': 'name', + 'values': 'values' + } + + def __init__(self, name=None, values=None): # noqa: E501 + """AutotaskContractField - a model defined in Swagger""" # noqa: E501 + self._name = None + self._values = None + self.discriminator = None + self.name = name + self.values = values + + @property + def name(self): + """Gets the name of this AutotaskContractField. # noqa: E501 + + The contract field name. # noqa: E501 + + :return: The name of this AutotaskContractField. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AutotaskContractField. + + The contract field name. # noqa: E501 + + :param name: The name of this AutotaskContractField. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def values(self): + """Gets the values of this AutotaskContractField. # noqa: E501 + + + :return: The values of this AutotaskContractField. # noqa: E501 + :rtype: list[AutotaskContractFieldValues] + """ + return self._values + + @values.setter + def values(self, values): + """Sets the values of this AutotaskContractField. + + + :param values: The values of this AutotaskContractField. # noqa: E501 + :type: list[AutotaskContractFieldValues] + """ + if values is None: + raise ValueError("Invalid value for `values`, must not be `None`") # noqa: E501 + + self._values = values + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskContractField, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskContractField): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_contract_field_values.py b/jcapiv2/jcapiv2/models/autotask_contract_field_values.py new file mode 100644 index 0000000..fa38963 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_contract_field_values.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskContractFieldValues(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'label': 'str', + 'value': 'str' + } + + attribute_map = { + 'label': 'label', + 'value': 'value' + } + + def __init__(self, label=None, value=None): # noqa: E501 + """AutotaskContractFieldValues - a model defined in Swagger""" # noqa: E501 + self._label = None + self._value = None + self.discriminator = None + if label is not None: + self.label = label + if value is not None: + self.value = value + + @property + def label(self): + """Gets the label of this AutotaskContractFieldValues. # noqa: E501 + + + :return: The label of this AutotaskContractFieldValues. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this AutotaskContractFieldValues. + + + :param label: The label of this AutotaskContractFieldValues. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def value(self): + """Gets the value of this AutotaskContractFieldValues. # noqa: E501 + + + :return: The value of this AutotaskContractFieldValues. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this AutotaskContractFieldValues. + + + :param value: The value of this AutotaskContractFieldValues. # noqa: E501 + :type: str + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskContractFieldValues, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskContractFieldValues): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_integration.py b/jcapiv2/jcapiv2/models/autotask_integration.py new file mode 100644 index 0000000..69a0fa2 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_integration.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskIntegration(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'is_msp_auth_configured': 'bool', + 'username': 'str' + } + + attribute_map = { + 'id': 'id', + 'is_msp_auth_configured': 'isMspAuthConfigured', + 'username': 'username' + } + + def __init__(self, id=None, is_msp_auth_configured=None, username=None): # noqa: E501 + """AutotaskIntegration - a model defined in Swagger""" # noqa: E501 + self._id = None + self._is_msp_auth_configured = None + self._username = None + self.discriminator = None + self.id = id + if is_msp_auth_configured is not None: + self.is_msp_auth_configured = is_msp_auth_configured + self.username = username + + @property + def id(self): + """Gets the id of this AutotaskIntegration. # noqa: E501 + + The identifier for this Autotask integration. # noqa: E501 + + :return: The id of this AutotaskIntegration. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AutotaskIntegration. + + The identifier for this Autotask integration. # noqa: E501 + + :param id: The id of this AutotaskIntegration. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def is_msp_auth_configured(self): + """Gets the is_msp_auth_configured of this AutotaskIntegration. # noqa: E501 + + Has the msp-api been configured with auth data yet # noqa: E501 + + :return: The is_msp_auth_configured of this AutotaskIntegration. # noqa: E501 + :rtype: bool + """ + return self._is_msp_auth_configured + + @is_msp_auth_configured.setter + def is_msp_auth_configured(self, is_msp_auth_configured): + """Sets the is_msp_auth_configured of this AutotaskIntegration. + + Has the msp-api been configured with auth data yet # noqa: E501 + + :param is_msp_auth_configured: The is_msp_auth_configured of this AutotaskIntegration. # noqa: E501 + :type: bool + """ + + self._is_msp_auth_configured = is_msp_auth_configured + + @property + def username(self): + """Gets the username of this AutotaskIntegration. # noqa: E501 + + The username for connecting to Autotask. # noqa: E501 + + :return: The username of this AutotaskIntegration. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this AutotaskIntegration. + + The username for connecting to Autotask. # noqa: E501 + + :param username: The username of this AutotaskIntegration. # noqa: E501 + :type: str + """ + if username is None: + raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 + + self._username = username + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskIntegration, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskIntegration): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_integration_patch_req.py b/jcapiv2/jcapiv2/models/autotask_integration_patch_req.py new file mode 100644 index 0000000..1da826a --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_integration_patch_req.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskIntegrationPatchReq(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'secret': 'str', + 'username': 'str' + } + + attribute_map = { + 'secret': 'secret', + 'username': 'username' + } + + def __init__(self, secret=None, username=None): # noqa: E501 + """AutotaskIntegrationPatchReq - a model defined in Swagger""" # noqa: E501 + self._secret = None + self._username = None + self.discriminator = None + if secret is not None: + self.secret = secret + if username is not None: + self.username = username + + @property + def secret(self): + """Gets the secret of this AutotaskIntegrationPatchReq. # noqa: E501 + + The secret for connecting to Autotask. # noqa: E501 + + :return: The secret of this AutotaskIntegrationPatchReq. # noqa: E501 + :rtype: str + """ + return self._secret + + @secret.setter + def secret(self, secret): + """Sets the secret of this AutotaskIntegrationPatchReq. + + The secret for connecting to Autotask. # noqa: E501 + + :param secret: The secret of this AutotaskIntegrationPatchReq. # noqa: E501 + :type: str + """ + + self._secret = secret + + @property + def username(self): + """Gets the username of this AutotaskIntegrationPatchReq. # noqa: E501 + + The username for connecting to Autotask. # noqa: E501 + + :return: The username of this AutotaskIntegrationPatchReq. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this AutotaskIntegrationPatchReq. + + The username for connecting to Autotask. # noqa: E501 + + :param username: The username of this AutotaskIntegrationPatchReq. # noqa: E501 + :type: str + """ + + self._username = username + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskIntegrationPatchReq, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskIntegrationPatchReq): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_integration_req.py b/jcapiv2/jcapiv2/models/autotask_integration_req.py new file mode 100644 index 0000000..fd15261 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_integration_req.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskIntegrationReq(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'secret': 'str', + 'username': 'str' + } + + attribute_map = { + 'secret': 'secret', + 'username': 'username' + } + + def __init__(self, secret=None, username=None): # noqa: E501 + """AutotaskIntegrationReq - a model defined in Swagger""" # noqa: E501 + self._secret = None + self._username = None + self.discriminator = None + self.secret = secret + self.username = username + + @property + def secret(self): + """Gets the secret of this AutotaskIntegrationReq. # noqa: E501 + + The secret for connecting to Autotask. # noqa: E501 + + :return: The secret of this AutotaskIntegrationReq. # noqa: E501 + :rtype: str + """ + return self._secret + + @secret.setter + def secret(self, secret): + """Sets the secret of this AutotaskIntegrationReq. + + The secret for connecting to Autotask. # noqa: E501 + + :param secret: The secret of this AutotaskIntegrationReq. # noqa: E501 + :type: str + """ + if secret is None: + raise ValueError("Invalid value for `secret`, must not be `None`") # noqa: E501 + + self._secret = secret + + @property + def username(self): + """Gets the username of this AutotaskIntegrationReq. # noqa: E501 + + The username for connecting to Autotask. # noqa: E501 + + :return: The username of this AutotaskIntegrationReq. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this AutotaskIntegrationReq. + + The username for connecting to Autotask. # noqa: E501 + + :param username: The username of this AutotaskIntegrationReq. # noqa: E501 + :type: str + """ + if username is None: + raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 + + self._username = username + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskIntegrationReq, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskIntegrationReq): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_mapping_request.py b/jcapiv2/jcapiv2/models/autotask_mapping_request.py new file mode 100644 index 0000000..ff30af7 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_mapping_request.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskMappingRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data': 'list[AutotaskMappingRequestData]' + } + + attribute_map = { + 'data': 'data' + } + + def __init__(self, data=None): # noqa: E501 + """AutotaskMappingRequest - a model defined in Swagger""" # noqa: E501 + self._data = None + self.discriminator = None + if data is not None: + self.data = data + + @property + def data(self): + """Gets the data of this AutotaskMappingRequest. # noqa: E501 + + + :return: The data of this AutotaskMappingRequest. # noqa: E501 + :rtype: list[AutotaskMappingRequestData] + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this AutotaskMappingRequest. + + + :param data: The data of this AutotaskMappingRequest. # noqa: E501 + :type: list[AutotaskMappingRequestData] + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskMappingRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskMappingRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_mapping_request_company.py b/jcapiv2/jcapiv2/models/autotask_mapping_request_company.py new file mode 100644 index 0000000..ac073a8 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_mapping_request_company.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskMappingRequestCompany(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """AutotaskMappingRequestCompany - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + self.id = id + self.name = name + + @property + def id(self): + """Gets the id of this AutotaskMappingRequestCompany. # noqa: E501 + + + :return: The id of this AutotaskMappingRequestCompany. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AutotaskMappingRequestCompany. + + + :param id: The id of this AutotaskMappingRequestCompany. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this AutotaskMappingRequestCompany. # noqa: E501 + + + :return: The name of this AutotaskMappingRequestCompany. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AutotaskMappingRequestCompany. + + + :param name: The name of this AutotaskMappingRequestCompany. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskMappingRequestCompany, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskMappingRequestCompany): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_mapping_request_contract.py b/jcapiv2/jcapiv2/models/autotask_mapping_request_contract.py new file mode 100644 index 0000000..4a92c82 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_mapping_request_contract.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskMappingRequestContract(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """AutotaskMappingRequestContract - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskMappingRequestContract, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskMappingRequestContract): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_mapping_request_data.py b/jcapiv2/jcapiv2/models/autotask_mapping_request_data.py new file mode 100644 index 0000000..4c5c661 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_mapping_request_data.py @@ -0,0 +1,218 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskMappingRequestData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'company': 'AutotaskMappingRequestCompany', + 'contract': 'AutotaskMappingRequestContract', + 'delete': 'bool', + 'organization': 'AutotaskMappingRequestOrganization', + 'service': 'AutotaskMappingRequestService' + } + + attribute_map = { + 'company': 'company', + 'contract': 'contract', + 'delete': 'delete', + 'organization': 'organization', + 'service': 'service' + } + + def __init__(self, company=None, contract=None, delete=None, organization=None, service=None): # noqa: E501 + """AutotaskMappingRequestData - a model defined in Swagger""" # noqa: E501 + self._company = None + self._contract = None + self._delete = None + self._organization = None + self._service = None + self.discriminator = None + self.company = company + self.contract = contract + if delete is not None: + self.delete = delete + self.organization = organization + self.service = service + + @property + def company(self): + """Gets the company of this AutotaskMappingRequestData. # noqa: E501 + + + :return: The company of this AutotaskMappingRequestData. # noqa: E501 + :rtype: AutotaskMappingRequestCompany + """ + return self._company + + @company.setter + def company(self, company): + """Sets the company of this AutotaskMappingRequestData. + + + :param company: The company of this AutotaskMappingRequestData. # noqa: E501 + :type: AutotaskMappingRequestCompany + """ + if company is None: + raise ValueError("Invalid value for `company`, must not be `None`") # noqa: E501 + + self._company = company + + @property + def contract(self): + """Gets the contract of this AutotaskMappingRequestData. # noqa: E501 + + + :return: The contract of this AutotaskMappingRequestData. # noqa: E501 + :rtype: AutotaskMappingRequestContract + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this AutotaskMappingRequestData. + + + :param contract: The contract of this AutotaskMappingRequestData. # noqa: E501 + :type: AutotaskMappingRequestContract + """ + if contract is None: + raise ValueError("Invalid value for `contract`, must not be `None`") # noqa: E501 + + self._contract = contract + + @property + def delete(self): + """Gets the delete of this AutotaskMappingRequestData. # noqa: E501 + + + :return: The delete of this AutotaskMappingRequestData. # noqa: E501 + :rtype: bool + """ + return self._delete + + @delete.setter + def delete(self, delete): + """Sets the delete of this AutotaskMappingRequestData. + + + :param delete: The delete of this AutotaskMappingRequestData. # noqa: E501 + :type: bool + """ + + self._delete = delete + + @property + def organization(self): + """Gets the organization of this AutotaskMappingRequestData. # noqa: E501 + + + :return: The organization of this AutotaskMappingRequestData. # noqa: E501 + :rtype: AutotaskMappingRequestOrganization + """ + return self._organization + + @organization.setter + def organization(self, organization): + """Sets the organization of this AutotaskMappingRequestData. + + + :param organization: The organization of this AutotaskMappingRequestData. # noqa: E501 + :type: AutotaskMappingRequestOrganization + """ + if organization is None: + raise ValueError("Invalid value for `organization`, must not be `None`") # noqa: E501 + + self._organization = organization + + @property + def service(self): + """Gets the service of this AutotaskMappingRequestData. # noqa: E501 + + + :return: The service of this AutotaskMappingRequestData. # noqa: E501 + :rtype: AutotaskMappingRequestService + """ + return self._service + + @service.setter + def service(self, service): + """Sets the service of this AutotaskMappingRequestData. + + + :param service: The service of this AutotaskMappingRequestData. # noqa: E501 + :type: AutotaskMappingRequestService + """ + if service is None: + raise ValueError("Invalid value for `service`, must not be `None`") # noqa: E501 + + self._service = service + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskMappingRequestData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskMappingRequestData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_mapping_request_organization.py b/jcapiv2/jcapiv2/models/autotask_mapping_request_organization.py new file mode 100644 index 0000000..0da3f6a --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_mapping_request_organization.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskMappingRequestOrganization(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """AutotaskMappingRequestOrganization - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + self.id = id + self.name = name + + @property + def id(self): + """Gets the id of this AutotaskMappingRequestOrganization. # noqa: E501 + + + :return: The id of this AutotaskMappingRequestOrganization. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AutotaskMappingRequestOrganization. + + + :param id: The id of this AutotaskMappingRequestOrganization. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this AutotaskMappingRequestOrganization. # noqa: E501 + + + :return: The name of this AutotaskMappingRequestOrganization. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AutotaskMappingRequestOrganization. + + + :param name: The name of this AutotaskMappingRequestOrganization. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskMappingRequestOrganization, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskMappingRequestOrganization): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_mapping_request_service.py b/jcapiv2/jcapiv2/models/autotask_mapping_request_service.py new file mode 100644 index 0000000..a8f1bf3 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_mapping_request_service.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskMappingRequestService(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """AutotaskMappingRequestService - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskMappingRequestService, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskMappingRequestService): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_mapping_response.py b/jcapiv2/jcapiv2/models/autotask_mapping_response.py new file mode 100644 index 0000000..9dde816 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_mapping_response.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskMappingResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'company': 'AutotaskMappingResponseCompany', + 'contract': 'AutotaskMappingResponseContract', + 'last_sync_date_time': 'str', + 'last_sync_status': 'str', + 'organization': 'AutotaskMappingResponseOrganization', + 'service': 'AutotaskMappingResponseService' + } + + attribute_map = { + 'company': 'company', + 'contract': 'contract', + 'last_sync_date_time': 'lastSyncDateTime', + 'last_sync_status': 'lastSyncStatus', + 'organization': 'organization', + 'service': 'service' + } + + def __init__(self, company=None, contract=None, last_sync_date_time=None, last_sync_status=None, organization=None, service=None): # noqa: E501 + """AutotaskMappingResponse - a model defined in Swagger""" # noqa: E501 + self._company = None + self._contract = None + self._last_sync_date_time = None + self._last_sync_status = None + self._organization = None + self._service = None + self.discriminator = None + if company is not None: + self.company = company + if contract is not None: + self.contract = contract + if last_sync_date_time is not None: + self.last_sync_date_time = last_sync_date_time + if last_sync_status is not None: + self.last_sync_status = last_sync_status + if organization is not None: + self.organization = organization + if service is not None: + self.service = service + + @property + def company(self): + """Gets the company of this AutotaskMappingResponse. # noqa: E501 + + + :return: The company of this AutotaskMappingResponse. # noqa: E501 + :rtype: AutotaskMappingResponseCompany + """ + return self._company + + @company.setter + def company(self, company): + """Sets the company of this AutotaskMappingResponse. + + + :param company: The company of this AutotaskMappingResponse. # noqa: E501 + :type: AutotaskMappingResponseCompany + """ + + self._company = company + + @property + def contract(self): + """Gets the contract of this AutotaskMappingResponse. # noqa: E501 + + + :return: The contract of this AutotaskMappingResponse. # noqa: E501 + :rtype: AutotaskMappingResponseContract + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this AutotaskMappingResponse. + + + :param contract: The contract of this AutotaskMappingResponse. # noqa: E501 + :type: AutotaskMappingResponseContract + """ + + self._contract = contract + + @property + def last_sync_date_time(self): + """Gets the last_sync_date_time of this AutotaskMappingResponse. # noqa: E501 + + + :return: The last_sync_date_time of this AutotaskMappingResponse. # noqa: E501 + :rtype: str + """ + return self._last_sync_date_time + + @last_sync_date_time.setter + def last_sync_date_time(self, last_sync_date_time): + """Sets the last_sync_date_time of this AutotaskMappingResponse. + + + :param last_sync_date_time: The last_sync_date_time of this AutotaskMappingResponse. # noqa: E501 + :type: str + """ + + self._last_sync_date_time = last_sync_date_time + + @property + def last_sync_status(self): + """Gets the last_sync_status of this AutotaskMappingResponse. # noqa: E501 + + + :return: The last_sync_status of this AutotaskMappingResponse. # noqa: E501 + :rtype: str + """ + return self._last_sync_status + + @last_sync_status.setter + def last_sync_status(self, last_sync_status): + """Sets the last_sync_status of this AutotaskMappingResponse. + + + :param last_sync_status: The last_sync_status of this AutotaskMappingResponse. # noqa: E501 + :type: str + """ + + self._last_sync_status = last_sync_status + + @property + def organization(self): + """Gets the organization of this AutotaskMappingResponse. # noqa: E501 + + + :return: The organization of this AutotaskMappingResponse. # noqa: E501 + :rtype: AutotaskMappingResponseOrganization + """ + return self._organization + + @organization.setter + def organization(self, organization): + """Sets the organization of this AutotaskMappingResponse. + + + :param organization: The organization of this AutotaskMappingResponse. # noqa: E501 + :type: AutotaskMappingResponseOrganization + """ + + self._organization = organization + + @property + def service(self): + """Gets the service of this AutotaskMappingResponse. # noqa: E501 + + + :return: The service of this AutotaskMappingResponse. # noqa: E501 + :rtype: AutotaskMappingResponseService + """ + return self._service + + @service.setter + def service(self, service): + """Sets the service of this AutotaskMappingResponse. + + + :param service: The service of this AutotaskMappingResponse. # noqa: E501 + :type: AutotaskMappingResponseService + """ + + self._service = service + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskMappingResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskMappingResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_mapping_response_company.py b/jcapiv2/jcapiv2/models/autotask_mapping_response_company.py new file mode 100644 index 0000000..0fe5596 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_mapping_response_company.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskMappingResponseCompany(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """AutotaskMappingResponseCompany - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """Gets the id of this AutotaskMappingResponseCompany. # noqa: E501 + + + :return: The id of this AutotaskMappingResponseCompany. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AutotaskMappingResponseCompany. + + + :param id: The id of this AutotaskMappingResponseCompany. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this AutotaskMappingResponseCompany. # noqa: E501 + + + :return: The name of this AutotaskMappingResponseCompany. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AutotaskMappingResponseCompany. + + + :param name: The name of this AutotaskMappingResponseCompany. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskMappingResponseCompany, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskMappingResponseCompany): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_mapping_response_contract.py b/jcapiv2/jcapiv2/models/autotask_mapping_response_contract.py new file mode 100644 index 0000000..bd5972f --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_mapping_response_contract.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskMappingResponseContract(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """AutotaskMappingResponseContract - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """Gets the id of this AutotaskMappingResponseContract. # noqa: E501 + + + :return: The id of this AutotaskMappingResponseContract. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AutotaskMappingResponseContract. + + + :param id: The id of this AutotaskMappingResponseContract. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this AutotaskMappingResponseContract. # noqa: E501 + + + :return: The name of this AutotaskMappingResponseContract. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AutotaskMappingResponseContract. + + + :param name: The name of this AutotaskMappingResponseContract. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskMappingResponseContract, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskMappingResponseContract): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_mapping_response_organization.py b/jcapiv2/jcapiv2/models/autotask_mapping_response_organization.py new file mode 100644 index 0000000..ca6af6e --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_mapping_response_organization.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskMappingResponseOrganization(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """AutotaskMappingResponseOrganization - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """Gets the id of this AutotaskMappingResponseOrganization. # noqa: E501 + + + :return: The id of this AutotaskMappingResponseOrganization. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AutotaskMappingResponseOrganization. + + + :param id: The id of this AutotaskMappingResponseOrganization. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this AutotaskMappingResponseOrganization. # noqa: E501 + + + :return: The name of this AutotaskMappingResponseOrganization. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AutotaskMappingResponseOrganization. + + + :param name: The name of this AutotaskMappingResponseOrganization. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskMappingResponseOrganization, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskMappingResponseOrganization): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_mapping_response_service.py b/jcapiv2/jcapiv2/models/autotask_mapping_response_service.py new file mode 100644 index 0000000..c5608ae --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_mapping_response_service.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskMappingResponseService(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str', + 'non_billable_users': 'int' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'non_billable_users': 'nonBillableUsers' + } + + def __init__(self, id=None, name=None, non_billable_users=None): # noqa: E501 + """AutotaskMappingResponseService - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._non_billable_users = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + if non_billable_users is not None: + self.non_billable_users = non_billable_users + + @property + def id(self): + """Gets the id of this AutotaskMappingResponseService. # noqa: E501 + + + :return: The id of this AutotaskMappingResponseService. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AutotaskMappingResponseService. + + + :param id: The id of this AutotaskMappingResponseService. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this AutotaskMappingResponseService. # noqa: E501 + + + :return: The name of this AutotaskMappingResponseService. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AutotaskMappingResponseService. + + + :param name: The name of this AutotaskMappingResponseService. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def non_billable_users(self): + """Gets the non_billable_users of this AutotaskMappingResponseService. # noqa: E501 + + + :return: The non_billable_users of this AutotaskMappingResponseService. # noqa: E501 + :rtype: int + """ + return self._non_billable_users + + @non_billable_users.setter + def non_billable_users(self, non_billable_users): + """Sets the non_billable_users of this AutotaskMappingResponseService. + + + :param non_billable_users: The non_billable_users of this AutotaskMappingResponseService. # noqa: E501 + :type: int + """ + + self._non_billable_users = non_billable_users + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskMappingResponseService, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskMappingResponseService): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_service.py b/jcapiv2/jcapiv2/models/autotask_service.py new file mode 100644 index 0000000..42df18e --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_service.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskService(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'contract_id': 'str', + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'contract_id': 'contractId', + 'id': 'id', + 'name': 'name' + } + + def __init__(self, contract_id=None, id=None, name=None): # noqa: E501 + """AutotaskService - a model defined in Swagger""" # noqa: E501 + self._contract_id = None + self._id = None + self._name = None + self.discriminator = None + self.contract_id = contract_id + self.id = id + self.name = name + + @property + def contract_id(self): + """Gets the contract_id of this AutotaskService. # noqa: E501 + + The autotask contract identifier linked to this contract service. # noqa: E501 + + :return: The contract_id of this AutotaskService. # noqa: E501 + :rtype: str + """ + return self._contract_id + + @contract_id.setter + def contract_id(self, contract_id): + """Sets the contract_id of this AutotaskService. + + The autotask contract identifier linked to this contract service. # noqa: E501 + + :param contract_id: The contract_id of this AutotaskService. # noqa: E501 + :type: str + """ + if contract_id is None: + raise ValueError("Invalid value for `contract_id`, must not be `None`") # noqa: E501 + + self._contract_id = contract_id + + @property + def id(self): + """Gets the id of this AutotaskService. # noqa: E501 + + The contract service identifier. # noqa: E501 + + :return: The id of this AutotaskService. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AutotaskService. + + The contract service identifier. # noqa: E501 + + :param id: The id of this AutotaskService. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this AutotaskService. # noqa: E501 + + The autotask service name linked to this contract service. # noqa: E501 + + :return: The name of this AutotaskService. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AutotaskService. + + The autotask service name linked to this contract service. # noqa: E501 + + :param name: The name of this AutotaskService. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskService, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskService): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_settings.py b/jcapiv2/jcapiv2/models/autotask_settings.py new file mode 100644 index 0000000..6ee118a --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_settings.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskSettings(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'automatic_ticketing': 'bool', + 'company_type_ids': 'list[int]' + } + + attribute_map = { + 'automatic_ticketing': 'automaticTicketing', + 'company_type_ids': 'companyTypeIds' + } + + def __init__(self, automatic_ticketing=None, company_type_ids=None): # noqa: E501 + """AutotaskSettings - a model defined in Swagger""" # noqa: E501 + self._automatic_ticketing = None + self._company_type_ids = None + self.discriminator = None + if automatic_ticketing is not None: + self.automatic_ticketing = automatic_ticketing + if company_type_ids is not None: + self.company_type_ids = company_type_ids + + @property + def automatic_ticketing(self): + """Gets the automatic_ticketing of this AutotaskSettings. # noqa: E501 + + Determine whether Autotask uses automatic ticketing # noqa: E501 + + :return: The automatic_ticketing of this AutotaskSettings. # noqa: E501 + :rtype: bool + """ + return self._automatic_ticketing + + @automatic_ticketing.setter + def automatic_ticketing(self, automatic_ticketing): + """Sets the automatic_ticketing of this AutotaskSettings. + + Determine whether Autotask uses automatic ticketing # noqa: E501 + + :param automatic_ticketing: The automatic_ticketing of this AutotaskSettings. # noqa: E501 + :type: bool + """ + + self._automatic_ticketing = automatic_ticketing + + @property + def company_type_ids(self): + """Gets the company_type_ids of this AutotaskSettings. # noqa: E501 + + The array of Autotask companyType IDs applicable to the Provider. # noqa: E501 + + :return: The company_type_ids of this AutotaskSettings. # noqa: E501 + :rtype: list[int] + """ + return self._company_type_ids + + @company_type_ids.setter + def company_type_ids(self, company_type_ids): + """Sets the company_type_ids of this AutotaskSettings. + + The array of Autotask companyType IDs applicable to the Provider. # noqa: E501 + + :param company_type_ids: The company_type_ids of this AutotaskSettings. # noqa: E501 + :type: list[int] + """ + + self._company_type_ids = company_type_ids + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskSettings, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskSettings): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_settings_patch_req.py b/jcapiv2/jcapiv2/models/autotask_settings_patch_req.py new file mode 100644 index 0000000..023eabd --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_settings_patch_req.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskSettingsPatchReq(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'automatic_ticketing': 'bool', + 'company_type_ids': 'list[int]' + } + + attribute_map = { + 'automatic_ticketing': 'automaticTicketing', + 'company_type_ids': 'companyTypeIds' + } + + def __init__(self, automatic_ticketing=None, company_type_ids=None): # noqa: E501 + """AutotaskSettingsPatchReq - a model defined in Swagger""" # noqa: E501 + self._automatic_ticketing = None + self._company_type_ids = None + self.discriminator = None + if automatic_ticketing is not None: + self.automatic_ticketing = automatic_ticketing + if company_type_ids is not None: + self.company_type_ids = company_type_ids + + @property + def automatic_ticketing(self): + """Gets the automatic_ticketing of this AutotaskSettingsPatchReq. # noqa: E501 + + Determine whether Autotask uses automatic ticketing # noqa: E501 + + :return: The automatic_ticketing of this AutotaskSettingsPatchReq. # noqa: E501 + :rtype: bool + """ + return self._automatic_ticketing + + @automatic_ticketing.setter + def automatic_ticketing(self, automatic_ticketing): + """Sets the automatic_ticketing of this AutotaskSettingsPatchReq. + + Determine whether Autotask uses automatic ticketing # noqa: E501 + + :param automatic_ticketing: The automatic_ticketing of this AutotaskSettingsPatchReq. # noqa: E501 + :type: bool + """ + + self._automatic_ticketing = automatic_ticketing + + @property + def company_type_ids(self): + """Gets the company_type_ids of this AutotaskSettingsPatchReq. # noqa: E501 + + The array of Autotask companyType IDs applicable to the Provider. # noqa: E501 + + :return: The company_type_ids of this AutotaskSettingsPatchReq. # noqa: E501 + :rtype: list[int] + """ + return self._company_type_ids + + @company_type_ids.setter + def company_type_ids(self, company_type_ids): + """Sets the company_type_ids of this AutotaskSettingsPatchReq. + + The array of Autotask companyType IDs applicable to the Provider. # noqa: E501 + + :param company_type_ids: The company_type_ids of this AutotaskSettingsPatchReq. # noqa: E501 + :type: list[int] + """ + + self._company_type_ids = company_type_ids + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskSettingsPatchReq, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskSettingsPatchReq): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration.py b/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration.py new file mode 100644 index 0000000..f13cdde --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration.py @@ -0,0 +1,402 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskTicketingAlertConfiguration(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'category': 'str', + 'description': 'str', + 'destination': 'str', + 'display_name': 'str', + 'due_days': 'int', + 'id': 'int', + 'priority': 'AutotaskTicketingAlertConfigurationPriority', + 'queue': 'AutotaskTicketingAlertConfigurationPriority', + 'resource': 'AutotaskTicketingAlertConfigurationResource', + 'should_create_tickets': 'bool', + 'source': 'AutotaskTicketingAlertConfigurationPriority', + 'status': 'AutotaskTicketingAlertConfigurationPriority' + } + + attribute_map = { + 'category': 'category', + 'description': 'description', + 'destination': 'destination', + 'display_name': 'displayName', + 'due_days': 'dueDays', + 'id': 'id', + 'priority': 'priority', + 'queue': 'queue', + 'resource': 'resource', + 'should_create_tickets': 'shouldCreateTickets', + 'source': 'source', + 'status': 'status' + } + + def __init__(self, category=None, description=None, destination=None, display_name=None, due_days=None, id=None, priority=None, queue=None, resource=None, should_create_tickets=None, source=None, status=None): # noqa: E501 + """AutotaskTicketingAlertConfiguration - a model defined in Swagger""" # noqa: E501 + self._category = None + self._description = None + self._destination = None + self._display_name = None + self._due_days = None + self._id = None + self._priority = None + self._queue = None + self._resource = None + self._should_create_tickets = None + self._source = None + self._status = None + self.discriminator = None + if category is not None: + self.category = category + if description is not None: + self.description = description + if destination is not None: + self.destination = destination + if display_name is not None: + self.display_name = display_name + if due_days is not None: + self.due_days = due_days + if id is not None: + self.id = id + if priority is not None: + self.priority = priority + if queue is not None: + self.queue = queue + if resource is not None: + self.resource = resource + if should_create_tickets is not None: + self.should_create_tickets = should_create_tickets + if source is not None: + self.source = source + if status is not None: + self.status = status + + @property + def category(self): + """Gets the category of this AutotaskTicketingAlertConfiguration. # noqa: E501 + + + :return: The category of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this AutotaskTicketingAlertConfiguration. + + + :param category: The category of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :type: str + """ + + self._category = category + + @property + def description(self): + """Gets the description of this AutotaskTicketingAlertConfiguration. # noqa: E501 + + + :return: The description of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this AutotaskTicketingAlertConfiguration. + + + :param description: The description of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def destination(self): + """Gets the destination of this AutotaskTicketingAlertConfiguration. # noqa: E501 + + + :return: The destination of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :rtype: str + """ + return self._destination + + @destination.setter + def destination(self, destination): + """Sets the destination of this AutotaskTicketingAlertConfiguration. + + + :param destination: The destination of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :type: str + """ + allowed_values = ["queue", "resource"] # noqa: E501 + if destination not in allowed_values: + raise ValueError( + "Invalid value for `destination` ({0}), must be one of {1}" # noqa: E501 + .format(destination, allowed_values) + ) + + self._destination = destination + + @property + def display_name(self): + """Gets the display_name of this AutotaskTicketingAlertConfiguration. # noqa: E501 + + + :return: The display_name of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this AutotaskTicketingAlertConfiguration. + + + :param display_name: The display_name of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :type: str + """ + + self._display_name = display_name + + @property + def due_days(self): + """Gets the due_days of this AutotaskTicketingAlertConfiguration. # noqa: E501 + + + :return: The due_days of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :rtype: int + """ + return self._due_days + + @due_days.setter + def due_days(self, due_days): + """Sets the due_days of this AutotaskTicketingAlertConfiguration. + + + :param due_days: The due_days of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :type: int + """ + + self._due_days = due_days + + @property + def id(self): + """Gets the id of this AutotaskTicketingAlertConfiguration. # noqa: E501 + + + :return: The id of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AutotaskTicketingAlertConfiguration. + + + :param id: The id of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def priority(self): + """Gets the priority of this AutotaskTicketingAlertConfiguration. # noqa: E501 + + + :return: The priority of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this AutotaskTicketingAlertConfiguration. + + + :param priority: The priority of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + + self._priority = priority + + @property + def queue(self): + """Gets the queue of this AutotaskTicketingAlertConfiguration. # noqa: E501 + + + :return: The queue of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._queue + + @queue.setter + def queue(self, queue): + """Sets the queue of this AutotaskTicketingAlertConfiguration. + + + :param queue: The queue of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + + self._queue = queue + + @property + def resource(self): + """Gets the resource of this AutotaskTicketingAlertConfiguration. # noqa: E501 + + + :return: The resource of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationResource + """ + return self._resource + + @resource.setter + def resource(self, resource): + """Sets the resource of this AutotaskTicketingAlertConfiguration. + + + :param resource: The resource of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationResource + """ + + self._resource = resource + + @property + def should_create_tickets(self): + """Gets the should_create_tickets of this AutotaskTicketingAlertConfiguration. # noqa: E501 + + + :return: The should_create_tickets of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :rtype: bool + """ + return self._should_create_tickets + + @should_create_tickets.setter + def should_create_tickets(self, should_create_tickets): + """Sets the should_create_tickets of this AutotaskTicketingAlertConfiguration. + + + :param should_create_tickets: The should_create_tickets of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :type: bool + """ + + self._should_create_tickets = should_create_tickets + + @property + def source(self): + """Gets the source of this AutotaskTicketingAlertConfiguration. # noqa: E501 + + + :return: The source of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this AutotaskTicketingAlertConfiguration. + + + :param source: The source of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + + self._source = source + + @property + def status(self): + """Gets the status of this AutotaskTicketingAlertConfiguration. # noqa: E501 + + + :return: The status of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this AutotaskTicketingAlertConfiguration. + + + :param status: The status of this AutotaskTicketingAlertConfiguration. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskTicketingAlertConfiguration, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskTicketingAlertConfiguration): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_list.py b/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_list.py new file mode 100644 index 0000000..2435eb7 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_list.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskTicketingAlertConfigurationList(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'records': 'list[AllOfAutotaskTicketingAlertConfigurationListRecordsItems]' + } + + attribute_map = { + 'records': 'records' + } + + def __init__(self, records=None): # noqa: E501 + """AutotaskTicketingAlertConfigurationList - a model defined in Swagger""" # noqa: E501 + self._records = None + self.discriminator = None + self.records = records + + @property + def records(self): + """Gets the records of this AutotaskTicketingAlertConfigurationList. # noqa: E501 + + + :return: The records of this AutotaskTicketingAlertConfigurationList. # noqa: E501 + :rtype: list[AllOfAutotaskTicketingAlertConfigurationListRecordsItems] + """ + return self._records + + @records.setter + def records(self, records): + """Sets the records of this AutotaskTicketingAlertConfigurationList. + + + :param records: The records of this AutotaskTicketingAlertConfigurationList. # noqa: E501 + :type: list[AllOfAutotaskTicketingAlertConfigurationListRecordsItems] + """ + if records is None: + raise ValueError("Invalid value for `records`, must not be `None`") # noqa: E501 + + self._records = records + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskTicketingAlertConfigurationList, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskTicketingAlertConfigurationList): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_option.py b/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_option.py new file mode 100644 index 0000000..ea9b845 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_option.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskTicketingAlertConfigurationOption(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'values': 'list[AutotaskTicketingAlertConfigurationOptionValues]' + } + + attribute_map = { + 'name': 'name', + 'values': 'values' + } + + def __init__(self, name=None, values=None): # noqa: E501 + """AutotaskTicketingAlertConfigurationOption - a model defined in Swagger""" # noqa: E501 + self._name = None + self._values = None + self.discriminator = None + if name is not None: + self.name = name + if values is not None: + self.values = values + + @property + def name(self): + """Gets the name of this AutotaskTicketingAlertConfigurationOption. # noqa: E501 + + + :return: The name of this AutotaskTicketingAlertConfigurationOption. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AutotaskTicketingAlertConfigurationOption. + + + :param name: The name of this AutotaskTicketingAlertConfigurationOption. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def values(self): + """Gets the values of this AutotaskTicketingAlertConfigurationOption. # noqa: E501 + + + :return: The values of this AutotaskTicketingAlertConfigurationOption. # noqa: E501 + :rtype: list[AutotaskTicketingAlertConfigurationOptionValues] + """ + return self._values + + @values.setter + def values(self, values): + """Sets the values of this AutotaskTicketingAlertConfigurationOption. + + + :param values: The values of this AutotaskTicketingAlertConfigurationOption. # noqa: E501 + :type: list[AutotaskTicketingAlertConfigurationOptionValues] + """ + + self._values = values + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskTicketingAlertConfigurationOption, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskTicketingAlertConfigurationOption): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_option_values.py b/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_option_values.py new file mode 100644 index 0000000..e9d5168 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_option_values.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskTicketingAlertConfigurationOptionValues(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'label': 'str', + 'value': 'int' + } + + attribute_map = { + 'label': 'label', + 'value': 'value' + } + + def __init__(self, label=None, value=None): # noqa: E501 + """AutotaskTicketingAlertConfigurationOptionValues - a model defined in Swagger""" # noqa: E501 + self._label = None + self._value = None + self.discriminator = None + if label is not None: + self.label = label + if value is not None: + self.value = value + + @property + def label(self): + """Gets the label of this AutotaskTicketingAlertConfigurationOptionValues. # noqa: E501 + + + :return: The label of this AutotaskTicketingAlertConfigurationOptionValues. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this AutotaskTicketingAlertConfigurationOptionValues. + + + :param label: The label of this AutotaskTicketingAlertConfigurationOptionValues. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def value(self): + """Gets the value of this AutotaskTicketingAlertConfigurationOptionValues. # noqa: E501 + + + :return: The value of this AutotaskTicketingAlertConfigurationOptionValues. # noqa: E501 + :rtype: int + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this AutotaskTicketingAlertConfigurationOptionValues. + + + :param value: The value of this AutotaskTicketingAlertConfigurationOptionValues. # noqa: E501 + :type: int + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskTicketingAlertConfigurationOptionValues, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskTicketingAlertConfigurationOptionValues): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_options.py b/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_options.py new file mode 100644 index 0000000..370c410 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_options.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskTicketingAlertConfigurationOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'options': 'list[AutotaskTicketingAlertConfigurationOption]', + 'resources': 'list[AutotaskTicketingAlertConfigurationResource]' + } + + attribute_map = { + 'options': 'options', + 'resources': 'resources' + } + + def __init__(self, options=None, resources=None): # noqa: E501 + """AutotaskTicketingAlertConfigurationOptions - a model defined in Swagger""" # noqa: E501 + self._options = None + self._resources = None + self.discriminator = None + if options is not None: + self.options = options + if resources is not None: + self.resources = resources + + @property + def options(self): + """Gets the options of this AutotaskTicketingAlertConfigurationOptions. # noqa: E501 + + + :return: The options of this AutotaskTicketingAlertConfigurationOptions. # noqa: E501 + :rtype: list[AutotaskTicketingAlertConfigurationOption] + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this AutotaskTicketingAlertConfigurationOptions. + + + :param options: The options of this AutotaskTicketingAlertConfigurationOptions. # noqa: E501 + :type: list[AutotaskTicketingAlertConfigurationOption] + """ + + self._options = options + + @property + def resources(self): + """Gets the resources of this AutotaskTicketingAlertConfigurationOptions. # noqa: E501 + + + :return: The resources of this AutotaskTicketingAlertConfigurationOptions. # noqa: E501 + :rtype: list[AutotaskTicketingAlertConfigurationResource] + """ + return self._resources + + @resources.setter + def resources(self, resources): + """Sets the resources of this AutotaskTicketingAlertConfigurationOptions. + + + :param resources: The resources of this AutotaskTicketingAlertConfigurationOptions. # noqa: E501 + :type: list[AutotaskTicketingAlertConfigurationResource] + """ + + self._resources = resources + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskTicketingAlertConfigurationOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskTicketingAlertConfigurationOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_priority.py b/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_priority.py new file mode 100644 index 0000000..1ea93e1 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_priority.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskTicketingAlertConfigurationPriority(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """AutotaskTicketingAlertConfigurationPriority - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """Gets the id of this AutotaskTicketingAlertConfigurationPriority. # noqa: E501 + + + :return: The id of this AutotaskTicketingAlertConfigurationPriority. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AutotaskTicketingAlertConfigurationPriority. + + + :param id: The id of this AutotaskTicketingAlertConfigurationPriority. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this AutotaskTicketingAlertConfigurationPriority. # noqa: E501 + + + :return: The name of this AutotaskTicketingAlertConfigurationPriority. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AutotaskTicketingAlertConfigurationPriority. + + + :param name: The name of this AutotaskTicketingAlertConfigurationPriority. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskTicketingAlertConfigurationPriority, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskTicketingAlertConfigurationPriority): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_request.py b/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_request.py new file mode 100644 index 0000000..0a05dd9 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_request.py @@ -0,0 +1,303 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskTicketingAlertConfigurationRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'destination': 'str', + 'due_days': 'int', + 'priority': 'AutotaskTicketingAlertConfigurationPriority', + 'queue': 'AutotaskTicketingAlertConfigurationPriority', + 'resource': 'AutotaskTicketingAlertConfigurationResource', + 'should_create_tickets': 'bool', + 'source': 'AutotaskTicketingAlertConfigurationPriority', + 'status': 'AutotaskTicketingAlertConfigurationPriority' + } + + attribute_map = { + 'destination': 'destination', + 'due_days': 'dueDays', + 'priority': 'priority', + 'queue': 'queue', + 'resource': 'resource', + 'should_create_tickets': 'shouldCreateTickets', + 'source': 'source', + 'status': 'status' + } + + def __init__(self, destination=None, due_days=None, priority=None, queue=None, resource=None, should_create_tickets=None, source=None, status=None): # noqa: E501 + """AutotaskTicketingAlertConfigurationRequest - a model defined in Swagger""" # noqa: E501 + self._destination = None + self._due_days = None + self._priority = None + self._queue = None + self._resource = None + self._should_create_tickets = None + self._source = None + self._status = None + self.discriminator = None + self.destination = destination + self.due_days = due_days + self.priority = priority + if queue is not None: + self.queue = queue + if resource is not None: + self.resource = resource + self.should_create_tickets = should_create_tickets + if source is not None: + self.source = source + self.status = status + + @property + def destination(self): + """Gets the destination of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + + + :return: The destination of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + :rtype: str + """ + return self._destination + + @destination.setter + def destination(self, destination): + """Sets the destination of this AutotaskTicketingAlertConfigurationRequest. + + + :param destination: The destination of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + :type: str + """ + if destination is None: + raise ValueError("Invalid value for `destination`, must not be `None`") # noqa: E501 + allowed_values = ["queue", "resource"] # noqa: E501 + if destination not in allowed_values: + raise ValueError( + "Invalid value for `destination` ({0}), must be one of {1}" # noqa: E501 + .format(destination, allowed_values) + ) + + self._destination = destination + + @property + def due_days(self): + """Gets the due_days of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + + + :return: The due_days of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + :rtype: int + """ + return self._due_days + + @due_days.setter + def due_days(self, due_days): + """Sets the due_days of this AutotaskTicketingAlertConfigurationRequest. + + + :param due_days: The due_days of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + :type: int + """ + if due_days is None: + raise ValueError("Invalid value for `due_days`, must not be `None`") # noqa: E501 + + self._due_days = due_days + + @property + def priority(self): + """Gets the priority of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + + + :return: The priority of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this AutotaskTicketingAlertConfigurationRequest. + + + :param priority: The priority of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + if priority is None: + raise ValueError("Invalid value for `priority`, must not be `None`") # noqa: E501 + + self._priority = priority + + @property + def queue(self): + """Gets the queue of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + + + :return: The queue of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._queue + + @queue.setter + def queue(self, queue): + """Sets the queue of this AutotaskTicketingAlertConfigurationRequest. + + + :param queue: The queue of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + + self._queue = queue + + @property + def resource(self): + """Gets the resource of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + + + :return: The resource of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationResource + """ + return self._resource + + @resource.setter + def resource(self, resource): + """Sets the resource of this AutotaskTicketingAlertConfigurationRequest. + + + :param resource: The resource of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationResource + """ + + self._resource = resource + + @property + def should_create_tickets(self): + """Gets the should_create_tickets of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + + + :return: The should_create_tickets of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + :rtype: bool + """ + return self._should_create_tickets + + @should_create_tickets.setter + def should_create_tickets(self, should_create_tickets): + """Sets the should_create_tickets of this AutotaskTicketingAlertConfigurationRequest. + + + :param should_create_tickets: The should_create_tickets of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + :type: bool + """ + if should_create_tickets is None: + raise ValueError("Invalid value for `should_create_tickets`, must not be `None`") # noqa: E501 + + self._should_create_tickets = should_create_tickets + + @property + def source(self): + """Gets the source of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + + + :return: The source of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this AutotaskTicketingAlertConfigurationRequest. + + + :param source: The source of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + + self._source = source + + @property + def status(self): + """Gets the status of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + + + :return: The status of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this AutotaskTicketingAlertConfigurationRequest. + + + :param status: The status of this AutotaskTicketingAlertConfigurationRequest. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskTicketingAlertConfigurationRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskTicketingAlertConfigurationRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_resource.py b/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_resource.py new file mode 100644 index 0000000..3416b51 --- /dev/null +++ b/jcapiv2/jcapiv2/models/autotask_ticketing_alert_configuration_resource.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AutotaskTicketingAlertConfigurationResource(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'name': 'str', + 'role': 'AutotaskTicketingAlertConfigurationPriority' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'role': 'role' + } + + def __init__(self, id=None, name=None, role=None): # noqa: E501 + """AutotaskTicketingAlertConfigurationResource - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._role = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + if role is not None: + self.role = role + + @property + def id(self): + """Gets the id of this AutotaskTicketingAlertConfigurationResource. # noqa: E501 + + + :return: The id of this AutotaskTicketingAlertConfigurationResource. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this AutotaskTicketingAlertConfigurationResource. + + + :param id: The id of this AutotaskTicketingAlertConfigurationResource. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this AutotaskTicketingAlertConfigurationResource. # noqa: E501 + + + :return: The name of this AutotaskTicketingAlertConfigurationResource. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AutotaskTicketingAlertConfigurationResource. + + + :param name: The name of this AutotaskTicketingAlertConfigurationResource. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def role(self): + """Gets the role of this AutotaskTicketingAlertConfigurationResource. # noqa: E501 + + + :return: The role of this AutotaskTicketingAlertConfigurationResource. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._role + + @role.setter + def role(self, role): + """Sets the role of this AutotaskTicketingAlertConfigurationResource. + + + :param role: The role of this AutotaskTicketingAlertConfigurationResource. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + + self._role = role + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AutotaskTicketingAlertConfigurationResource, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AutotaskTicketingAlertConfigurationResource): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/billing_integration_company_type.py b/jcapiv2/jcapiv2/models/billing_integration_company_type.py new file mode 100644 index 0000000..304999b --- /dev/null +++ b/jcapiv2/jcapiv2/models/billing_integration_company_type.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class BillingIntegrationCompanyType(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'float', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """BillingIntegrationCompanyType - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + self.id = id + self.name = name + + @property + def id(self): + """Gets the id of this BillingIntegrationCompanyType. # noqa: E501 + + The company type identifier. # noqa: E501 + + :return: The id of this BillingIntegrationCompanyType. # noqa: E501 + :rtype: float + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this BillingIntegrationCompanyType. + + The company type identifier. # noqa: E501 + + :param id: The id of this BillingIntegrationCompanyType. # noqa: E501 + :type: float + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this BillingIntegrationCompanyType. # noqa: E501 + + The company type name. # noqa: E501 + + :return: The name of this BillingIntegrationCompanyType. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this BillingIntegrationCompanyType. + + The company type name. # noqa: E501 + + :param name: The name of this BillingIntegrationCompanyType. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(BillingIntegrationCompanyType, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BillingIntegrationCompanyType): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/body.py b/jcapiv2/jcapiv2/models/body.py deleted file mode 100644 index 8ad35bd..0000000 --- a/jcapiv2/jcapiv2/models/body.py +++ /dev/null @@ -1,119 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Body(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'name': 'str' - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None): # noqa: E501 - """Body - a model defined in Swagger""" # noqa: E501 - - self._name = None - self.discriminator = None - - if name is not None: - self.name = name - - @property - def name(self): - """Gets the name of this Body. # noqa: E501 - - The name used to identify this AppleMDM. # noqa: E501 - - :return: The name of this Body. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Body. - - The name used to identify this AppleMDM. # noqa: E501 - - :param name: The name of this Body. # noqa: E501 - :type: str - """ - if name is not None and len(name) > 255: - raise ValueError("Invalid value for `name`, length must be less than or equal to `255`") # noqa: E501 - - self._name = name - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Body, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Body): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/body1.py b/jcapiv2/jcapiv2/models/body1.py deleted file mode 100644 index 596d789..0000000 --- a/jcapiv2/jcapiv2/models/body1.py +++ /dev/null @@ -1,167 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Body1(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'groups': 'list[str]', - 'name': 'str', - 'users': 'list[str]' - } - - attribute_map = { - 'groups': 'groups', - 'name': 'name', - 'users': 'users' - } - - def __init__(self, groups=None, name=None, users=None): # noqa: E501 - """Body1 - a model defined in Swagger""" # noqa: E501 - - self._groups = None - self._name = None - self._users = None - self.discriminator = None - - if groups is not None: - self.groups = groups - if name is not None: - self.name = name - if users is not None: - self.users = users - - @property - def groups(self): - """Gets the groups of this Body1. # noqa: E501 - - - :return: The groups of this Body1. # noqa: E501 - :rtype: list[str] - """ - return self._groups - - @groups.setter - def groups(self, groups): - """Sets the groups of this Body1. - - - :param groups: The groups of this Body1. # noqa: E501 - :type: list[str] - """ - - self._groups = groups - - @property - def name(self): - """Gets the name of this Body1. # noqa: E501 - - - :return: The name of this Body1. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Body1. - - - :param name: The name of this Body1. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def users(self): - """Gets the users of this Body1. # noqa: E501 - - - :return: The users of this Body1. # noqa: E501 - :rtype: list[str] - """ - return self._users - - @users.setter - def users(self, users): - """Sets the users of this Body1. - - - :param users: The users of this Body1. # noqa: E501 - :type: list[str] - """ - - self._users = users - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Body1, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Body1): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/body2.py b/jcapiv2/jcapiv2/models/body2.py deleted file mode 100644 index 530b39f..0000000 --- a/jcapiv2/jcapiv2/models/body2.py +++ /dev/null @@ -1,167 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Body2(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'groups': 'list[str]', - 'name': 'str', - 'users': 'list[str]' - } - - attribute_map = { - 'groups': 'groups', - 'name': 'name', - 'users': 'users' - } - - def __init__(self, groups=None, name=None, users=None): # noqa: E501 - """Body2 - a model defined in Swagger""" # noqa: E501 - - self._groups = None - self._name = None - self._users = None - self.discriminator = None - - if groups is not None: - self.groups = groups - if name is not None: - self.name = name - if users is not None: - self.users = users - - @property - def groups(self): - """Gets the groups of this Body2. # noqa: E501 - - - :return: The groups of this Body2. # noqa: E501 - :rtype: list[str] - """ - return self._groups - - @groups.setter - def groups(self, groups): - """Sets the groups of this Body2. - - - :param groups: The groups of this Body2. # noqa: E501 - :type: list[str] - """ - - self._groups = groups - - @property - def name(self): - """Gets the name of this Body2. # noqa: E501 - - - :return: The name of this Body2. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Body2. - - - :param name: The name of this Body2. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def users(self): - """Gets the users of this Body2. # noqa: E501 - - - :return: The users of this Body2. # noqa: E501 - :rtype: list[str] - """ - return self._users - - @users.setter - def users(self, users): - """Sets the users of this Body2. - - - :param users: The users of this Body2. # noqa: E501 - :type: list[str] - """ - - self._users = users - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Body2, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Body2): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/body3.py b/jcapiv2/jcapiv2/models/body3.py deleted file mode 100644 index 8fe9160..0000000 --- a/jcapiv2/jcapiv2/models/body3.py +++ /dev/null @@ -1,169 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - -from jcapiv2.models.ldap_server_action import LdapServerAction # noqa: F401,E501 - - -class Body3(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'str', - 'user_lockout_action': 'LdapServerAction', - 'user_password_expiration_action': 'LdapServerAction' - } - - attribute_map = { - 'id': 'id', - 'user_lockout_action': 'userLockoutAction', - 'user_password_expiration_action': 'userPasswordExpirationAction' - } - - def __init__(self, id=None, user_lockout_action=None, user_password_expiration_action=None): # noqa: E501 - """Body3 - a model defined in Swagger""" # noqa: E501 - - self._id = None - self._user_lockout_action = None - self._user_password_expiration_action = None - self.discriminator = None - - if id is not None: - self.id = id - if user_lockout_action is not None: - self.user_lockout_action = user_lockout_action - if user_password_expiration_action is not None: - self.user_password_expiration_action = user_password_expiration_action - - @property - def id(self): - """Gets the id of this Body3. # noqa: E501 - - - :return: The id of this Body3. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Body3. - - - :param id: The id of this Body3. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def user_lockout_action(self): - """Gets the user_lockout_action of this Body3. # noqa: E501 - - - :return: The user_lockout_action of this Body3. # noqa: E501 - :rtype: LdapServerAction - """ - return self._user_lockout_action - - @user_lockout_action.setter - def user_lockout_action(self, user_lockout_action): - """Sets the user_lockout_action of this Body3. - - - :param user_lockout_action: The user_lockout_action of this Body3. # noqa: E501 - :type: LdapServerAction - """ - - self._user_lockout_action = user_lockout_action - - @property - def user_password_expiration_action(self): - """Gets the user_password_expiration_action of this Body3. # noqa: E501 - - - :return: The user_password_expiration_action of this Body3. # noqa: E501 - :rtype: LdapServerAction - """ - return self._user_password_expiration_action - - @user_password_expiration_action.setter - def user_password_expiration_action(self, user_password_expiration_action): - """Sets the user_password_expiration_action of this Body3. - - - :param user_password_expiration_action: The user_password_expiration_action of this Body3. # noqa: E501 - :type: LdapServerAction - """ - - self._user_password_expiration_action = user_password_expiration_action - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Body3, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Body3): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/bulk_scheduled_statechange_create.py b/jcapiv2/jcapiv2/models/bulk_scheduled_statechange_create.py new file mode 100644 index 0000000..20946e0 --- /dev/null +++ b/jcapiv2/jcapiv2/models/bulk_scheduled_statechange_create.py @@ -0,0 +1,233 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class BulkScheduledStatechangeCreate(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'activation_email_override': 'str', + 'send_activation_emails': 'bool', + 'start_date': 'datetime', + 'state': 'str', + 'user_ids': 'list[str]' + } + + attribute_map = { + 'activation_email_override': 'activation_email_override', + 'send_activation_emails': 'send_activation_emails', + 'start_date': 'start_date', + 'state': 'state', + 'user_ids': 'user_ids' + } + + def __init__(self, activation_email_override=None, send_activation_emails=None, start_date=None, state=None, user_ids=None): # noqa: E501 + """BulkScheduledStatechangeCreate - a model defined in Swagger""" # noqa: E501 + self._activation_email_override = None + self._send_activation_emails = None + self._start_date = None + self._state = None + self._user_ids = None + self.discriminator = None + if activation_email_override is not None: + self.activation_email_override = activation_email_override + if send_activation_emails is not None: + self.send_activation_emails = send_activation_emails + self.start_date = start_date + self.state = state + self.user_ids = user_ids + + @property + def activation_email_override(self): + """Gets the activation_email_override of this BulkScheduledStatechangeCreate. # noqa: E501 + + Send the activation or welcome email to the specified email address upon activation. Can only be used with a single user_id and scheduled activation. This field will be ignored if `send_activation_emails` is explicitly set to false. # noqa: E501 + + :return: The activation_email_override of this BulkScheduledStatechangeCreate. # noqa: E501 + :rtype: str + """ + return self._activation_email_override + + @activation_email_override.setter + def activation_email_override(self, activation_email_override): + """Sets the activation_email_override of this BulkScheduledStatechangeCreate. + + Send the activation or welcome email to the specified email address upon activation. Can only be used with a single user_id and scheduled activation. This field will be ignored if `send_activation_emails` is explicitly set to false. # noqa: E501 + + :param activation_email_override: The activation_email_override of this BulkScheduledStatechangeCreate. # noqa: E501 + :type: str + """ + + self._activation_email_override = activation_email_override + + @property + def send_activation_emails(self): + """Gets the send_activation_emails of this BulkScheduledStatechangeCreate. # noqa: E501 + + Set to true to send activation or welcome email(s) to each user_id upon activation. Set to false to suppress emails. Can only be used with scheduled activation(s). # noqa: E501 + + :return: The send_activation_emails of this BulkScheduledStatechangeCreate. # noqa: E501 + :rtype: bool + """ + return self._send_activation_emails + + @send_activation_emails.setter + def send_activation_emails(self, send_activation_emails): + """Sets the send_activation_emails of this BulkScheduledStatechangeCreate. + + Set to true to send activation or welcome email(s) to each user_id upon activation. Set to false to suppress emails. Can only be used with scheduled activation(s). # noqa: E501 + + :param send_activation_emails: The send_activation_emails of this BulkScheduledStatechangeCreate. # noqa: E501 + :type: bool + """ + + self._send_activation_emails = send_activation_emails + + @property + def start_date(self): + """Gets the start_date of this BulkScheduledStatechangeCreate. # noqa: E501 + + Date and time that scheduled action should occur # noqa: E501 + + :return: The start_date of this BulkScheduledStatechangeCreate. # noqa: E501 + :rtype: datetime + """ + return self._start_date + + @start_date.setter + def start_date(self, start_date): + """Sets the start_date of this BulkScheduledStatechangeCreate. + + Date and time that scheduled action should occur # noqa: E501 + + :param start_date: The start_date of this BulkScheduledStatechangeCreate. # noqa: E501 + :type: datetime + """ + if start_date is None: + raise ValueError("Invalid value for `start_date`, must not be `None`") # noqa: E501 + + self._start_date = start_date + + @property + def state(self): + """Gets the state of this BulkScheduledStatechangeCreate. # noqa: E501 + + The state to move the user(s) to # noqa: E501 + + :return: The state of this BulkScheduledStatechangeCreate. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this BulkScheduledStatechangeCreate. + + The state to move the user(s) to # noqa: E501 + + :param state: The state of this BulkScheduledStatechangeCreate. # noqa: E501 + :type: str + """ + if state is None: + raise ValueError("Invalid value for `state`, must not be `None`") # noqa: E501 + allowed_values = ["ACTIVATED", "SUSPENDED"] # noqa: E501 + if state not in allowed_values: + raise ValueError( + "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 + .format(state, allowed_values) + ) + + self._state = state + + @property + def user_ids(self): + """Gets the user_ids of this BulkScheduledStatechangeCreate. # noqa: E501 + + Array of system user ids to schedule for a state change # noqa: E501 + + :return: The user_ids of this BulkScheduledStatechangeCreate. # noqa: E501 + :rtype: list[str] + """ + return self._user_ids + + @user_ids.setter + def user_ids(self, user_ids): + """Sets the user_ids of this BulkScheduledStatechangeCreate. + + Array of system user ids to schedule for a state change # noqa: E501 + + :param user_ids: The user_ids of this BulkScheduledStatechangeCreate. # noqa: E501 + :type: list[str] + """ + if user_ids is None: + raise ValueError("Invalid value for `user_ids`, must not be `None`") # noqa: E501 + + self._user_ids = user_ids + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(BulkScheduledStatechangeCreate, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BulkScheduledStatechangeCreate): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/bulk_user_create.py b/jcapiv2/jcapiv2/models/bulk_user_create.py index ce8a133..940fbff 100644 --- a/jcapiv2/jcapiv2/models/bulk_user_create.py +++ b/jcapiv2/jcapiv2/models/bulk_user_create.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class BulkUserCreate(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -48,14 +45,12 @@ class BulkUserCreate(object): def __init__(self, attributes=None, email=None, firstname=None, lastname=None, username=None): # noqa: E501 """BulkUserCreate - a model defined in Swagger""" # noqa: E501 - self._attributes = None self._email = None self._firstname = None self._lastname = None self._username = None self.discriminator = None - if attributes is not None: self.attributes = attributes if email is not None: diff --git a/jcapiv2/jcapiv2/models/bulk_user_update.py b/jcapiv2/jcapiv2/models/bulk_user_update.py index 28b4841..f58f414 100644 --- a/jcapiv2/jcapiv2/models/bulk_user_update.py +++ b/jcapiv2/jcapiv2/models/bulk_user_update.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class BulkUserUpdate(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -50,7 +47,6 @@ class BulkUserUpdate(object): def __init__(self, attributes=None, email=None, firstname=None, id=None, lastname=None, username=None): # noqa: E501 """BulkUserUpdate - a model defined in Swagger""" # noqa: E501 - self._attributes = None self._email = None self._firstname = None @@ -58,7 +54,6 @@ def __init__(self, attributes=None, email=None, firstname=None, id=None, lastnam self._lastname = None self._username = None self.discriminator = None - if attributes is not None: self.attributes = attributes if email is not None: diff --git a/jcapiv2/jcapiv2/models/command_result_list.py b/jcapiv2/jcapiv2/models/command_result_list.py new file mode 100644 index 0000000..3335191 --- /dev/null +++ b/jcapiv2/jcapiv2/models/command_result_list.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class CommandResultList(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[CommandResultListResults]', + 'total_count': 'int' + } + + attribute_map = { + 'results': 'results', + 'total_count': 'totalCount' + } + + def __init__(self, results=None, total_count=None): # noqa: E501 + """CommandResultList - a model defined in Swagger""" # noqa: E501 + self._results = None + self._total_count = None + self.discriminator = None + if results is not None: + self.results = results + if total_count is not None: + self.total_count = total_count + + @property + def results(self): + """Gets the results of this CommandResultList. # noqa: E501 + + + :return: The results of this CommandResultList. # noqa: E501 + :rtype: list[CommandResultListResults] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this CommandResultList. + + + :param results: The results of this CommandResultList. # noqa: E501 + :type: list[CommandResultListResults] + """ + + self._results = results + + @property + def total_count(self): + """Gets the total_count of this CommandResultList. # noqa: E501 + + The total number of command results # noqa: E501 + + :return: The total_count of this CommandResultList. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this CommandResultList. + + The total number of command results # noqa: E501 + + :param total_count: The total_count of this CommandResultList. # noqa: E501 + :type: int + """ + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CommandResultList, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CommandResultList): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/command_result_list_results.py b/jcapiv2/jcapiv2/models/command_result_list_results.py new file mode 100644 index 0000000..9b3b4af --- /dev/null +++ b/jcapiv2/jcapiv2/models/command_result_list_results.py @@ -0,0 +1,224 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class CommandResultListResults(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'command': 'str', + 'completed_count': 'int', + 'id': 'str', + 'pending_count': 'int', + 'system': 'str' + } + + attribute_map = { + 'command': 'command', + 'completed_count': 'completedCount', + 'id': 'id', + 'pending_count': 'pendingCount', + 'system': 'system' + } + + def __init__(self, command=None, completed_count=None, id=None, pending_count=None, system=None): # noqa: E501 + """CommandResultListResults - a model defined in Swagger""" # noqa: E501 + self._command = None + self._completed_count = None + self._id = None + self._pending_count = None + self._system = None + self.discriminator = None + if command is not None: + self.command = command + if completed_count is not None: + self.completed_count = completed_count + if id is not None: + self.id = id + if pending_count is not None: + self.pending_count = pending_count + if system is not None: + self.system = system + + @property + def command(self): + """Gets the command of this CommandResultListResults. # noqa: E501 + + The ID of the command, from savedAgentCommands. # noqa: E501 + + :return: The command of this CommandResultListResults. # noqa: E501 + :rtype: str + """ + return self._command + + @command.setter + def command(self, command): + """Sets the command of this CommandResultListResults. + + The ID of the command, from savedAgentCommands. # noqa: E501 + + :param command: The command of this CommandResultListResults. # noqa: E501 + :type: str + """ + + self._command = command + + @property + def completed_count(self): + """Gets the completed_count of this CommandResultListResults. # noqa: E501 + + The number of devices that we do have results from. # noqa: E501 + + :return: The completed_count of this CommandResultListResults. # noqa: E501 + :rtype: int + """ + return self._completed_count + + @completed_count.setter + def completed_count(self, completed_count): + """Sets the completed_count of this CommandResultListResults. + + The number of devices that we do have results from. # noqa: E501 + + :param completed_count: The completed_count of this CommandResultListResults. # noqa: E501 + :type: int + """ + + self._completed_count = completed_count + + @property + def id(self): + """Gets the id of this CommandResultListResults. # noqa: E501 + + The workflowInstanceId. # noqa: E501 + + :return: The id of this CommandResultListResults. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CommandResultListResults. + + The workflowInstanceId. # noqa: E501 + + :param id: The id of this CommandResultListResults. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def pending_count(self): + """Gets the pending_count of this CommandResultListResults. # noqa: E501 + + The number of devices that we haven't received results from. # noqa: E501 + + :return: The pending_count of this CommandResultListResults. # noqa: E501 + :rtype: int + """ + return self._pending_count + + @pending_count.setter + def pending_count(self, pending_count): + """Sets the pending_count of this CommandResultListResults. + + The number of devices that we haven't received results from. # noqa: E501 + + :param pending_count: The pending_count of this CommandResultListResults. # noqa: E501 + :type: int + """ + + self._pending_count = pending_count + + @property + def system(self): + """Gets the system of this CommandResultListResults. # noqa: E501 + + The ID of the device the command is bound to. # noqa: E501 + + :return: The system of this CommandResultListResults. # noqa: E501 + :rtype: str + """ + return self._system + + @system.setter + def system(self, system): + """Sets the system of this CommandResultListResults. + + The ID of the device the command is bound to. # noqa: E501 + + :param system: The system of this CommandResultListResults. # noqa: E501 + :type: str + """ + + self._system = system + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CommandResultListResults, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CommandResultListResults): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connect_wise_mapping_request.py b/jcapiv2/jcapiv2/models/connect_wise_mapping_request.py new file mode 100644 index 0000000..beaca39 --- /dev/null +++ b/jcapiv2/jcapiv2/models/connect_wise_mapping_request.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectWiseMappingRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data': 'list[ConnectWiseMappingRequestData]' + } + + attribute_map = { + 'data': 'data' + } + + def __init__(self, data=None): # noqa: E501 + """ConnectWiseMappingRequest - a model defined in Swagger""" # noqa: E501 + self._data = None + self.discriminator = None + if data is not None: + self.data = data + + @property + def data(self): + """Gets the data of this ConnectWiseMappingRequest. # noqa: E501 + + + :return: The data of this ConnectWiseMappingRequest. # noqa: E501 + :rtype: list[ConnectWiseMappingRequestData] + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this ConnectWiseMappingRequest. + + + :param data: The data of this ConnectWiseMappingRequest. # noqa: E501 + :type: list[ConnectWiseMappingRequestData] + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectWiseMappingRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectWiseMappingRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connect_wise_mapping_request_company.py b/jcapiv2/jcapiv2/models/connect_wise_mapping_request_company.py new file mode 100644 index 0000000..482c7df --- /dev/null +++ b/jcapiv2/jcapiv2/models/connect_wise_mapping_request_company.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectWiseMappingRequestCompany(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """ConnectWiseMappingRequestCompany - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + self.id = id + self.name = name + + @property + def id(self): + """Gets the id of this ConnectWiseMappingRequestCompany. # noqa: E501 + + + :return: The id of this ConnectWiseMappingRequestCompany. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ConnectWiseMappingRequestCompany. + + + :param id: The id of this ConnectWiseMappingRequestCompany. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this ConnectWiseMappingRequestCompany. # noqa: E501 + + + :return: The name of this ConnectWiseMappingRequestCompany. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ConnectWiseMappingRequestCompany. + + + :param name: The name of this ConnectWiseMappingRequestCompany. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectWiseMappingRequestCompany, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectWiseMappingRequestCompany): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connect_wise_mapping_request_data.py b/jcapiv2/jcapiv2/models/connect_wise_mapping_request_data.py new file mode 100644 index 0000000..0dce998 --- /dev/null +++ b/jcapiv2/jcapiv2/models/connect_wise_mapping_request_data.py @@ -0,0 +1,218 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectWiseMappingRequestData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'addition': 'object', + 'agreement': 'object', + 'company': 'ConnectWiseMappingRequestCompany', + 'delete': 'bool', + 'organization': 'ConnectWiseMappingRequestOrganization' + } + + attribute_map = { + 'addition': 'addition', + 'agreement': 'agreement', + 'company': 'company', + 'delete': 'delete', + 'organization': 'organization' + } + + def __init__(self, addition=None, agreement=None, company=None, delete=None, organization=None): # noqa: E501 + """ConnectWiseMappingRequestData - a model defined in Swagger""" # noqa: E501 + self._addition = None + self._agreement = None + self._company = None + self._delete = None + self._organization = None + self.discriminator = None + self.addition = addition + self.agreement = agreement + self.company = company + if delete is not None: + self.delete = delete + self.organization = organization + + @property + def addition(self): + """Gets the addition of this ConnectWiseMappingRequestData. # noqa: E501 + + + :return: The addition of this ConnectWiseMappingRequestData. # noqa: E501 + :rtype: object + """ + return self._addition + + @addition.setter + def addition(self, addition): + """Sets the addition of this ConnectWiseMappingRequestData. + + + :param addition: The addition of this ConnectWiseMappingRequestData. # noqa: E501 + :type: object + """ + if addition is None: + raise ValueError("Invalid value for `addition`, must not be `None`") # noqa: E501 + + self._addition = addition + + @property + def agreement(self): + """Gets the agreement of this ConnectWiseMappingRequestData. # noqa: E501 + + + :return: The agreement of this ConnectWiseMappingRequestData. # noqa: E501 + :rtype: object + """ + return self._agreement + + @agreement.setter + def agreement(self, agreement): + """Sets the agreement of this ConnectWiseMappingRequestData. + + + :param agreement: The agreement of this ConnectWiseMappingRequestData. # noqa: E501 + :type: object + """ + if agreement is None: + raise ValueError("Invalid value for `agreement`, must not be `None`") # noqa: E501 + + self._agreement = agreement + + @property + def company(self): + """Gets the company of this ConnectWiseMappingRequestData. # noqa: E501 + + + :return: The company of this ConnectWiseMappingRequestData. # noqa: E501 + :rtype: ConnectWiseMappingRequestCompany + """ + return self._company + + @company.setter + def company(self, company): + """Sets the company of this ConnectWiseMappingRequestData. + + + :param company: The company of this ConnectWiseMappingRequestData. # noqa: E501 + :type: ConnectWiseMappingRequestCompany + """ + if company is None: + raise ValueError("Invalid value for `company`, must not be `None`") # noqa: E501 + + self._company = company + + @property + def delete(self): + """Gets the delete of this ConnectWiseMappingRequestData. # noqa: E501 + + + :return: The delete of this ConnectWiseMappingRequestData. # noqa: E501 + :rtype: bool + """ + return self._delete + + @delete.setter + def delete(self, delete): + """Sets the delete of this ConnectWiseMappingRequestData. + + + :param delete: The delete of this ConnectWiseMappingRequestData. # noqa: E501 + :type: bool + """ + + self._delete = delete + + @property + def organization(self): + """Gets the organization of this ConnectWiseMappingRequestData. # noqa: E501 + + + :return: The organization of this ConnectWiseMappingRequestData. # noqa: E501 + :rtype: ConnectWiseMappingRequestOrganization + """ + return self._organization + + @organization.setter + def organization(self, organization): + """Sets the organization of this ConnectWiseMappingRequestData. + + + :param organization: The organization of this ConnectWiseMappingRequestData. # noqa: E501 + :type: ConnectWiseMappingRequestOrganization + """ + if organization is None: + raise ValueError("Invalid value for `organization`, must not be `None`") # noqa: E501 + + self._organization = organization + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectWiseMappingRequestData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectWiseMappingRequestData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connect_wise_mapping_request_organization.py b/jcapiv2/jcapiv2/models/connect_wise_mapping_request_organization.py new file mode 100644 index 0000000..e1d8828 --- /dev/null +++ b/jcapiv2/jcapiv2/models/connect_wise_mapping_request_organization.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectWiseMappingRequestOrganization(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """ConnectWiseMappingRequestOrganization - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + self.id = id + self.name = name + + @property + def id(self): + """Gets the id of this ConnectWiseMappingRequestOrganization. # noqa: E501 + + + :return: The id of this ConnectWiseMappingRequestOrganization. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ConnectWiseMappingRequestOrganization. + + + :param id: The id of this ConnectWiseMappingRequestOrganization. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this ConnectWiseMappingRequestOrganization. # noqa: E501 + + + :return: The name of this ConnectWiseMappingRequestOrganization. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ConnectWiseMappingRequestOrganization. + + + :param name: The name of this ConnectWiseMappingRequestOrganization. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectWiseMappingRequestOrganization, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectWiseMappingRequestOrganization): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connect_wise_mapping_response.py b/jcapiv2/jcapiv2/models/connect_wise_mapping_response.py new file mode 100644 index 0000000..552f7d3 --- /dev/null +++ b/jcapiv2/jcapiv2/models/connect_wise_mapping_response.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectWiseMappingResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'addition': 'ConnectWiseMappingResponseAddition', + 'agreement': 'ConnectWiseMappingResponseAddition', + 'company': 'ConnectWiseMappingResponseAddition', + 'last_sync_date_time': 'str', + 'last_sync_status': 'str', + 'organization': 'ConnectWiseMappingResponseAddition' + } + + attribute_map = { + 'addition': 'addition', + 'agreement': 'agreement', + 'company': 'company', + 'last_sync_date_time': 'lastSyncDateTime', + 'last_sync_status': 'lastSyncStatus', + 'organization': 'organization' + } + + def __init__(self, addition=None, agreement=None, company=None, last_sync_date_time=None, last_sync_status=None, organization=None): # noqa: E501 + """ConnectWiseMappingResponse - a model defined in Swagger""" # noqa: E501 + self._addition = None + self._agreement = None + self._company = None + self._last_sync_date_time = None + self._last_sync_status = None + self._organization = None + self.discriminator = None + if addition is not None: + self.addition = addition + if agreement is not None: + self.agreement = agreement + if company is not None: + self.company = company + if last_sync_date_time is not None: + self.last_sync_date_time = last_sync_date_time + if last_sync_status is not None: + self.last_sync_status = last_sync_status + if organization is not None: + self.organization = organization + + @property + def addition(self): + """Gets the addition of this ConnectWiseMappingResponse. # noqa: E501 + + + :return: The addition of this ConnectWiseMappingResponse. # noqa: E501 + :rtype: ConnectWiseMappingResponseAddition + """ + return self._addition + + @addition.setter + def addition(self, addition): + """Sets the addition of this ConnectWiseMappingResponse. + + + :param addition: The addition of this ConnectWiseMappingResponse. # noqa: E501 + :type: ConnectWiseMappingResponseAddition + """ + + self._addition = addition + + @property + def agreement(self): + """Gets the agreement of this ConnectWiseMappingResponse. # noqa: E501 + + + :return: The agreement of this ConnectWiseMappingResponse. # noqa: E501 + :rtype: ConnectWiseMappingResponseAddition + """ + return self._agreement + + @agreement.setter + def agreement(self, agreement): + """Sets the agreement of this ConnectWiseMappingResponse. + + + :param agreement: The agreement of this ConnectWiseMappingResponse. # noqa: E501 + :type: ConnectWiseMappingResponseAddition + """ + + self._agreement = agreement + + @property + def company(self): + """Gets the company of this ConnectWiseMappingResponse. # noqa: E501 + + + :return: The company of this ConnectWiseMappingResponse. # noqa: E501 + :rtype: ConnectWiseMappingResponseAddition + """ + return self._company + + @company.setter + def company(self, company): + """Sets the company of this ConnectWiseMappingResponse. + + + :param company: The company of this ConnectWiseMappingResponse. # noqa: E501 + :type: ConnectWiseMappingResponseAddition + """ + + self._company = company + + @property + def last_sync_date_time(self): + """Gets the last_sync_date_time of this ConnectWiseMappingResponse. # noqa: E501 + + + :return: The last_sync_date_time of this ConnectWiseMappingResponse. # noqa: E501 + :rtype: str + """ + return self._last_sync_date_time + + @last_sync_date_time.setter + def last_sync_date_time(self, last_sync_date_time): + """Sets the last_sync_date_time of this ConnectWiseMappingResponse. + + + :param last_sync_date_time: The last_sync_date_time of this ConnectWiseMappingResponse. # noqa: E501 + :type: str + """ + + self._last_sync_date_time = last_sync_date_time + + @property + def last_sync_status(self): + """Gets the last_sync_status of this ConnectWiseMappingResponse. # noqa: E501 + + + :return: The last_sync_status of this ConnectWiseMappingResponse. # noqa: E501 + :rtype: str + """ + return self._last_sync_status + + @last_sync_status.setter + def last_sync_status(self, last_sync_status): + """Sets the last_sync_status of this ConnectWiseMappingResponse. + + + :param last_sync_status: The last_sync_status of this ConnectWiseMappingResponse. # noqa: E501 + :type: str + """ + + self._last_sync_status = last_sync_status + + @property + def organization(self): + """Gets the organization of this ConnectWiseMappingResponse. # noqa: E501 + + + :return: The organization of this ConnectWiseMappingResponse. # noqa: E501 + :rtype: ConnectWiseMappingResponseAddition + """ + return self._organization + + @organization.setter + def organization(self, organization): + """Sets the organization of this ConnectWiseMappingResponse. + + + :param organization: The organization of this ConnectWiseMappingResponse. # noqa: E501 + :type: ConnectWiseMappingResponseAddition + """ + + self._organization = organization + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectWiseMappingResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectWiseMappingResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connect_wise_mapping_response_addition.py b/jcapiv2/jcapiv2/models/connect_wise_mapping_response_addition.py new file mode 100644 index 0000000..6565f24 --- /dev/null +++ b/jcapiv2/jcapiv2/models/connect_wise_mapping_response_addition.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectWiseMappingResponseAddition(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """ConnectWiseMappingResponseAddition - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """Gets the id of this ConnectWiseMappingResponseAddition. # noqa: E501 + + + :return: The id of this ConnectWiseMappingResponseAddition. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ConnectWiseMappingResponseAddition. + + + :param id: The id of this ConnectWiseMappingResponseAddition. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this ConnectWiseMappingResponseAddition. # noqa: E501 + + + :return: The name of this ConnectWiseMappingResponseAddition. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ConnectWiseMappingResponseAddition. + + + :param name: The name of this ConnectWiseMappingResponseAddition. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectWiseMappingResponseAddition, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectWiseMappingResponseAddition): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connect_wise_settings.py b/jcapiv2/jcapiv2/models/connect_wise_settings.py new file mode 100644 index 0000000..9b5a41b --- /dev/null +++ b/jcapiv2/jcapiv2/models/connect_wise_settings.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectWiseSettings(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'automatic_ticketing': 'bool', + 'company_type_ids': 'list[int]' + } + + attribute_map = { + 'automatic_ticketing': 'automaticTicketing', + 'company_type_ids': 'companyTypeIds' + } + + def __init__(self, automatic_ticketing=None, company_type_ids=None): # noqa: E501 + """ConnectWiseSettings - a model defined in Swagger""" # noqa: E501 + self._automatic_ticketing = None + self._company_type_ids = None + self.discriminator = None + if automatic_ticketing is not None: + self.automatic_ticketing = automatic_ticketing + if company_type_ids is not None: + self.company_type_ids = company_type_ids + + @property + def automatic_ticketing(self): + """Gets the automatic_ticketing of this ConnectWiseSettings. # noqa: E501 + + Determine whether ConnectWise uses automatic ticketing # noqa: E501 + + :return: The automatic_ticketing of this ConnectWiseSettings. # noqa: E501 + :rtype: bool + """ + return self._automatic_ticketing + + @automatic_ticketing.setter + def automatic_ticketing(self, automatic_ticketing): + """Sets the automatic_ticketing of this ConnectWiseSettings. + + Determine whether ConnectWise uses automatic ticketing # noqa: E501 + + :param automatic_ticketing: The automatic_ticketing of this ConnectWiseSettings. # noqa: E501 + :type: bool + """ + + self._automatic_ticketing = automatic_ticketing + + @property + def company_type_ids(self): + """Gets the company_type_ids of this ConnectWiseSettings. # noqa: E501 + + The array of ConnectWise companyType IDs applicable to the Provider. # noqa: E501 + + :return: The company_type_ids of this ConnectWiseSettings. # noqa: E501 + :rtype: list[int] + """ + return self._company_type_ids + + @company_type_ids.setter + def company_type_ids(self, company_type_ids): + """Sets the company_type_ids of this ConnectWiseSettings. + + The array of ConnectWise companyType IDs applicable to the Provider. # noqa: E501 + + :param company_type_ids: The company_type_ids of this ConnectWiseSettings. # noqa: E501 + :type: list[int] + """ + + self._company_type_ids = company_type_ids + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectWiseSettings, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectWiseSettings): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connect_wise_settings_patch_req.py b/jcapiv2/jcapiv2/models/connect_wise_settings_patch_req.py new file mode 100644 index 0000000..19f6f32 --- /dev/null +++ b/jcapiv2/jcapiv2/models/connect_wise_settings_patch_req.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectWiseSettingsPatchReq(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'automatic_ticketing': 'bool', + 'company_type_ids': 'list[int]' + } + + attribute_map = { + 'automatic_ticketing': 'automaticTicketing', + 'company_type_ids': 'companyTypeIds' + } + + def __init__(self, automatic_ticketing=None, company_type_ids=None): # noqa: E501 + """ConnectWiseSettingsPatchReq - a model defined in Swagger""" # noqa: E501 + self._automatic_ticketing = None + self._company_type_ids = None + self.discriminator = None + if automatic_ticketing is not None: + self.automatic_ticketing = automatic_ticketing + if company_type_ids is not None: + self.company_type_ids = company_type_ids + + @property + def automatic_ticketing(self): + """Gets the automatic_ticketing of this ConnectWiseSettingsPatchReq. # noqa: E501 + + Determine whether ConnectWise uses automatic ticketing # noqa: E501 + + :return: The automatic_ticketing of this ConnectWiseSettingsPatchReq. # noqa: E501 + :rtype: bool + """ + return self._automatic_ticketing + + @automatic_ticketing.setter + def automatic_ticketing(self, automatic_ticketing): + """Sets the automatic_ticketing of this ConnectWiseSettingsPatchReq. + + Determine whether ConnectWise uses automatic ticketing # noqa: E501 + + :param automatic_ticketing: The automatic_ticketing of this ConnectWiseSettingsPatchReq. # noqa: E501 + :type: bool + """ + + self._automatic_ticketing = automatic_ticketing + + @property + def company_type_ids(self): + """Gets the company_type_ids of this ConnectWiseSettingsPatchReq. # noqa: E501 + + The array of ConnectWise companyType IDs applicable to the Provider. # noqa: E501 + + :return: The company_type_ids of this ConnectWiseSettingsPatchReq. # noqa: E501 + :rtype: list[int] + """ + return self._company_type_ids + + @company_type_ids.setter + def company_type_ids(self, company_type_ids): + """Sets the company_type_ids of this ConnectWiseSettingsPatchReq. + + The array of ConnectWise companyType IDs applicable to the Provider. # noqa: E501 + + :param company_type_ids: The company_type_ids of this ConnectWiseSettingsPatchReq. # noqa: E501 + :type: list[int] + """ + + self._company_type_ids = company_type_ids + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectWiseSettingsPatchReq, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectWiseSettingsPatchReq): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration.py b/jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration.py new file mode 100644 index 0000000..888ff18 --- /dev/null +++ b/jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration.py @@ -0,0 +1,293 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectWiseTicketingAlertConfiguration(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'category': 'str', + 'description': 'str', + 'display_name': 'str', + 'due_days': 'int', + 'id': 'int', + 'priority': 'AutotaskTicketingAlertConfigurationPriority', + 'should_create_tickets': 'bool', + 'source': 'AutotaskTicketingAlertConfigurationPriority' + } + + attribute_map = { + 'category': 'category', + 'description': 'description', + 'display_name': 'displayName', + 'due_days': 'dueDays', + 'id': 'id', + 'priority': 'priority', + 'should_create_tickets': 'shouldCreateTickets', + 'source': 'source' + } + + def __init__(self, category=None, description=None, display_name=None, due_days=None, id=None, priority=None, should_create_tickets=None, source=None): # noqa: E501 + """ConnectWiseTicketingAlertConfiguration - a model defined in Swagger""" # noqa: E501 + self._category = None + self._description = None + self._display_name = None + self._due_days = None + self._id = None + self._priority = None + self._should_create_tickets = None + self._source = None + self.discriminator = None + if category is not None: + self.category = category + if description is not None: + self.description = description + if display_name is not None: + self.display_name = display_name + if due_days is not None: + self.due_days = due_days + if id is not None: + self.id = id + if priority is not None: + self.priority = priority + self.should_create_tickets = should_create_tickets + if source is not None: + self.source = source + + @property + def category(self): + """Gets the category of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + + + :return: The category of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this ConnectWiseTicketingAlertConfiguration. + + + :param category: The category of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + :type: str + """ + + self._category = category + + @property + def description(self): + """Gets the description of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + + + :return: The description of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this ConnectWiseTicketingAlertConfiguration. + + + :param description: The description of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def display_name(self): + """Gets the display_name of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + + + :return: The display_name of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this ConnectWiseTicketingAlertConfiguration. + + + :param display_name: The display_name of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + :type: str + """ + + self._display_name = display_name + + @property + def due_days(self): + """Gets the due_days of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + + + :return: The due_days of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + :rtype: int + """ + return self._due_days + + @due_days.setter + def due_days(self, due_days): + """Sets the due_days of this ConnectWiseTicketingAlertConfiguration. + + + :param due_days: The due_days of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + :type: int + """ + + self._due_days = due_days + + @property + def id(self): + """Gets the id of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + + + :return: The id of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ConnectWiseTicketingAlertConfiguration. + + + :param id: The id of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def priority(self): + """Gets the priority of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + + + :return: The priority of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this ConnectWiseTicketingAlertConfiguration. + + + :param priority: The priority of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + + self._priority = priority + + @property + def should_create_tickets(self): + """Gets the should_create_tickets of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + + + :return: The should_create_tickets of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + :rtype: bool + """ + return self._should_create_tickets + + @should_create_tickets.setter + def should_create_tickets(self, should_create_tickets): + """Sets the should_create_tickets of this ConnectWiseTicketingAlertConfiguration. + + + :param should_create_tickets: The should_create_tickets of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + :type: bool + """ + if should_create_tickets is None: + raise ValueError("Invalid value for `should_create_tickets`, must not be `None`") # noqa: E501 + + self._should_create_tickets = should_create_tickets + + @property + def source(self): + """Gets the source of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + + + :return: The source of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this ConnectWiseTicketingAlertConfiguration. + + + :param source: The source of this ConnectWiseTicketingAlertConfiguration. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + + self._source = source + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectWiseTicketingAlertConfiguration, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectWiseTicketingAlertConfiguration): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration_list.py b/jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration_list.py new file mode 100644 index 0000000..99477d6 --- /dev/null +++ b/jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration_list.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectWiseTicketingAlertConfigurationList(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'records': 'list[AllOfConnectWiseTicketingAlertConfigurationListRecordsItems]' + } + + attribute_map = { + 'records': 'records' + } + + def __init__(self, records=None): # noqa: E501 + """ConnectWiseTicketingAlertConfigurationList - a model defined in Swagger""" # noqa: E501 + self._records = None + self.discriminator = None + self.records = records + + @property + def records(self): + """Gets the records of this ConnectWiseTicketingAlertConfigurationList. # noqa: E501 + + + :return: The records of this ConnectWiseTicketingAlertConfigurationList. # noqa: E501 + :rtype: list[AllOfConnectWiseTicketingAlertConfigurationListRecordsItems] + """ + return self._records + + @records.setter + def records(self, records): + """Sets the records of this ConnectWiseTicketingAlertConfigurationList. + + + :param records: The records of this ConnectWiseTicketingAlertConfigurationList. # noqa: E501 + :type: list[AllOfConnectWiseTicketingAlertConfigurationListRecordsItems] + """ + if records is None: + raise ValueError("Invalid value for `records`, must not be `None`") # noqa: E501 + + self._records = records + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectWiseTicketingAlertConfigurationList, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectWiseTicketingAlertConfigurationList): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration_option.py b/jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration_option.py new file mode 100644 index 0000000..ec16c1b --- /dev/null +++ b/jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration_option.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectWiseTicketingAlertConfigurationOption(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'values': 'list[AutotaskTicketingAlertConfigurationOptionValues]' + } + + attribute_map = { + 'name': 'name', + 'values': 'values' + } + + def __init__(self, name=None, values=None): # noqa: E501 + """ConnectWiseTicketingAlertConfigurationOption - a model defined in Swagger""" # noqa: E501 + self._name = None + self._values = None + self.discriminator = None + if name is not None: + self.name = name + if values is not None: + self.values = values + + @property + def name(self): + """Gets the name of this ConnectWiseTicketingAlertConfigurationOption. # noqa: E501 + + + :return: The name of this ConnectWiseTicketingAlertConfigurationOption. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ConnectWiseTicketingAlertConfigurationOption. + + + :param name: The name of this ConnectWiseTicketingAlertConfigurationOption. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def values(self): + """Gets the values of this ConnectWiseTicketingAlertConfigurationOption. # noqa: E501 + + + :return: The values of this ConnectWiseTicketingAlertConfigurationOption. # noqa: E501 + :rtype: list[AutotaskTicketingAlertConfigurationOptionValues] + """ + return self._values + + @values.setter + def values(self, values): + """Sets the values of this ConnectWiseTicketingAlertConfigurationOption. + + + :param values: The values of this ConnectWiseTicketingAlertConfigurationOption. # noqa: E501 + :type: list[AutotaskTicketingAlertConfigurationOptionValues] + """ + + self._values = values + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectWiseTicketingAlertConfigurationOption, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectWiseTicketingAlertConfigurationOption): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration_options.py b/jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration_options.py new file mode 100644 index 0000000..eeca3d0 --- /dev/null +++ b/jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration_options.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectWiseTicketingAlertConfigurationOptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'records': 'list[ConnectWiseTicketingAlertConfigurationOption]' + } + + attribute_map = { + 'records': 'records' + } + + def __init__(self, records=None): # noqa: E501 + """ConnectWiseTicketingAlertConfigurationOptions - a model defined in Swagger""" # noqa: E501 + self._records = None + self.discriminator = None + self.records = records + + @property + def records(self): + """Gets the records of this ConnectWiseTicketingAlertConfigurationOptions. # noqa: E501 + + + :return: The records of this ConnectWiseTicketingAlertConfigurationOptions. # noqa: E501 + :rtype: list[ConnectWiseTicketingAlertConfigurationOption] + """ + return self._records + + @records.setter + def records(self, records): + """Sets the records of this ConnectWiseTicketingAlertConfigurationOptions. + + + :param records: The records of this ConnectWiseTicketingAlertConfigurationOptions. # noqa: E501 + :type: list[ConnectWiseTicketingAlertConfigurationOption] + """ + if records is None: + raise ValueError("Invalid value for `records`, must not be `None`") # noqa: E501 + + self._records = records + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectWiseTicketingAlertConfigurationOptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectWiseTicketingAlertConfigurationOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration_request.py b/jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration_request.py new file mode 100644 index 0000000..4196db4 --- /dev/null +++ b/jcapiv2/jcapiv2/models/connect_wise_ticketing_alert_configuration_request.py @@ -0,0 +1,189 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectWiseTicketingAlertConfigurationRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'due_days': 'int', + 'priority': 'AutotaskTicketingAlertConfigurationPriority', + 'should_create_tickets': 'bool', + 'source': 'AutotaskTicketingAlertConfigurationPriority' + } + + attribute_map = { + 'due_days': 'dueDays', + 'priority': 'priority', + 'should_create_tickets': 'shouldCreateTickets', + 'source': 'source' + } + + def __init__(self, due_days=None, priority=None, should_create_tickets=None, source=None): # noqa: E501 + """ConnectWiseTicketingAlertConfigurationRequest - a model defined in Swagger""" # noqa: E501 + self._due_days = None + self._priority = None + self._should_create_tickets = None + self._source = None + self.discriminator = None + if due_days is not None: + self.due_days = due_days + if priority is not None: + self.priority = priority + self.should_create_tickets = should_create_tickets + if source is not None: + self.source = source + + @property + def due_days(self): + """Gets the due_days of this ConnectWiseTicketingAlertConfigurationRequest. # noqa: E501 + + + :return: The due_days of this ConnectWiseTicketingAlertConfigurationRequest. # noqa: E501 + :rtype: int + """ + return self._due_days + + @due_days.setter + def due_days(self, due_days): + """Sets the due_days of this ConnectWiseTicketingAlertConfigurationRequest. + + + :param due_days: The due_days of this ConnectWiseTicketingAlertConfigurationRequest. # noqa: E501 + :type: int + """ + + self._due_days = due_days + + @property + def priority(self): + """Gets the priority of this ConnectWiseTicketingAlertConfigurationRequest. # noqa: E501 + + + :return: The priority of this ConnectWiseTicketingAlertConfigurationRequest. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this ConnectWiseTicketingAlertConfigurationRequest. + + + :param priority: The priority of this ConnectWiseTicketingAlertConfigurationRequest. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + + self._priority = priority + + @property + def should_create_tickets(self): + """Gets the should_create_tickets of this ConnectWiseTicketingAlertConfigurationRequest. # noqa: E501 + + + :return: The should_create_tickets of this ConnectWiseTicketingAlertConfigurationRequest. # noqa: E501 + :rtype: bool + """ + return self._should_create_tickets + + @should_create_tickets.setter + def should_create_tickets(self, should_create_tickets): + """Sets the should_create_tickets of this ConnectWiseTicketingAlertConfigurationRequest. + + + :param should_create_tickets: The should_create_tickets of this ConnectWiseTicketingAlertConfigurationRequest. # noqa: E501 + :type: bool + """ + if should_create_tickets is None: + raise ValueError("Invalid value for `should_create_tickets`, must not be `None`") # noqa: E501 + + self._should_create_tickets = should_create_tickets + + @property + def source(self): + """Gets the source of this ConnectWiseTicketingAlertConfigurationRequest. # noqa: E501 + + + :return: The source of this ConnectWiseTicketingAlertConfigurationRequest. # noqa: E501 + :rtype: AutotaskTicketingAlertConfigurationPriority + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this ConnectWiseTicketingAlertConfigurationRequest. + + + :param source: The source of this ConnectWiseTicketingAlertConfigurationRequest. # noqa: E501 + :type: AutotaskTicketingAlertConfigurationPriority + """ + + self._source = source + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectWiseTicketingAlertConfigurationRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectWiseTicketingAlertConfigurationRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connectwise_addition.py b/jcapiv2/jcapiv2/models/connectwise_addition.py new file mode 100644 index 0000000..1156b57 --- /dev/null +++ b/jcapiv2/jcapiv2/models/connectwise_addition.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectwiseAddition(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """ConnectwiseAddition - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + self.id = id + self.name = name + + @property + def id(self): + """Gets the id of this ConnectwiseAddition. # noqa: E501 + + The addition identifier. # noqa: E501 + + :return: The id of this ConnectwiseAddition. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ConnectwiseAddition. + + The addition identifier. # noqa: E501 + + :param id: The id of this ConnectwiseAddition. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this ConnectwiseAddition. # noqa: E501 + + The addition name. # noqa: E501 + + :return: The name of this ConnectwiseAddition. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ConnectwiseAddition. + + The addition name. # noqa: E501 + + :param name: The name of this ConnectwiseAddition. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectwiseAddition, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectwiseAddition): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connectwise_agreement.py b/jcapiv2/jcapiv2/models/connectwise_agreement.py new file mode 100644 index 0000000..e706444 --- /dev/null +++ b/jcapiv2/jcapiv2/models/connectwise_agreement.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectwiseAgreement(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'company_id': 'str', + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'company_id': 'companyId', + 'id': 'id', + 'name': 'name' + } + + def __init__(self, company_id=None, id=None, name=None): # noqa: E501 + """ConnectwiseAgreement - a model defined in Swagger""" # noqa: E501 + self._company_id = None + self._id = None + self._name = None + self.discriminator = None + self.company_id = company_id + self.id = id + self.name = name + + @property + def company_id(self): + """Gets the company_id of this ConnectwiseAgreement. # noqa: E501 + + The ConnectWise company identifier linked to agreement. # noqa: E501 + + :return: The company_id of this ConnectwiseAgreement. # noqa: E501 + :rtype: str + """ + return self._company_id + + @company_id.setter + def company_id(self, company_id): + """Sets the company_id of this ConnectwiseAgreement. + + The ConnectWise company identifier linked to agreement. # noqa: E501 + + :param company_id: The company_id of this ConnectwiseAgreement. # noqa: E501 + :type: str + """ + if company_id is None: + raise ValueError("Invalid value for `company_id`, must not be `None`") # noqa: E501 + + self._company_id = company_id + + @property + def id(self): + """Gets the id of this ConnectwiseAgreement. # noqa: E501 + + The agreement identifier. # noqa: E501 + + :return: The id of this ConnectwiseAgreement. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ConnectwiseAgreement. + + The agreement identifier. # noqa: E501 + + :param id: The id of this ConnectwiseAgreement. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this ConnectwiseAgreement. # noqa: E501 + + The agreement name. # noqa: E501 + + :return: The name of this ConnectwiseAgreement. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ConnectwiseAgreement. + + The agreement name. # noqa: E501 + + :param name: The name of this ConnectwiseAgreement. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectwiseAgreement, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectwiseAgreement): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connectwise_company.py b/jcapiv2/jcapiv2/models/connectwise_company.py new file mode 100644 index 0000000..145e09c --- /dev/null +++ b/jcapiv2/jcapiv2/models/connectwise_company.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectwiseCompany(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """ConnectwiseCompany - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + self.id = id + self.name = name + + @property + def id(self): + """Gets the id of this ConnectwiseCompany. # noqa: E501 + + The company identifier. # noqa: E501 + + :return: The id of this ConnectwiseCompany. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ConnectwiseCompany. + + The company identifier. # noqa: E501 + + :param id: The id of this ConnectwiseCompany. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this ConnectwiseCompany. # noqa: E501 + + The company name. # noqa: E501 + + :return: The name of this ConnectwiseCompany. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ConnectwiseCompany. + + The company name. # noqa: E501 + + :param name: The name of this ConnectwiseCompany. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectwiseCompany, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectwiseCompany): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connectwise_company_resp.py b/jcapiv2/jcapiv2/models/connectwise_company_resp.py new file mode 100644 index 0000000..747160c --- /dev/null +++ b/jcapiv2/jcapiv2/models/connectwise_company_resp.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectwiseCompanyResp(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'records': 'list[ConnectwiseCompany]', + 'total_count': 'int' + } + + attribute_map = { + 'records': 'records', + 'total_count': 'totalCount' + } + + def __init__(self, records=None, total_count=None): # noqa: E501 + """ConnectwiseCompanyResp - a model defined in Swagger""" # noqa: E501 + self._records = None + self._total_count = None + self.discriminator = None + self.records = records + self.total_count = total_count + + @property + def records(self): + """Gets the records of this ConnectwiseCompanyResp. # noqa: E501 + + + :return: The records of this ConnectwiseCompanyResp. # noqa: E501 + :rtype: list[ConnectwiseCompany] + """ + return self._records + + @records.setter + def records(self, records): + """Sets the records of this ConnectwiseCompanyResp. + + + :param records: The records of this ConnectwiseCompanyResp. # noqa: E501 + :type: list[ConnectwiseCompany] + """ + if records is None: + raise ValueError("Invalid value for `records`, must not be `None`") # noqa: E501 + + self._records = records + + @property + def total_count(self): + """Gets the total_count of this ConnectwiseCompanyResp. # noqa: E501 + + + :return: The total_count of this ConnectwiseCompanyResp. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this ConnectwiseCompanyResp. + + + :param total_count: The total_count of this ConnectwiseCompanyResp. # noqa: E501 + :type: int + """ + if total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectwiseCompanyResp, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectwiseCompanyResp): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connectwise_company_type_resp.py b/jcapiv2/jcapiv2/models/connectwise_company_type_resp.py new file mode 100644 index 0000000..1232604 --- /dev/null +++ b/jcapiv2/jcapiv2/models/connectwise_company_type_resp.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectwiseCompanyTypeResp(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'records': 'list[BillingIntegrationCompanyType]', + 'total_count': 'int' + } + + attribute_map = { + 'records': 'records', + 'total_count': 'totalCount' + } + + def __init__(self, records=None, total_count=None): # noqa: E501 + """ConnectwiseCompanyTypeResp - a model defined in Swagger""" # noqa: E501 + self._records = None + self._total_count = None + self.discriminator = None + self.records = records + self.total_count = total_count + + @property + def records(self): + """Gets the records of this ConnectwiseCompanyTypeResp. # noqa: E501 + + + :return: The records of this ConnectwiseCompanyTypeResp. # noqa: E501 + :rtype: list[BillingIntegrationCompanyType] + """ + return self._records + + @records.setter + def records(self, records): + """Sets the records of this ConnectwiseCompanyTypeResp. + + + :param records: The records of this ConnectwiseCompanyTypeResp. # noqa: E501 + :type: list[BillingIntegrationCompanyType] + """ + if records is None: + raise ValueError("Invalid value for `records`, must not be `None`") # noqa: E501 + + self._records = records + + @property + def total_count(self): + """Gets the total_count of this ConnectwiseCompanyTypeResp. # noqa: E501 + + + :return: The total_count of this ConnectwiseCompanyTypeResp. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this ConnectwiseCompanyTypeResp. + + + :param total_count: The total_count of this ConnectwiseCompanyTypeResp. # noqa: E501 + :type: int + """ + if total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectwiseCompanyTypeResp, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectwiseCompanyTypeResp): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connectwise_integration.py b/jcapiv2/jcapiv2/models/connectwise_integration.py new file mode 100644 index 0000000..90ed4d5 --- /dev/null +++ b/jcapiv2/jcapiv2/models/connectwise_integration.py @@ -0,0 +1,199 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectwiseIntegration(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'company_id': 'str', + 'id': 'str', + 'is_msp_auth_configured': 'bool', + 'url': 'str' + } + + attribute_map = { + 'company_id': 'companyId', + 'id': 'id', + 'is_msp_auth_configured': 'isMspAuthConfigured', + 'url': 'url' + } + + def __init__(self, company_id=None, id=None, is_msp_auth_configured=None, url=None): # noqa: E501 + """ConnectwiseIntegration - a model defined in Swagger""" # noqa: E501 + self._company_id = None + self._id = None + self._is_msp_auth_configured = None + self._url = None + self.discriminator = None + self.company_id = company_id + self.id = id + if is_msp_auth_configured is not None: + self.is_msp_auth_configured = is_msp_auth_configured + self.url = url + + @property + def company_id(self): + """Gets the company_id of this ConnectwiseIntegration. # noqa: E501 + + The ConnectWise company identifier. # noqa: E501 + + :return: The company_id of this ConnectwiseIntegration. # noqa: E501 + :rtype: str + """ + return self._company_id + + @company_id.setter + def company_id(self, company_id): + """Sets the company_id of this ConnectwiseIntegration. + + The ConnectWise company identifier. # noqa: E501 + + :param company_id: The company_id of this ConnectwiseIntegration. # noqa: E501 + :type: str + """ + if company_id is None: + raise ValueError("Invalid value for `company_id`, must not be `None`") # noqa: E501 + + self._company_id = company_id + + @property + def id(self): + """Gets the id of this ConnectwiseIntegration. # noqa: E501 + + The identifier for this ConnectWise integration. # noqa: E501 + + :return: The id of this ConnectwiseIntegration. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ConnectwiseIntegration. + + The identifier for this ConnectWise integration. # noqa: E501 + + :param id: The id of this ConnectwiseIntegration. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def is_msp_auth_configured(self): + """Gets the is_msp_auth_configured of this ConnectwiseIntegration. # noqa: E501 + + Has the msp-api been configured with auth data yet # noqa: E501 + + :return: The is_msp_auth_configured of this ConnectwiseIntegration. # noqa: E501 + :rtype: bool + """ + return self._is_msp_auth_configured + + @is_msp_auth_configured.setter + def is_msp_auth_configured(self, is_msp_auth_configured): + """Sets the is_msp_auth_configured of this ConnectwiseIntegration. + + Has the msp-api been configured with auth data yet # noqa: E501 + + :param is_msp_auth_configured: The is_msp_auth_configured of this ConnectwiseIntegration. # noqa: E501 + :type: bool + """ + + self._is_msp_auth_configured = is_msp_auth_configured + + @property + def url(self): + """Gets the url of this ConnectwiseIntegration. # noqa: E501 + + The base url for connecting to ConnectWise. # noqa: E501 + + :return: The url of this ConnectwiseIntegration. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this ConnectwiseIntegration. + + The base url for connecting to ConnectWise. # noqa: E501 + + :param url: The url of this ConnectwiseIntegration. # noqa: E501 + :type: str + """ + if url is None: + raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 + + self._url = url + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectwiseIntegration, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectwiseIntegration): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connectwise_integration_patch_req.py b/jcapiv2/jcapiv2/models/connectwise_integration_patch_req.py new file mode 100644 index 0000000..2b58aa7 --- /dev/null +++ b/jcapiv2/jcapiv2/models/connectwise_integration_patch_req.py @@ -0,0 +1,196 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectwiseIntegrationPatchReq(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'company_id': 'str', + 'private_key': 'str', + 'public_key': 'str', + 'url': 'str' + } + + attribute_map = { + 'company_id': 'companyId', + 'private_key': 'privateKey', + 'public_key': 'publicKey', + 'url': 'url' + } + + def __init__(self, company_id=None, private_key=None, public_key=None, url=None): # noqa: E501 + """ConnectwiseIntegrationPatchReq - a model defined in Swagger""" # noqa: E501 + self._company_id = None + self._private_key = None + self._public_key = None + self._url = None + self.discriminator = None + if company_id is not None: + self.company_id = company_id + if private_key is not None: + self.private_key = private_key + if public_key is not None: + self.public_key = public_key + if url is not None: + self.url = url + + @property + def company_id(self): + """Gets the company_id of this ConnectwiseIntegrationPatchReq. # noqa: E501 + + The ConnectWise company identifier. # noqa: E501 + + :return: The company_id of this ConnectwiseIntegrationPatchReq. # noqa: E501 + :rtype: str + """ + return self._company_id + + @company_id.setter + def company_id(self, company_id): + """Sets the company_id of this ConnectwiseIntegrationPatchReq. + + The ConnectWise company identifier. # noqa: E501 + + :param company_id: The company_id of this ConnectwiseIntegrationPatchReq. # noqa: E501 + :type: str + """ + + self._company_id = company_id + + @property + def private_key(self): + """Gets the private_key of this ConnectwiseIntegrationPatchReq. # noqa: E501 + + The ConnectWise private key for authentication # noqa: E501 + + :return: The private_key of this ConnectwiseIntegrationPatchReq. # noqa: E501 + :rtype: str + """ + return self._private_key + + @private_key.setter + def private_key(self, private_key): + """Sets the private_key of this ConnectwiseIntegrationPatchReq. + + The ConnectWise private key for authentication # noqa: E501 + + :param private_key: The private_key of this ConnectwiseIntegrationPatchReq. # noqa: E501 + :type: str + """ + + self._private_key = private_key + + @property + def public_key(self): + """Gets the public_key of this ConnectwiseIntegrationPatchReq. # noqa: E501 + + The ConnectWise public key for authentication. # noqa: E501 + + :return: The public_key of this ConnectwiseIntegrationPatchReq. # noqa: E501 + :rtype: str + """ + return self._public_key + + @public_key.setter + def public_key(self, public_key): + """Sets the public_key of this ConnectwiseIntegrationPatchReq. + + The ConnectWise public key for authentication. # noqa: E501 + + :param public_key: The public_key of this ConnectwiseIntegrationPatchReq. # noqa: E501 + :type: str + """ + + self._public_key = public_key + + @property + def url(self): + """Gets the url of this ConnectwiseIntegrationPatchReq. # noqa: E501 + + The base url for connecting to ConnectWise. # noqa: E501 + + :return: The url of this ConnectwiseIntegrationPatchReq. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this ConnectwiseIntegrationPatchReq. + + The base url for connecting to ConnectWise. # noqa: E501 + + :param url: The url of this ConnectwiseIntegrationPatchReq. # noqa: E501 + :type: str + """ + + self._url = url + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectwiseIntegrationPatchReq, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectwiseIntegrationPatchReq): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/connectwise_integration_req.py b/jcapiv2/jcapiv2/models/connectwise_integration_req.py new file mode 100644 index 0000000..d0bbe08 --- /dev/null +++ b/jcapiv2/jcapiv2/models/connectwise_integration_req.py @@ -0,0 +1,200 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ConnectwiseIntegrationReq(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'company_id': 'str', + 'private_key': 'str', + 'public_key': 'str', + 'url': 'str' + } + + attribute_map = { + 'company_id': 'companyId', + 'private_key': 'privateKey', + 'public_key': 'publicKey', + 'url': 'url' + } + + def __init__(self, company_id=None, private_key=None, public_key=None, url=None): # noqa: E501 + """ConnectwiseIntegrationReq - a model defined in Swagger""" # noqa: E501 + self._company_id = None + self._private_key = None + self._public_key = None + self._url = None + self.discriminator = None + self.company_id = company_id + self.private_key = private_key + self.public_key = public_key + self.url = url + + @property + def company_id(self): + """Gets the company_id of this ConnectwiseIntegrationReq. # noqa: E501 + + The ConnectWise company identifier. # noqa: E501 + + :return: The company_id of this ConnectwiseIntegrationReq. # noqa: E501 + :rtype: str + """ + return self._company_id + + @company_id.setter + def company_id(self, company_id): + """Sets the company_id of this ConnectwiseIntegrationReq. + + The ConnectWise company identifier. # noqa: E501 + + :param company_id: The company_id of this ConnectwiseIntegrationReq. # noqa: E501 + :type: str + """ + if company_id is None: + raise ValueError("Invalid value for `company_id`, must not be `None`") # noqa: E501 + + self._company_id = company_id + + @property + def private_key(self): + """Gets the private_key of this ConnectwiseIntegrationReq. # noqa: E501 + + The ConnectWise private key for authentication # noqa: E501 + + :return: The private_key of this ConnectwiseIntegrationReq. # noqa: E501 + :rtype: str + """ + return self._private_key + + @private_key.setter + def private_key(self, private_key): + """Sets the private_key of this ConnectwiseIntegrationReq. + + The ConnectWise private key for authentication # noqa: E501 + + :param private_key: The private_key of this ConnectwiseIntegrationReq. # noqa: E501 + :type: str + """ + if private_key is None: + raise ValueError("Invalid value for `private_key`, must not be `None`") # noqa: E501 + + self._private_key = private_key + + @property + def public_key(self): + """Gets the public_key of this ConnectwiseIntegrationReq. # noqa: E501 + + The ConnectWise public key for authentication. # noqa: E501 + + :return: The public_key of this ConnectwiseIntegrationReq. # noqa: E501 + :rtype: str + """ + return self._public_key + + @public_key.setter + def public_key(self, public_key): + """Sets the public_key of this ConnectwiseIntegrationReq. + + The ConnectWise public key for authentication. # noqa: E501 + + :param public_key: The public_key of this ConnectwiseIntegrationReq. # noqa: E501 + :type: str + """ + if public_key is None: + raise ValueError("Invalid value for `public_key`, must not be `None`") # noqa: E501 + + self._public_key = public_key + + @property + def url(self): + """Gets the url of this ConnectwiseIntegrationReq. # noqa: E501 + + The base url for connecting to ConnectWise. # noqa: E501 + + :return: The url of this ConnectwiseIntegrationReq. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this ConnectwiseIntegrationReq. + + The base url for connecting to ConnectWise. # noqa: E501 + + :param url: The url of this ConnectwiseIntegrationReq. # noqa: E501 + :type: str + """ + if url is None: + raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 + + self._url = url + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ConnectwiseIntegrationReq, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConnectwiseIntegrationReq): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/custom_email.py b/jcapiv2/jcapiv2/models/custom_email.py new file mode 100644 index 0000000..e527c3f --- /dev/null +++ b/jcapiv2/jcapiv2/models/custom_email.py @@ -0,0 +1,294 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class CustomEmail(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'body': 'str', + 'button': 'str', + 'header': 'str', + 'id': 'str', + 'next_step_contact_info': 'str', + 'subject': 'str', + 'title': 'str', + 'type': 'CustomEmailType' + } + + attribute_map = { + 'body': 'body', + 'button': 'button', + 'header': 'header', + 'id': 'id', + 'next_step_contact_info': 'nextStepContactInfo', + 'subject': 'subject', + 'title': 'title', + 'type': 'type' + } + + def __init__(self, body=None, button=None, header=None, id=None, next_step_contact_info=None, subject=None, title=None, type=None): # noqa: E501 + """CustomEmail - a model defined in Swagger""" # noqa: E501 + self._body = None + self._button = None + self._header = None + self._id = None + self._next_step_contact_info = None + self._subject = None + self._title = None + self._type = None + self.discriminator = None + if body is not None: + self.body = body + if button is not None: + self.button = button + if header is not None: + self.header = header + if id is not None: + self.id = id + if next_step_contact_info is not None: + self.next_step_contact_info = next_step_contact_info + self.subject = subject + if title is not None: + self.title = title + self.type = type + + @property + def body(self): + """Gets the body of this CustomEmail. # noqa: E501 + + + :return: The body of this CustomEmail. # noqa: E501 + :rtype: str + """ + return self._body + + @body.setter + def body(self, body): + """Sets the body of this CustomEmail. + + + :param body: The body of this CustomEmail. # noqa: E501 + :type: str + """ + + self._body = body + + @property + def button(self): + """Gets the button of this CustomEmail. # noqa: E501 + + + :return: The button of this CustomEmail. # noqa: E501 + :rtype: str + """ + return self._button + + @button.setter + def button(self, button): + """Sets the button of this CustomEmail. + + + :param button: The button of this CustomEmail. # noqa: E501 + :type: str + """ + + self._button = button + + @property + def header(self): + """Gets the header of this CustomEmail. # noqa: E501 + + + :return: The header of this CustomEmail. # noqa: E501 + :rtype: str + """ + return self._header + + @header.setter + def header(self, header): + """Sets the header of this CustomEmail. + + + :param header: The header of this CustomEmail. # noqa: E501 + :type: str + """ + + self._header = header + + @property + def id(self): + """Gets the id of this CustomEmail. # noqa: E501 + + + :return: The id of this CustomEmail. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CustomEmail. + + + :param id: The id of this CustomEmail. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def next_step_contact_info(self): + """Gets the next_step_contact_info of this CustomEmail. # noqa: E501 + + + :return: The next_step_contact_info of this CustomEmail. # noqa: E501 + :rtype: str + """ + return self._next_step_contact_info + + @next_step_contact_info.setter + def next_step_contact_info(self, next_step_contact_info): + """Sets the next_step_contact_info of this CustomEmail. + + + :param next_step_contact_info: The next_step_contact_info of this CustomEmail. # noqa: E501 + :type: str + """ + + self._next_step_contact_info = next_step_contact_info + + @property + def subject(self): + """Gets the subject of this CustomEmail. # noqa: E501 + + + :return: The subject of this CustomEmail. # noqa: E501 + :rtype: str + """ + return self._subject + + @subject.setter + def subject(self, subject): + """Sets the subject of this CustomEmail. + + + :param subject: The subject of this CustomEmail. # noqa: E501 + :type: str + """ + if subject is None: + raise ValueError("Invalid value for `subject`, must not be `None`") # noqa: E501 + + self._subject = subject + + @property + def title(self): + """Gets the title of this CustomEmail. # noqa: E501 + + + :return: The title of this CustomEmail. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this CustomEmail. + + + :param title: The title of this CustomEmail. # noqa: E501 + :type: str + """ + + self._title = title + + @property + def type(self): + """Gets the type of this CustomEmail. # noqa: E501 + + + :return: The type of this CustomEmail. # noqa: E501 + :rtype: CustomEmailType + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this CustomEmail. + + + :param type: The type of this CustomEmail. # noqa: E501 + :type: CustomEmailType + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CustomEmail, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CustomEmail): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/custom_email_template.py b/jcapiv2/jcapiv2/models/custom_email_template.py new file mode 100644 index 0000000..c54fda4 --- /dev/null +++ b/jcapiv2/jcapiv2/models/custom_email_template.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class CustomEmailTemplate(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'description': 'str', + 'display_name': 'str', + 'fields': 'list[CustomEmailTemplateField]', + 'type': 'CustomEmailType' + } + + attribute_map = { + 'description': 'description', + 'display_name': 'displayName', + 'fields': 'fields', + 'type': 'type' + } + + def __init__(self, description=None, display_name=None, fields=None, type=None): # noqa: E501 + """CustomEmailTemplate - a model defined in Swagger""" # noqa: E501 + self._description = None + self._display_name = None + self._fields = None + self._type = None + self.discriminator = None + if description is not None: + self.description = description + if display_name is not None: + self.display_name = display_name + if fields is not None: + self.fields = fields + if type is not None: + self.type = type + + @property + def description(self): + """Gets the description of this CustomEmailTemplate. # noqa: E501 + + + :return: The description of this CustomEmailTemplate. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this CustomEmailTemplate. + + + :param description: The description of this CustomEmailTemplate. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def display_name(self): + """Gets the display_name of this CustomEmailTemplate. # noqa: E501 + + + :return: The display_name of this CustomEmailTemplate. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this CustomEmailTemplate. + + + :param display_name: The display_name of this CustomEmailTemplate. # noqa: E501 + :type: str + """ + + self._display_name = display_name + + @property + def fields(self): + """Gets the fields of this CustomEmailTemplate. # noqa: E501 + + + :return: The fields of this CustomEmailTemplate. # noqa: E501 + :rtype: list[CustomEmailTemplateField] + """ + return self._fields + + @fields.setter + def fields(self, fields): + """Sets the fields of this CustomEmailTemplate. + + + :param fields: The fields of this CustomEmailTemplate. # noqa: E501 + :type: list[CustomEmailTemplateField] + """ + + self._fields = fields + + @property + def type(self): + """Gets the type of this CustomEmailTemplate. # noqa: E501 + + + :return: The type of this CustomEmailTemplate. # noqa: E501 + :rtype: CustomEmailType + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this CustomEmailTemplate. + + + :param type: The type of this CustomEmailTemplate. # noqa: E501 + :type: CustomEmailType + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CustomEmailTemplate, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CustomEmailTemplate): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/custom_email_template_field.py b/jcapiv2/jcapiv2/models/custom_email_template_field.py new file mode 100644 index 0000000..007650c --- /dev/null +++ b/jcapiv2/jcapiv2/models/custom_email_template_field.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class CustomEmailTemplateField(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'default_value': 'str', + 'display_name': 'str', + 'field': 'str', + 'multiline': 'bool' + } + + attribute_map = { + 'default_value': 'defaultValue', + 'display_name': 'displayName', + 'field': 'field', + 'multiline': 'multiline' + } + + def __init__(self, default_value=None, display_name=None, field=None, multiline=None): # noqa: E501 + """CustomEmailTemplateField - a model defined in Swagger""" # noqa: E501 + self._default_value = None + self._display_name = None + self._field = None + self._multiline = None + self.discriminator = None + if default_value is not None: + self.default_value = default_value + if display_name is not None: + self.display_name = display_name + if field is not None: + self.field = field + if multiline is not None: + self.multiline = multiline + + @property + def default_value(self): + """Gets the default_value of this CustomEmailTemplateField. # noqa: E501 + + + :return: The default_value of this CustomEmailTemplateField. # noqa: E501 + :rtype: str + """ + return self._default_value + + @default_value.setter + def default_value(self, default_value): + """Sets the default_value of this CustomEmailTemplateField. + + + :param default_value: The default_value of this CustomEmailTemplateField. # noqa: E501 + :type: str + """ + + self._default_value = default_value + + @property + def display_name(self): + """Gets the display_name of this CustomEmailTemplateField. # noqa: E501 + + + :return: The display_name of this CustomEmailTemplateField. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this CustomEmailTemplateField. + + + :param display_name: The display_name of this CustomEmailTemplateField. # noqa: E501 + :type: str + """ + + self._display_name = display_name + + @property + def field(self): + """Gets the field of this CustomEmailTemplateField. # noqa: E501 + + + :return: The field of this CustomEmailTemplateField. # noqa: E501 + :rtype: str + """ + return self._field + + @field.setter + def field(self, field): + """Sets the field of this CustomEmailTemplateField. + + + :param field: The field of this CustomEmailTemplateField. # noqa: E501 + :type: str + """ + + self._field = field + + @property + def multiline(self): + """Gets the multiline of this CustomEmailTemplateField. # noqa: E501 + + + :return: The multiline of this CustomEmailTemplateField. # noqa: E501 + :rtype: bool + """ + return self._multiline + + @multiline.setter + def multiline(self, multiline): + """Sets the multiline of this CustomEmailTemplateField. + + + :param multiline: The multiline of this CustomEmailTemplateField. # noqa: E501 + :type: bool + """ + + self._multiline = multiline + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CustomEmailTemplateField, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CustomEmailTemplateField): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/custom_email_type.py b/jcapiv2/jcapiv2/models/custom_email_type.py new file mode 100644 index 0000000..6d54624 --- /dev/null +++ b/jcapiv2/jcapiv2/models/custom_email_type.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class CustomEmailType(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + ACTIVATE_GAPPS_USER = "activate_gapps_user" + ACTIVATE_O365_USER = "activate_o365_user" + LOCKOUT_NOTICE_USER = "lockout_notice_user" + PASSWORD_EXPIRATION = "password_expiration" + PASSWORD_EXPIRATION_WARNING = "password_expiration_warning" + PASSWORD_RESET_CONFIRMATION = "password_reset_confirmation" + USER_CHANGE_PASSWORD = "user_change_password" + ACTIVATE_USER_CUSTOM = "activate_user_custom" + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """CustomEmailType - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CustomEmailType, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CustomEmailType): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/dep.py b/jcapiv2/jcapiv2/models/dep.py new file mode 100644 index 0000000..38ab284 --- /dev/null +++ b/jcapiv2/jcapiv2/models/dep.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DEP(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'enable_zero_touch_enrollment': 'bool', + 'setup_assistant_options': 'list[DEPSetupAssistantOption]', + 'welcome_screen': 'DEPWelcomeScreen' + } + + attribute_map = { + 'enable_zero_touch_enrollment': 'enableZeroTouchEnrollment', + 'setup_assistant_options': 'setupAssistantOptions', + 'welcome_screen': 'welcomeScreen' + } + + def __init__(self, enable_zero_touch_enrollment=None, setup_assistant_options=None, welcome_screen=None): # noqa: E501 + """DEP - a model defined in Swagger""" # noqa: E501 + self._enable_zero_touch_enrollment = None + self._setup_assistant_options = None + self._welcome_screen = None + self.discriminator = None + if enable_zero_touch_enrollment is not None: + self.enable_zero_touch_enrollment = enable_zero_touch_enrollment + if setup_assistant_options is not None: + self.setup_assistant_options = setup_assistant_options + if welcome_screen is not None: + self.welcome_screen = welcome_screen + + @property + def enable_zero_touch_enrollment(self): + """Gets the enable_zero_touch_enrollment of this DEP. # noqa: E501 + + A toggle to determine if DEP registered devices should go through JumpCloud Zero Touch Enrollment. # noqa: E501 + + :return: The enable_zero_touch_enrollment of this DEP. # noqa: E501 + :rtype: bool + """ + return self._enable_zero_touch_enrollment + + @enable_zero_touch_enrollment.setter + def enable_zero_touch_enrollment(self, enable_zero_touch_enrollment): + """Sets the enable_zero_touch_enrollment of this DEP. + + A toggle to determine if DEP registered devices should go through JumpCloud Zero Touch Enrollment. # noqa: E501 + + :param enable_zero_touch_enrollment: The enable_zero_touch_enrollment of this DEP. # noqa: E501 + :type: bool + """ + + self._enable_zero_touch_enrollment = enable_zero_touch_enrollment + + @property + def setup_assistant_options(self): + """Gets the setup_assistant_options of this DEP. # noqa: E501 + + + :return: The setup_assistant_options of this DEP. # noqa: E501 + :rtype: list[DEPSetupAssistantOption] + """ + return self._setup_assistant_options + + @setup_assistant_options.setter + def setup_assistant_options(self, setup_assistant_options): + """Sets the setup_assistant_options of this DEP. + + + :param setup_assistant_options: The setup_assistant_options of this DEP. # noqa: E501 + :type: list[DEPSetupAssistantOption] + """ + + self._setup_assistant_options = setup_assistant_options + + @property + def welcome_screen(self): + """Gets the welcome_screen of this DEP. # noqa: E501 + + + :return: The welcome_screen of this DEP. # noqa: E501 + :rtype: DEPWelcomeScreen + """ + return self._welcome_screen + + @welcome_screen.setter + def welcome_screen(self, welcome_screen): + """Sets the welcome_screen of this DEP. + + + :param welcome_screen: The welcome_screen of this DEP. # noqa: E501 + :type: DEPWelcomeScreen + """ + + self._welcome_screen = welcome_screen + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DEP, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DEP): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/dep_setup_assistant_option.py b/jcapiv2/jcapiv2/models/dep_setup_assistant_option.py new file mode 100644 index 0000000..80d4b1f --- /dev/null +++ b/jcapiv2/jcapiv2/models/dep_setup_assistant_option.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DEPSetupAssistantOption(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'option': 'SetupAssistantOption' + } + + attribute_map = { + 'option': 'option' + } + + def __init__(self, option=None): # noqa: E501 + """DEPSetupAssistantOption - a model defined in Swagger""" # noqa: E501 + self._option = None + self.discriminator = None + if option is not None: + self.option = option + + @property + def option(self): + """Gets the option of this DEPSetupAssistantOption. # noqa: E501 + + + :return: The option of this DEPSetupAssistantOption. # noqa: E501 + :rtype: SetupAssistantOption + """ + return self._option + + @option.setter + def option(self, option): + """Sets the option of this DEPSetupAssistantOption. + + + :param option: The option of this DEPSetupAssistantOption. # noqa: E501 + :type: SetupAssistantOption + """ + + self._option = option + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DEPSetupAssistantOption, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DEPSetupAssistantOption): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/dep_welcome_screen.py b/jcapiv2/jcapiv2/models/dep_welcome_screen.py new file mode 100644 index 0000000..2b143b3 --- /dev/null +++ b/jcapiv2/jcapiv2/models/dep_welcome_screen.py @@ -0,0 +1,168 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DEPWelcomeScreen(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'button': 'str', + 'paragraph': 'str', + 'title': 'str' + } + + attribute_map = { + 'button': 'button', + 'paragraph': 'paragraph', + 'title': 'title' + } + + def __init__(self, button=None, paragraph=None, title=None): # noqa: E501 + """DEPWelcomeScreen - a model defined in Swagger""" # noqa: E501 + self._button = None + self._paragraph = None + self._title = None + self.discriminator = None + if button is not None: + self.button = button + if paragraph is not None: + self.paragraph = paragraph + if title is not None: + self.title = title + + @property + def button(self): + """Gets the button of this DEPWelcomeScreen. # noqa: E501 + + Text to display on the button on the DEP Welcome Screen. # noqa: E501 + + :return: The button of this DEPWelcomeScreen. # noqa: E501 + :rtype: str + """ + return self._button + + @button.setter + def button(self, button): + """Sets the button of this DEPWelcomeScreen. + + Text to display on the button on the DEP Welcome Screen. # noqa: E501 + + :param button: The button of this DEPWelcomeScreen. # noqa: E501 + :type: str + """ + + self._button = button + + @property + def paragraph(self): + """Gets the paragraph of this DEPWelcomeScreen. # noqa: E501 + + A message to display on the DEP Welcome Screen. # noqa: E501 + + :return: The paragraph of this DEPWelcomeScreen. # noqa: E501 + :rtype: str + """ + return self._paragraph + + @paragraph.setter + def paragraph(self, paragraph): + """Sets the paragraph of this DEPWelcomeScreen. + + A message to display on the DEP Welcome Screen. # noqa: E501 + + :param paragraph: The paragraph of this DEPWelcomeScreen. # noqa: E501 + :type: str + """ + + self._paragraph = paragraph + + @property + def title(self): + """Gets the title of this DEPWelcomeScreen. # noqa: E501 + + The title to display on the DEP Welcome Screen. # noqa: E501 + + :return: The title of this DEPWelcomeScreen. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this DEPWelcomeScreen. + + The title to display on the DEP Welcome Screen. # noqa: E501 + + :param title: The title of this DEPWelcomeScreen. # noqa: E501 + :type: str + """ + + self._title = title + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DEPWelcomeScreen, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DEPWelcomeScreen): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/device_id_erase_body.py b/jcapiv2/jcapiv2/models/device_id_erase_body.py new file mode 100644 index 0000000..34f6cfe --- /dev/null +++ b/jcapiv2/jcapiv2/models/device_id_erase_body.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DeviceIdEraseBody(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'pin': 'str' + } + + attribute_map = { + 'pin': 'pin' + } + + def __init__(self, pin=None): # noqa: E501 + """DeviceIdEraseBody - a model defined in Swagger""" # noqa: E501 + self._pin = None + self.discriminator = None + if pin is not None: + self.pin = pin + + @property + def pin(self): + """Gets the pin of this DeviceIdEraseBody. # noqa: E501 + + 6-digit PIN, required for MacOS, to erase the device # noqa: E501 + + :return: The pin of this DeviceIdEraseBody. # noqa: E501 + :rtype: str + """ + return self._pin + + @pin.setter + def pin(self, pin): + """Sets the pin of this DeviceIdEraseBody. + + 6-digit PIN, required for MacOS, to erase the device # noqa: E501 + + :param pin: The pin of this DeviceIdEraseBody. # noqa: E501 + :type: str + """ + + self._pin = pin + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DeviceIdEraseBody, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeviceIdEraseBody): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/device_id_lock_body.py b/jcapiv2/jcapiv2/models/device_id_lock_body.py new file mode 100644 index 0000000..f515689 --- /dev/null +++ b/jcapiv2/jcapiv2/models/device_id_lock_body.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DeviceIdLockBody(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'pin': 'str' + } + + attribute_map = { + 'pin': 'pin' + } + + def __init__(self, pin=None): # noqa: E501 + """DeviceIdLockBody - a model defined in Swagger""" # noqa: E501 + self._pin = None + self.discriminator = None + if pin is not None: + self.pin = pin + + @property + def pin(self): + """Gets the pin of this DeviceIdLockBody. # noqa: E501 + + 6-digit PIN, required for MacOS, to lock the device # noqa: E501 + + :return: The pin of this DeviceIdLockBody. # noqa: E501 + :rtype: str + """ + return self._pin + + @pin.setter + def pin(self, pin): + """Sets the pin of this DeviceIdLockBody. + + 6-digit PIN, required for MacOS, to lock the device # noqa: E501 + + :param pin: The pin of this DeviceIdLockBody. # noqa: E501 + :type: str + """ + + self._pin = pin + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DeviceIdLockBody, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeviceIdLockBody): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/device_id_restart_body.py b/jcapiv2/jcapiv2/models/device_id_restart_body.py new file mode 100644 index 0000000..cba613f --- /dev/null +++ b/jcapiv2/jcapiv2/models/device_id_restart_body.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DeviceIdRestartBody(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'kext_paths': 'list[str]' + } + + attribute_map = { + 'kext_paths': 'kextPaths' + } + + def __init__(self, kext_paths=None): # noqa: E501 + """DeviceIdRestartBody - a model defined in Swagger""" # noqa: E501 + self._kext_paths = None + self.discriminator = None + if kext_paths is not None: + self.kext_paths = kext_paths + + @property + def kext_paths(self): + """Gets the kext_paths of this DeviceIdRestartBody. # noqa: E501 + + The string to pass when doing a restart and performing a RebuildKernelCache. # noqa: E501 + + :return: The kext_paths of this DeviceIdRestartBody. # noqa: E501 + :rtype: list[str] + """ + return self._kext_paths + + @kext_paths.setter + def kext_paths(self, kext_paths): + """Sets the kext_paths of this DeviceIdRestartBody. + + The string to pass when doing a restart and performing a RebuildKernelCache. # noqa: E501 + + :param kext_paths: The kext_paths of this DeviceIdRestartBody. # noqa: E501 + :type: list[str] + """ + + self._kext_paths = kext_paths + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DeviceIdRestartBody, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DeviceIdRestartBody): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/directory.py b/jcapiv2/jcapiv2/models/directory.py index bf8407a..d78274b 100644 --- a/jcapiv2/jcapiv2/models/directory.py +++ b/jcapiv2/jcapiv2/models/directory.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class Directory(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,25 +30,28 @@ class Directory(object): swagger_types = { 'id': 'str', 'name': 'str', + 'o_auth_status': 'object', 'type': 'str' } attribute_map = { 'id': 'id', 'name': 'name', + 'o_auth_status': 'oAuthStatus', 'type': 'type' } - def __init__(self, id=None, name=None, type=None): # noqa: E501 + def __init__(self, id=None, name=None, o_auth_status=None, type=None): # noqa: E501 """Directory - a model defined in Swagger""" # noqa: E501 - self._id = None self._name = None + self._o_auth_status = None self._type = None self.discriminator = None - self.id = id self.name = name + if o_auth_status is not None: + self.o_auth_status = o_auth_status self.type = type @property @@ -104,6 +104,29 @@ def name(self, name): self._name = name + @property + def o_auth_status(self): + """Gets the o_auth_status of this Directory. # noqa: E501 + + the expiry and error status of the bearer token # noqa: E501 + + :return: The o_auth_status of this Directory. # noqa: E501 + :rtype: object + """ + return self._o_auth_status + + @o_auth_status.setter + def o_auth_status(self, o_auth_status): + """Sets the o_auth_status of this Directory. + + the expiry and error status of the bearer token # noqa: E501 + + :param o_auth_status: The o_auth_status of this Directory. # noqa: E501 + :type: object + """ + + self._o_auth_status = o_auth_status + @property def type(self): """Gets the type of this Directory. # noqa: E501 diff --git a/jcapiv2/jcapiv2/models/duo_account.py b/jcapiv2/jcapiv2/models/duo_account.py index 927ebcd..6dd6727 100644 --- a/jcapiv2/jcapiv2/models/duo_account.py +++ b/jcapiv2/jcapiv2/models/duo_account.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class DuoAccount(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,11 +39,9 @@ class DuoAccount(object): def __init__(self, id=None, name=None): # noqa: E501 """DuoAccount - a model defined in Swagger""" # noqa: E501 - self._id = None self._name = None self.discriminator = None - self.id = id if name is not None: self.name = name diff --git a/jcapiv2/jcapiv2/models/duo_application.py b/jcapiv2/jcapiv2/models/duo_application.py index 77b56ab..818dadd 100644 --- a/jcapiv2/jcapiv2/models/duo_application.py +++ b/jcapiv2/jcapiv2/models/duo_application.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class DuoApplication(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -46,13 +43,11 @@ class DuoApplication(object): def __init__(self, api_host=None, id=None, integration_key=None, name=None): # noqa: E501 """DuoApplication - a model defined in Swagger""" # noqa: E501 - self._api_host = None self._id = None self._integration_key = None self._name = None self.discriminator = None - self.api_host = api_host self.id = id self.integration_key = integration_key diff --git a/jcapiv2/jcapiv2/models/duo_application_req.py b/jcapiv2/jcapiv2/models/duo_application_req.py index 4044e5f..a1f5d74 100644 --- a/jcapiv2/jcapiv2/models/duo_application_req.py +++ b/jcapiv2/jcapiv2/models/duo_application_req.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class DuoApplicationReq(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -46,13 +43,11 @@ class DuoApplicationReq(object): def __init__(self, api_host=None, integration_key=None, name=None, secret_key=None): # noqa: E501 """DuoApplicationReq - a model defined in Swagger""" # noqa: E501 - self._api_host = None self._integration_key = None self._name = None self._secret_key = None self.discriminator = None - self.api_host = api_host self.integration_key = integration_key self.name = name diff --git a/jcapiv2/jcapiv2/models/duo_application_update_req.py b/jcapiv2/jcapiv2/models/duo_application_update_req.py index 4ad0ea1..980390e 100644 --- a/jcapiv2/jcapiv2/models/duo_application_update_req.py +++ b/jcapiv2/jcapiv2/models/duo_application_update_req.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class DuoApplicationUpdateReq(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -46,19 +43,14 @@ class DuoApplicationUpdateReq(object): def __init__(self, api_host=None, integration_key=None, name=None, secret_key=None): # noqa: E501 """DuoApplicationUpdateReq - a model defined in Swagger""" # noqa: E501 - self._api_host = None self._integration_key = None self._name = None self._secret_key = None self.discriminator = None - - if api_host is not None: - self.api_host = api_host - if integration_key is not None: - self.integration_key = integration_key - if name is not None: - self.name = name + self.api_host = api_host + self.integration_key = integration_key + self.name = name if secret_key is not None: self.secret_key = secret_key @@ -80,6 +72,8 @@ def api_host(self, api_host): :param api_host: The api_host of this DuoApplicationUpdateReq. # noqa: E501 :type: str """ + if api_host is None: + raise ValueError("Invalid value for `api_host`, must not be `None`") # noqa: E501 self._api_host = api_host @@ -101,6 +95,8 @@ def integration_key(self, integration_key): :param integration_key: The integration_key of this DuoApplicationUpdateReq. # noqa: E501 :type: str """ + if integration_key is None: + raise ValueError("Invalid value for `integration_key`, must not be `None`") # noqa: E501 self._integration_key = integration_key @@ -122,6 +118,8 @@ def name(self, name): :param name: The name of this DuoApplicationUpdateReq. # noqa: E501 :type: str """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name diff --git a/jcapiv2/jcapiv2/models/duo_registration_application.py b/jcapiv2/jcapiv2/models/duo_registration_application.py deleted file mode 100644 index 3700032..0000000 --- a/jcapiv2/jcapiv2/models/duo_registration_application.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class DuoRegistrationApplication(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'api_host': 'str', - 'integration_key': 'str', - 'secret_key': 'str' - } - - attribute_map = { - 'api_host': 'apiHost', - 'integration_key': 'integrationKey', - 'secret_key': 'secretKey' - } - - def __init__(self, api_host=None, integration_key=None, secret_key=None): # noqa: E501 - """DuoRegistrationApplication - a model defined in Swagger""" # noqa: E501 - - self._api_host = None - self._integration_key = None - self._secret_key = None - self.discriminator = None - - self.api_host = api_host - self.integration_key = integration_key - self.secret_key = secret_key - - @property - def api_host(self): - """Gets the api_host of this DuoRegistrationApplication. # noqa: E501 - - Duo Application host name. # noqa: E501 - - :return: The api_host of this DuoRegistrationApplication. # noqa: E501 - :rtype: str - """ - return self._api_host - - @api_host.setter - def api_host(self, api_host): - """Sets the api_host of this DuoRegistrationApplication. - - Duo Application host name. # noqa: E501 - - :param api_host: The api_host of this DuoRegistrationApplication. # noqa: E501 - :type: str - """ - if api_host is None: - raise ValueError("Invalid value for `api_host`, must not be `None`") # noqa: E501 - - self._api_host = api_host - - @property - def integration_key(self): - """Gets the integration_key of this DuoRegistrationApplication. # noqa: E501 - - Duo Application integration key. # noqa: E501 - - :return: The integration_key of this DuoRegistrationApplication. # noqa: E501 - :rtype: str - """ - return self._integration_key - - @integration_key.setter - def integration_key(self, integration_key): - """Sets the integration_key of this DuoRegistrationApplication. - - Duo Application integration key. # noqa: E501 - - :param integration_key: The integration_key of this DuoRegistrationApplication. # noqa: E501 - :type: str - """ - if integration_key is None: - raise ValueError("Invalid value for `integration_key`, must not be `None`") # noqa: E501 - - self._integration_key = integration_key - - @property - def secret_key(self): - """Gets the secret_key of this DuoRegistrationApplication. # noqa: E501 - - Duo Application secret key. # noqa: E501 - - :return: The secret_key of this DuoRegistrationApplication. # noqa: E501 - :rtype: str - """ - return self._secret_key - - @secret_key.setter - def secret_key(self, secret_key): - """Sets the secret_key of this DuoRegistrationApplication. - - Duo Application secret key. # noqa: E501 - - :param secret_key: The secret_key of this DuoRegistrationApplication. # noqa: E501 - :type: str - """ - if secret_key is None: - raise ValueError("Invalid value for `secret_key`, must not be `None`") # noqa: E501 - - self._secret_key = secret_key - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(DuoRegistrationApplication, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DuoRegistrationApplication): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/duo_registration_application_req.py b/jcapiv2/jcapiv2/models/duo_registration_application_req.py deleted file mode 100644 index 5b7c1bd..0000000 --- a/jcapiv2/jcapiv2/models/duo_registration_application_req.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - -from jcapiv2.models.duo_registration_application import DuoRegistrationApplication # noqa: F401,E501 - - -class DuoRegistrationApplicationReq(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'registration_application': 'DuoRegistrationApplication' - } - - attribute_map = { - 'registration_application': 'registrationApplication' - } - - def __init__(self, registration_application=None): # noqa: E501 - """DuoRegistrationApplicationReq - a model defined in Swagger""" # noqa: E501 - - self._registration_application = None - self.discriminator = None - - self.registration_application = registration_application - - @property - def registration_application(self): - """Gets the registration_application of this DuoRegistrationApplicationReq. # noqa: E501 - - - :return: The registration_application of this DuoRegistrationApplicationReq. # noqa: E501 - :rtype: DuoRegistrationApplication - """ - return self._registration_application - - @registration_application.setter - def registration_application(self, registration_application): - """Sets the registration_application of this DuoRegistrationApplicationReq. - - - :param registration_application: The registration_application of this DuoRegistrationApplicationReq. # noqa: E501 - :type: DuoRegistrationApplication - """ - if registration_application is None: - raise ValueError("Invalid value for `registration_application`, must not be `None`") # noqa: E501 - - self._registration_application = registration_application - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(DuoRegistrationApplicationReq, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DuoRegistrationApplicationReq): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/emailrequest.py b/jcapiv2/jcapiv2/models/emailrequest.py deleted file mode 100644 index c6ed762..0000000 --- a/jcapiv2/jcapiv2/models/emailrequest.py +++ /dev/null @@ -1,121 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Emailrequest(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'email_type': 'str' - } - - attribute_map = { - 'email_type': 'emailType' - } - - def __init__(self, email_type=None): # noqa: E501 - """Emailrequest - a model defined in Swagger""" # noqa: E501 - - self._email_type = None - self.discriminator = None - - if email_type is not None: - self.email_type = email_type - - @property - def email_type(self): - """Gets the email_type of this Emailrequest. # noqa: E501 - - - :return: The email_type of this Emailrequest. # noqa: E501 - :rtype: str - """ - return self._email_type - - @email_type.setter - def email_type(self, email_type): - """Sets the email_type of this Emailrequest. - - - :param email_type: The email_type of this Emailrequest. # noqa: E501 - :type: str - """ - allowed_values = ["activation"] # noqa: E501 - if email_type not in allowed_values: - raise ValueError( - "Invalid value for `email_type` ({0}), must be one of {1}" # noqa: E501 - .format(email_type, allowed_values) - ) - - self._email_type = email_type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Emailrequest, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Emailrequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/enrollment_profile.py b/jcapiv2/jcapiv2/models/enrollment_profile.py deleted file mode 100644 index f3980bf..0000000 --- a/jcapiv2/jcapiv2/models/enrollment_profile.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class EnrollmentProfile(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'apple_mdm_id': 'str', - 'id': 'str' - } - - attribute_map = { - 'apple_mdm_id': 'appleMdmId', - 'id': 'id' - } - - def __init__(self, apple_mdm_id=None, id=None): # noqa: E501 - """EnrollmentProfile - a model defined in Swagger""" # noqa: E501 - - self._apple_mdm_id = None - self._id = None - self.discriminator = None - - if apple_mdm_id is not None: - self.apple_mdm_id = apple_mdm_id - if id is not None: - self.id = id - - @property - def apple_mdm_id(self): - """Gets the apple_mdm_id of this EnrollmentProfile. # noqa: E501 - - - :return: The apple_mdm_id of this EnrollmentProfile. # noqa: E501 - :rtype: str - """ - return self._apple_mdm_id - - @apple_mdm_id.setter - def apple_mdm_id(self, apple_mdm_id): - """Sets the apple_mdm_id of this EnrollmentProfile. - - - :param apple_mdm_id: The apple_mdm_id of this EnrollmentProfile. # noqa: E501 - :type: str - """ - - self._apple_mdm_id = apple_mdm_id - - @property - def id(self): - """Gets the id of this EnrollmentProfile. # noqa: E501 - - - :return: The id of this EnrollmentProfile. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this EnrollmentProfile. - - - :param id: The id of this EnrollmentProfile. # noqa: E501 - :type: str - """ - - self._id = id - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(EnrollmentProfile, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, EnrollmentProfile): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/error.py b/jcapiv2/jcapiv2/models/error.py index 35585ef..a6ead28 100644 --- a/jcapiv2/jcapiv2/models/error.py +++ b/jcapiv2/jcapiv2/models/error.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class Error(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -32,35 +29,34 @@ class Error(object): """ swagger_types = { 'code': 'int', - 'fields': 'str', - 'message': 'str' + 'message': 'str', + 'status': 'str' } attribute_map = { 'code': 'code', - 'fields': 'fields', - 'message': 'message' + 'message': 'message', + 'status': 'status' } - def __init__(self, code=None, fields=None, message=None): # noqa: E501 + def __init__(self, code=None, message=None, status=None): # noqa: E501 """Error - a model defined in Swagger""" # noqa: E501 - self._code = None - self._fields = None self._message = None + self._status = None self.discriminator = None - if code is not None: self.code = code - if fields is not None: - self.fields = fields if message is not None: self.message = message + if status is not None: + self.status = status @property def code(self): """Gets the code of this Error. # noqa: E501 + HTTP status code # noqa: E501 :return: The code of this Error. # noqa: E501 :rtype: int @@ -71,6 +67,7 @@ def code(self): def code(self, code): """Sets the code of this Error. + HTTP status code # noqa: E501 :param code: The code of this Error. # noqa: E501 :type: int @@ -79,46 +76,50 @@ def code(self, code): self._code = code @property - def fields(self): - """Gets the fields of this Error. # noqa: E501 + def message(self): + """Gets the message of this Error. # noqa: E501 + Error message # noqa: E501 - :return: The fields of this Error. # noqa: E501 + :return: The message of this Error. # noqa: E501 :rtype: str """ - return self._fields + return self._message - @fields.setter - def fields(self, fields): - """Sets the fields of this Error. + @message.setter + def message(self, message): + """Sets the message of this Error. + Error message # noqa: E501 - :param fields: The fields of this Error. # noqa: E501 + :param message: The message of this Error. # noqa: E501 :type: str """ - self._fields = fields + self._message = message @property - def message(self): - """Gets the message of this Error. # noqa: E501 + def status(self): + """Gets the status of this Error. # noqa: E501 + HTTP status description # noqa: E501 - :return: The message of this Error. # noqa: E501 + :return: The status of this Error. # noqa: E501 :rtype: str """ - return self._message + return self._status - @message.setter - def message(self, message): - """Sets the message of this Error. + @status.setter + def status(self, status): + """Sets the status of this Error. + HTTP status description # noqa: E501 - :param message: The message of this Error. # noqa: E501 + :param status: The status of this Error. # noqa: E501 :type: str """ - self._message = message + self._status = status def to_dict(self): """Returns the model properties as a dict""" diff --git a/jcapiv2/jcapiv2/models/error_details.py b/jcapiv2/jcapiv2/models/error_details.py new file mode 100644 index 0000000..b8e6b9e --- /dev/null +++ b/jcapiv2/jcapiv2/models/error_details.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.error import Error # noqa: F401,E501 + +class ErrorDetails(Error): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'details': 'list[object]' + } + if hasattr(Error, "swagger_types"): + swagger_types.update(Error.swagger_types) + + attribute_map = { + 'details': 'details' + } + if hasattr(Error, "attribute_map"): + attribute_map.update(Error.attribute_map) + + def __init__(self, details=None, *args, **kwargs): # noqa: E501 + """ErrorDetails - a model defined in Swagger""" # noqa: E501 + self._details = None + self.discriminator = None + if details is not None: + self.details = details + Error.__init__(self, *args, **kwargs) + + @property + def details(self): + """Gets the details of this ErrorDetails. # noqa: E501 + + Describes a list of objects with more detailed information of the given error. Each detail schema is according to one of the messages defined in Google's API: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto # noqa: E501 + + :return: The details of this ErrorDetails. # noqa: E501 + :rtype: list[object] + """ + return self._details + + @details.setter + def details(self, details): + """Sets the details of this ErrorDetails. + + Describes a list of objects with more detailed information of the given error. Each detail schema is according to one of the messages defined in Google's API: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto # noqa: E501 + + :param details: The details of this ErrorDetails. # noqa: E501 + :type: list[object] + """ + + self._details = details + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ErrorDetails, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ErrorDetails): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/errorresponse.py b/jcapiv2/jcapiv2/models/errorresponse.py deleted file mode 100644 index 249480e..0000000 --- a/jcapiv2/jcapiv2/models/errorresponse.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Errorresponse(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'message': 'str' - } - - attribute_map = { - 'message': 'message' - } - - def __init__(self, message=None): # noqa: E501 - """Errorresponse - a model defined in Swagger""" # noqa: E501 - - self._message = None - self.discriminator = None - - if message is not None: - self.message = message - - @property - def message(self): - """Gets the message of this Errorresponse. # noqa: E501 - - - :return: The message of this Errorresponse. # noqa: E501 - :rtype: str - """ - return self._message - - @message.setter - def message(self, message): - """Sets the message of this Errorresponse. - - - :param message: The message of this Errorresponse. # noqa: E501 - :type: str - """ - - self._message = message - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Errorresponse, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Errorresponse): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/feature.py b/jcapiv2/jcapiv2/models/feature.py new file mode 100644 index 0000000..2e2c841 --- /dev/null +++ b/jcapiv2/jcapiv2/models/feature.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Feature(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str' + } + + attribute_map = { + 'name': 'name' + } + + def __init__(self, name=None): # noqa: E501 + """Feature - a model defined in Swagger""" # noqa: E501 + self._name = None + self.discriminator = None + if name is not None: + self.name = name + + @property + def name(self): + """Gets the name of this Feature. # noqa: E501 + + The unique identifier for this feature. # noqa: E501 + + :return: The name of this Feature. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Feature. + + The unique identifier for this feature. # noqa: E501 + + :param name: The name of this Feature. # noqa: E501 + :type: str + """ + allowed_values = ["cloudDirectory", "deviceManagement", "directoryInsightsPremium", "ldap", "mdm", "mfa", "premiumSupport", "radius", "sso", "systemInsights", "userLifecycle", "zeroTrust", "jumpcloudProtect", "osPatchManagement", "remoteAssist", "cloudInsights", "passwordManagement"] # noqa: E501 + if name not in allowed_values: + raise ValueError( + "Invalid value for `name` ({0}), must be one of {1}" # noqa: E501 + .format(name, allowed_values) + ) + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Feature, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Feature): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/filter.py b/jcapiv2/jcapiv2/models/filter.py new file mode 100644 index 0000000..8b7acd0 --- /dev/null +++ b/jcapiv2/jcapiv2/models/filter.py @@ -0,0 +1,177 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Filter(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'field': 'str', + 'operator': 'str', + 'value': 'str' + } + + attribute_map = { + 'field': 'field', + 'operator': 'operator', + 'value': 'value' + } + + def __init__(self, field=None, operator=None, value=None): # noqa: E501 + """Filter - a model defined in Swagger""" # noqa: E501 + self._field = None + self._operator = None + self._value = None + self.discriminator = None + self.field = field + self.operator = operator + self.value = value + + @property + def field(self): + """Gets the field of this Filter. # noqa: E501 + + Name of field in filter target object. # noqa: E501 + + :return: The field of this Filter. # noqa: E501 + :rtype: str + """ + return self._field + + @field.setter + def field(self, field): + """Sets the field of this Filter. + + Name of field in filter target object. # noqa: E501 + + :param field: The field of this Filter. # noqa: E501 + :type: str + """ + if field is None: + raise ValueError("Invalid value for `field`, must not be `None`") # noqa: E501 + + self._field = field + + @property + def operator(self): + """Gets the operator of this Filter. # noqa: E501 + + Filter comparison operator. # noqa: E501 + + :return: The operator of this Filter. # noqa: E501 + :rtype: str + """ + return self._operator + + @operator.setter + def operator(self, operator): + """Sets the operator of this Filter. + + Filter comparison operator. # noqa: E501 + + :param operator: The operator of this Filter. # noqa: E501 + :type: str + """ + if operator is None: + raise ValueError("Invalid value for `operator`, must not be `None`") # noqa: E501 + allowed_values = ["eq", "ne", "gt", "ge", "lt", "le", "between", "search", "in"] # noqa: E501 + if operator not in allowed_values: + raise ValueError( + "Invalid value for `operator` ({0}), must be one of {1}" # noqa: E501 + .format(operator, allowed_values) + ) + + self._operator = operator + + @property + def value(self): + """Gets the value of this Filter. # noqa: E501 + + Filter comparison value. # noqa: E501 + + :return: The value of this Filter. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this Filter. + + Filter comparison value. # noqa: E501 + + :param value: The value of this Filter. # noqa: E501 + :type: str + """ + if value is None: + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Filter, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Filter): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/filter_query.py b/jcapiv2/jcapiv2/models/filter_query.py new file mode 100644 index 0000000..b46400d --- /dev/null +++ b/jcapiv2/jcapiv2/models/filter_query.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.query import Query # noqa: F401,E501 + +class FilterQuery(Query): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'filters': 'list[Filter]' + } + if hasattr(Query, "swagger_types"): + swagger_types.update(Query.swagger_types) + + attribute_map = { + 'filters': 'filters' + } + if hasattr(Query, "attribute_map"): + attribute_map.update(Query.attribute_map) + + def __init__(self, filters=None, *args, **kwargs): # noqa: E501 + """FilterQuery - a model defined in Swagger""" # noqa: E501 + self._filters = None + self.discriminator = None + if filters is not None: + self.filters = filters + Query.__init__(self, *args, **kwargs) + + @property + def filters(self): + """Gets the filters of this FilterQuery. # noqa: E501 + + + :return: The filters of this FilterQuery. # noqa: E501 + :rtype: list[Filter] + """ + return self._filters + + @filters.setter + def filters(self, filters): + """Sets the filters of this FilterQuery. + + + :param filters: The filters of this FilterQuery. # noqa: E501 + :type: list[Filter] + """ + + self._filters = filters + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(FilterQuery, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FilterQuery): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/g_suite_builtin_translation.py b/jcapiv2/jcapiv2/models/g_suite_builtin_translation.py index d2eb0e5..08fc66c 100644 --- a/jcapiv2/jcapiv2/models/g_suite_builtin_translation.py +++ b/jcapiv2/jcapiv2/models/g_suite_builtin_translation.py @@ -1,22 +1,20 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class GSuiteBuiltinTranslation(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -35,12 +33,13 @@ class GSuiteBuiltinTranslation(object): WORK_PHONE_NUMBERS = "user_work_phone_numbers" WORK_FAX_PHONE_NUMBERS = "user_work_fax_phone_numbers" WORK_MOBILE_PHONE_NUMBERS = "user_work_mobile_phone_numbers" + MANAGER = "user_manager" + ALTERNATE_EMAIL = "user_alternate_email" PRIMARY_ORGANIZATION_COST_CENTER = "user_primary_organization_cost_center" PRIMARY_ORGANIZATION_DEPARTMENT = "user_primary_organization_department" PRIMARY_ORGANIZATION_DESCRIPTION = "user_primary_organization_description" PRIMARY_ORGANIZATION_EMPLOYEE_ID = "user_primary_organization_employee_id" PRIMARY_ORGANIZATION_TITLE = "user_primary_organization_title" - """ Attributes: swagger_types (dict): The key is attribute name diff --git a/jcapiv2/jcapiv2/models/g_suite_direction_translation.py b/jcapiv2/jcapiv2/models/g_suite_direction_translation.py new file mode 100644 index 0000000..a1bb0e8 --- /dev/null +++ b/jcapiv2/jcapiv2/models/g_suite_direction_translation.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GSuiteDirectionTranslation(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + EXPORT = "export" + IMPORT = "import" + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """GSuiteDirectionTranslation - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GSuiteDirectionTranslation, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GSuiteDirectionTranslation): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/g_suite_translation_rule.py b/jcapiv2/jcapiv2/models/g_suite_translation_rule.py index 14ff016..fb9b1e0 100644 --- a/jcapiv2/jcapiv2/models/g_suite_translation_rule.py +++ b/jcapiv2/jcapiv2/models/g_suite_translation_rule.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.g_suite_builtin_translation import GSuiteBuiltinTranslation # noqa: F401,E501 - - class GSuiteTranslationRule(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -34,23 +29,26 @@ class GSuiteTranslationRule(object): """ swagger_types = { 'built_in': 'GSuiteBuiltinTranslation', + 'direction': 'GSuiteDirectionTranslation', 'id': 'str' } attribute_map = { 'built_in': 'builtIn', + 'direction': 'direction', 'id': 'id' } - def __init__(self, built_in=None, id=None): # noqa: E501 + def __init__(self, built_in=None, direction=None, id=None): # noqa: E501 """GSuiteTranslationRule - a model defined in Swagger""" # noqa: E501 - self._built_in = None + self._direction = None self._id = None self.discriminator = None - if built_in is not None: self.built_in = built_in + if direction is not None: + self.direction = direction if id is not None: self.id = id @@ -75,6 +73,27 @@ def built_in(self, built_in): self._built_in = built_in + @property + def direction(self): + """Gets the direction of this GSuiteTranslationRule. # noqa: E501 + + + :return: The direction of this GSuiteTranslationRule. # noqa: E501 + :rtype: GSuiteDirectionTranslation + """ + return self._direction + + @direction.setter + def direction(self, direction): + """Sets the direction of this GSuiteTranslationRule. + + + :param direction: The direction of this GSuiteTranslationRule. # noqa: E501 + :type: GSuiteDirectionTranslation + """ + + self._direction = direction + @property def id(self): """Gets the id of this GSuiteTranslationRule. # noqa: E501 diff --git a/jcapiv2/jcapiv2/models/g_suite_translation_rule_request.py b/jcapiv2/jcapiv2/models/g_suite_translation_rule_request.py index c635cdb..8483a6c 100644 --- a/jcapiv2/jcapiv2/models/g_suite_translation_rule_request.py +++ b/jcapiv2/jcapiv2/models/g_suite_translation_rule_request.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.g_suite_builtin_translation import GSuiteBuiltinTranslation # noqa: F401,E501 - - class GSuiteTranslationRuleRequest(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,21 +28,24 @@ class GSuiteTranslationRuleRequest(object): and the value is json key in definition. """ swagger_types = { - 'built_in': 'GSuiteBuiltinTranslation' + 'built_in': 'GSuiteBuiltinTranslation', + 'direction': 'GSuiteDirectionTranslation' } attribute_map = { - 'built_in': 'builtIn' + 'built_in': 'builtIn', + 'direction': 'direction' } - def __init__(self, built_in=None): # noqa: E501 + def __init__(self, built_in=None, direction=None): # noqa: E501 """GSuiteTranslationRuleRequest - a model defined in Swagger""" # noqa: E501 - self._built_in = None + self._direction = None self.discriminator = None - if built_in is not None: self.built_in = built_in + if direction is not None: + self.direction = direction @property def built_in(self): @@ -70,6 +68,27 @@ def built_in(self, built_in): self._built_in = built_in + @property + def direction(self): + """Gets the direction of this GSuiteTranslationRuleRequest. # noqa: E501 + + + :return: The direction of this GSuiteTranslationRuleRequest. # noqa: E501 + :rtype: GSuiteDirectionTranslation + """ + return self._direction + + @direction.setter + def direction(self, direction): + """Sets the direction of this GSuiteTranslationRuleRequest. + + + :param direction: The direction of this GSuiteTranslationRuleRequest. # noqa: E501 + :type: GSuiteDirectionTranslation + """ + + self._direction = direction + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/jcapiv2/jcapiv2/models/graph_attribute_ldap_groups.py b/jcapiv2/jcapiv2/models/graph_attribute_ldap_groups.py new file mode 100644 index 0000000..a4eb76e --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_attribute_ldap_groups.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GraphAttributeLdapGroups(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'ldap_groups': 'list[LdapGroup]' + } + + attribute_map = { + 'ldap_groups': 'ldapGroups' + } + + def __init__(self, ldap_groups=None): # noqa: E501 + """GraphAttributeLdapGroups - a model defined in Swagger""" # noqa: E501 + self._ldap_groups = None + self.discriminator = None + if ldap_groups is not None: + self.ldap_groups = ldap_groups + + @property + def ldap_groups(self): + """Gets the ldap_groups of this GraphAttributeLdapGroups. # noqa: E501 + + + :return: The ldap_groups of this GraphAttributeLdapGroups. # noqa: E501 + :rtype: list[LdapGroup] + """ + return self._ldap_groups + + @ldap_groups.setter + def ldap_groups(self, ldap_groups): + """Sets the ldap_groups of this GraphAttributeLdapGroups. + + + :param ldap_groups: The ldap_groups of this GraphAttributeLdapGroups. # noqa: E501 + :type: list[LdapGroup] + """ + + self._ldap_groups = ldap_groups + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphAttributeLdapGroups, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphAttributeLdapGroups): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_attribute_posix_groups.py b/jcapiv2/jcapiv2/models/graph_attribute_posix_groups.py new file mode 100644 index 0000000..cdb4f8f --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_attribute_posix_groups.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GraphAttributePosixGroups(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'posix_groups': 'list[GraphAttributePosixGroupsPosixGroups]' + } + + attribute_map = { + 'posix_groups': 'posixGroups' + } + + def __init__(self, posix_groups=None): # noqa: E501 + """GraphAttributePosixGroups - a model defined in Swagger""" # noqa: E501 + self._posix_groups = None + self.discriminator = None + if posix_groups is not None: + self.posix_groups = posix_groups + + @property + def posix_groups(self): + """Gets the posix_groups of this GraphAttributePosixGroups. # noqa: E501 + + + :return: The posix_groups of this GraphAttributePosixGroups. # noqa: E501 + :rtype: list[GraphAttributePosixGroupsPosixGroups] + """ + return self._posix_groups + + @posix_groups.setter + def posix_groups(self, posix_groups): + """Sets the posix_groups of this GraphAttributePosixGroups. + + + :param posix_groups: The posix_groups of this GraphAttributePosixGroups. # noqa: E501 + :type: list[GraphAttributePosixGroupsPosixGroups] + """ + + self._posix_groups = posix_groups + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphAttributePosixGroups, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphAttributePosixGroups): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_attribute_posix_groups_posix_groups.py b/jcapiv2/jcapiv2/models/graph_attribute_posix_groups_posix_groups.py new file mode 100644 index 0000000..22a6393 --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_attribute_posix_groups_posix_groups.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GraphAttributePosixGroupsPosixGroups(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """GraphAttributePosixGroupsPosixGroups - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + self.id = id + self.name = name + + @property + def id(self): + """Gets the id of this GraphAttributePosixGroupsPosixGroups. # noqa: E501 + + + :return: The id of this GraphAttributePosixGroupsPosixGroups. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this GraphAttributePosixGroupsPosixGroups. + + + :param id: The id of this GraphAttributePosixGroupsPosixGroups. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this GraphAttributePosixGroupsPosixGroups. # noqa: E501 + + + :return: The name of this GraphAttributePosixGroupsPosixGroups. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this GraphAttributePosixGroupsPosixGroups. + + + :param name: The name of this GraphAttributePosixGroupsPosixGroups. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphAttributePosixGroupsPosixGroups, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphAttributePosixGroupsPosixGroups): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_attribute_radius.py b/jcapiv2/jcapiv2/models/graph_attribute_radius.py new file mode 100644 index 0000000..f867fbd --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_attribute_radius.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GraphAttributeRadius(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'radius': 'GraphAttributeRadiusRadius' + } + + attribute_map = { + 'radius': 'radius' + } + + def __init__(self, radius=None): # noqa: E501 + """GraphAttributeRadius - a model defined in Swagger""" # noqa: E501 + self._radius = None + self.discriminator = None + if radius is not None: + self.radius = radius + + @property + def radius(self): + """Gets the radius of this GraphAttributeRadius. # noqa: E501 + + + :return: The radius of this GraphAttributeRadius. # noqa: E501 + :rtype: GraphAttributeRadiusRadius + """ + return self._radius + + @radius.setter + def radius(self, radius): + """Sets the radius of this GraphAttributeRadius. + + + :param radius: The radius of this GraphAttributeRadius. # noqa: E501 + :type: GraphAttributeRadiusRadius + """ + + self._radius = radius + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphAttributeRadius, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphAttributeRadius): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_attribute_radius_radius.py b/jcapiv2/jcapiv2/models/graph_attribute_radius_radius.py new file mode 100644 index 0000000..9630c2b --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_attribute_radius_radius.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GraphAttributeRadiusRadius(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'reply': 'list[GraphAttributeRadiusRadiusReply]' + } + + attribute_map = { + 'reply': 'reply' + } + + def __init__(self, reply=None): # noqa: E501 + """GraphAttributeRadiusRadius - a model defined in Swagger""" # noqa: E501 + self._reply = None + self.discriminator = None + if reply is not None: + self.reply = reply + + @property + def reply(self): + """Gets the reply of this GraphAttributeRadiusRadius. # noqa: E501 + + + :return: The reply of this GraphAttributeRadiusRadius. # noqa: E501 + :rtype: list[GraphAttributeRadiusRadiusReply] + """ + return self._reply + + @reply.setter + def reply(self, reply): + """Sets the reply of this GraphAttributeRadiusRadius. + + + :param reply: The reply of this GraphAttributeRadiusRadius. # noqa: E501 + :type: list[GraphAttributeRadiusRadiusReply] + """ + + self._reply = reply + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphAttributeRadiusRadius, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphAttributeRadiusRadius): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_attribute_radius_radius_reply.py b/jcapiv2/jcapiv2/models/graph_attribute_radius_radius_reply.py new file mode 100644 index 0000000..7e154c8 --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_attribute_radius_radius_reply.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GraphAttributeRadiusRadiusReply(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'value': 'str' + } + + attribute_map = { + 'name': 'name', + 'value': 'value' + } + + def __init__(self, name=None, value=None): # noqa: E501 + """GraphAttributeRadiusRadiusReply - a model defined in Swagger""" # noqa: E501 + self._name = None + self._value = None + self.discriminator = None + self.name = name + self.value = value + + @property + def name(self): + """Gets the name of this GraphAttributeRadiusRadiusReply. # noqa: E501 + + + :return: The name of this GraphAttributeRadiusRadiusReply. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this GraphAttributeRadiusRadiusReply. + + + :param name: The name of this GraphAttributeRadiusRadiusReply. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def value(self): + """Gets the value of this GraphAttributeRadiusRadiusReply. # noqa: E501 + + + :return: The value of this GraphAttributeRadiusRadiusReply. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this GraphAttributeRadiusRadiusReply. + + + :param value: The value of this GraphAttributeRadiusRadiusReply. # noqa: E501 + :type: str + """ + if value is None: + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphAttributeRadiusRadiusReply, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphAttributeRadiusRadiusReply): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_attribute_samba_enabled.py b/jcapiv2/jcapiv2/models/graph_attribute_samba_enabled.py new file mode 100644 index 0000000..bdfa6ff --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_attribute_samba_enabled.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GraphAttributeSambaEnabled(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'samba_enabled': 'bool' + } + + attribute_map = { + 'samba_enabled': 'sambaEnabled' + } + + def __init__(self, samba_enabled=None): # noqa: E501 + """GraphAttributeSambaEnabled - a model defined in Swagger""" # noqa: E501 + self._samba_enabled = None + self.discriminator = None + if samba_enabled is not None: + self.samba_enabled = samba_enabled + + @property + def samba_enabled(self): + """Gets the samba_enabled of this GraphAttributeSambaEnabled. # noqa: E501 + + + :return: The samba_enabled of this GraphAttributeSambaEnabled. # noqa: E501 + :rtype: bool + """ + return self._samba_enabled + + @samba_enabled.setter + def samba_enabled(self, samba_enabled): + """Sets the samba_enabled of this GraphAttributeSambaEnabled. + + + :param samba_enabled: The samba_enabled of this GraphAttributeSambaEnabled. # noqa: E501 + :type: bool + """ + + self._samba_enabled = samba_enabled + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphAttributeSambaEnabled, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphAttributeSambaEnabled): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_attribute_sudo.py b/jcapiv2/jcapiv2/models/graph_attribute_sudo.py new file mode 100644 index 0000000..1ad29de --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_attribute_sudo.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GraphAttributeSudo(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'sudo': 'GraphAttributeSudoSudo' + } + + attribute_map = { + 'sudo': 'sudo' + } + + def __init__(self, sudo=None): # noqa: E501 + """GraphAttributeSudo - a model defined in Swagger""" # noqa: E501 + self._sudo = None + self.discriminator = None + if sudo is not None: + self.sudo = sudo + + @property + def sudo(self): + """Gets the sudo of this GraphAttributeSudo. # noqa: E501 + + + :return: The sudo of this GraphAttributeSudo. # noqa: E501 + :rtype: GraphAttributeSudoSudo + """ + return self._sudo + + @sudo.setter + def sudo(self, sudo): + """Sets the sudo of this GraphAttributeSudo. + + + :param sudo: The sudo of this GraphAttributeSudo. # noqa: E501 + :type: GraphAttributeSudoSudo + """ + + self._sudo = sudo + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphAttributeSudo, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphAttributeSudo): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_attribute_sudo_sudo.py b/jcapiv2/jcapiv2/models/graph_attribute_sudo_sudo.py new file mode 100644 index 0000000..5cd3630 --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_attribute_sudo_sudo.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GraphAttributeSudoSudo(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'enabled': 'bool', + 'without_password': 'bool' + } + + attribute_map = { + 'enabled': 'enabled', + 'without_password': 'withoutPassword' + } + + def __init__(self, enabled=None, without_password=None): # noqa: E501 + """GraphAttributeSudoSudo - a model defined in Swagger""" # noqa: E501 + self._enabled = None + self._without_password = None + self.discriminator = None + self.enabled = enabled + self.without_password = without_password + + @property + def enabled(self): + """Gets the enabled of this GraphAttributeSudoSudo. # noqa: E501 + + Enables sudo # noqa: E501 + + :return: The enabled of this GraphAttributeSudoSudo. # noqa: E501 + :rtype: bool + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled): + """Sets the enabled of this GraphAttributeSudoSudo. + + Enables sudo # noqa: E501 + + :param enabled: The enabled of this GraphAttributeSudoSudo. # noqa: E501 + :type: bool + """ + if enabled is None: + raise ValueError("Invalid value for `enabled`, must not be `None`") # noqa: E501 + + self._enabled = enabled + + @property + def without_password(self): + """Gets the without_password of this GraphAttributeSudoSudo. # noqa: E501 + + Enable sudo without password (requires 'enabled' to be true) # noqa: E501 + + :return: The without_password of this GraphAttributeSudoSudo. # noqa: E501 + :rtype: bool + """ + return self._without_password + + @without_password.setter + def without_password(self, without_password): + """Sets the without_password of this GraphAttributeSudoSudo. + + Enable sudo without password (requires 'enabled' to be true) # noqa: E501 + + :param without_password: The without_password of this GraphAttributeSudoSudo. # noqa: E501 + :type: bool + """ + if without_password is None: + raise ValueError("Invalid value for `without_password`, must not be `None`") # noqa: E501 + + self._without_password = without_password + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphAttributeSudoSudo, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphAttributeSudoSudo): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_attributes.py b/jcapiv2/jcapiv2/models/graph_attributes.py new file mode 100644 index 0000000..41ceeda --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_attributes.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GraphAttributes(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """GraphAttributes - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphAttributes, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphAttributes): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_connection.py b/jcapiv2/jcapiv2/models/graph_connection.py index 6439d3e..11404b5 100644 --- a/jcapiv2/jcapiv2/models/graph_connection.py +++ b/jcapiv2/jcapiv2/models/graph_connection.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.graph_object import GraphObject # noqa: F401,E501 - - class GraphConnection(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,26 +28,50 @@ class GraphConnection(object): and the value is json key in definition. """ swagger_types = { + 'attributes': 'GraphAttributes', '_from': 'GraphObject', 'to': 'GraphObject' } attribute_map = { + 'attributes': 'attributes', '_from': 'from', 'to': 'to' } - def __init__(self, _from=None, to=None): # noqa: E501 + def __init__(self, attributes=None, _from=None, to=None): # noqa: E501 """GraphConnection - a model defined in Swagger""" # noqa: E501 - + self._attributes = None self.__from = None self._to = None self.discriminator = None - + if attributes is not None: + self.attributes = attributes if _from is not None: self._from = _from self.to = to + @property + def attributes(self): + """Gets the attributes of this GraphConnection. # noqa: E501 + + + :return: The attributes of this GraphConnection. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphConnection. + + + :param attributes: The attributes of this GraphConnection. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + @property def _from(self): """Gets the _from of this GraphConnection. # noqa: E501 diff --git a/jcapiv2/jcapiv2/models/graph_management_req.py b/jcapiv2/jcapiv2/models/graph_management_req.py deleted file mode 100644 index 9701f96..0000000 --- a/jcapiv2/jcapiv2/models/graph_management_req.py +++ /dev/null @@ -1,182 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - -from jcapiv2.models.graph_type import GraphType # noqa: F401,E501 - - -class GraphManagementReq(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'str', - 'op': 'str', - 'type': 'GraphType' - } - - attribute_map = { - 'id': 'id', - 'op': 'op', - 'type': 'type' - } - - def __init__(self, id=None, op=None, type=None): # noqa: E501 - """GraphManagementReq - a model defined in Swagger""" # noqa: E501 - - self._id = None - self._op = None - self._type = None - self.discriminator = None - - self.id = id - self.op = op - self.type = type - - @property - def id(self): - """Gets the id of this GraphManagementReq. # noqa: E501 - - The ObjectID of graph object being added or removed as an association. # noqa: E501 - - :return: The id of this GraphManagementReq. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this GraphManagementReq. - - The ObjectID of graph object being added or removed as an association. # noqa: E501 - - :param id: The id of this GraphManagementReq. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def op(self): - """Gets the op of this GraphManagementReq. # noqa: E501 - - How to modify the graph connection. # noqa: E501 - - :return: The op of this GraphManagementReq. # noqa: E501 - :rtype: str - """ - return self._op - - @op.setter - def op(self, op): - """Sets the op of this GraphManagementReq. - - How to modify the graph connection. # noqa: E501 - - :param op: The op of this GraphManagementReq. # noqa: E501 - :type: str - """ - if op is None: - raise ValueError("Invalid value for `op`, must not be `None`") # noqa: E501 - allowed_values = ["add", "remove", "update"] # noqa: E501 - if op not in allowed_values: - raise ValueError( - "Invalid value for `op` ({0}), must be one of {1}" # noqa: E501 - .format(op, allowed_values) - ) - - self._op = op - - @property - def type(self): - """Gets the type of this GraphManagementReq. # noqa: E501 - - - :return: The type of this GraphManagementReq. # noqa: E501 - :rtype: GraphType - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this GraphManagementReq. - - - :param type: The type of this GraphManagementReq. # noqa: E501 - :type: GraphType - """ - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(GraphManagementReq, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, GraphManagementReq): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_object.py b/jcapiv2/jcapiv2/models/graph_object.py index ff1cdf3..c596744 100644 --- a/jcapiv2/jcapiv2/models/graph_object.py +++ b/jcapiv2/jcapiv2/models/graph_object.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class GraphObject(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,25 +28,49 @@ class GraphObject(object): and the value is json key in definition. """ swagger_types = { + 'attributes': 'GraphAttributes', 'id': 'str', 'type': 'str' } attribute_map = { + 'attributes': 'attributes', 'id': 'id', 'type': 'type' } - def __init__(self, id=None, type=None): # noqa: E501 + def __init__(self, attributes=None, id=None, type=None): # noqa: E501 """GraphObject - a model defined in Swagger""" # noqa: E501 - + self._attributes = None self._id = None self._type = None self.discriminator = None - + if attributes is not None: + self.attributes = attributes self.id = id self.type = type + @property + def attributes(self): + """Gets the attributes of this GraphObject. # noqa: E501 + + + :return: The attributes of this GraphObject. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphObject. + + + :param attributes: The attributes of this GraphObject. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + @property def id(self): """Gets the id of this GraphObject. # noqa: E501 diff --git a/jcapiv2/jcapiv2/models/graph_object_with_paths.py b/jcapiv2/jcapiv2/models/graph_object_with_paths.py index b3f984e..fc060cc 100644 --- a/jcapiv2/jcapiv2/models/graph_object_with_paths.py +++ b/jcapiv2/jcapiv2/models/graph_object_with_paths.py @@ -1,31 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.graph_connection import GraphConnection # noqa: F401,E501 -from jcapiv2.models.graph_type import GraphType # noqa: F401,E501 - - class GraphObjectWithPaths(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -34,29 +28,53 @@ class GraphObjectWithPaths(object): and the value is json key in definition. """ swagger_types = { + 'compiled_attributes': 'GraphAttributes', 'id': 'str', 'paths': 'list[list[GraphConnection]]', 'type': 'GraphType' } attribute_map = { + 'compiled_attributes': 'compiledAttributes', 'id': 'id', 'paths': 'paths', 'type': 'type' } - def __init__(self, id=None, paths=None, type=None): # noqa: E501 + def __init__(self, compiled_attributes=None, id=None, paths=None, type=None): # noqa: E501 """GraphObjectWithPaths - a model defined in Swagger""" # noqa: E501 - + self._compiled_attributes = None self._id = None self._paths = None self._type = None self.discriminator = None - + if compiled_attributes is not None: + self.compiled_attributes = compiled_attributes self.id = id self.paths = paths self.type = type + @property + def compiled_attributes(self): + """Gets the compiled_attributes of this GraphObjectWithPaths. # noqa: E501 + + + :return: The compiled_attributes of this GraphObjectWithPaths. # noqa: E501 + :rtype: GraphAttributes + """ + return self._compiled_attributes + + @compiled_attributes.setter + def compiled_attributes(self, compiled_attributes): + """Sets the compiled_attributes of this GraphObjectWithPaths. + + + :param compiled_attributes: The compiled_attributes of this GraphObjectWithPaths. # noqa: E501 + :type: GraphAttributes + """ + + self._compiled_attributes = compiled_attributes + @property def id(self): """Gets the id of this GraphObjectWithPaths. # noqa: E501 diff --git a/jcapiv2/jcapiv2/models/graph_operation.py b/jcapiv2/jcapiv2/models/graph_operation.py new file mode 100644 index 0000000..5006d55 --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GraphOperation(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'op': 'str' + } + + attribute_map = { + 'id': 'id', + 'op': 'op' + } + + def __init__(self, id=None, op=None): # noqa: E501 + """GraphOperation - a model defined in Swagger""" # noqa: E501 + self._id = None + self._op = None + self.discriminator = None + self.id = id + self.op = op + + @property + def id(self): + """Gets the id of this GraphOperation. # noqa: E501 + + The ObjectID of graph object being added or removed as an association. # noqa: E501 + + :return: The id of this GraphOperation. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this GraphOperation. + + The ObjectID of graph object being added or removed as an association. # noqa: E501 + + :param id: The id of this GraphOperation. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def op(self): + """Gets the op of this GraphOperation. # noqa: E501 + + How to modify the graph connection. # noqa: E501 + + :return: The op of this GraphOperation. # noqa: E501 + :rtype: str + """ + return self._op + + @op.setter + def op(self, op): + """Sets the op of this GraphOperation. + + How to modify the graph connection. # noqa: E501 + + :param op: The op of this GraphOperation. # noqa: E501 + :type: str + """ + if op is None: + raise ValueError("Invalid value for `op`, must not be `None`") # noqa: E501 + allowed_values = ["add", "remove", "update"] # noqa: E501 + if op not in allowed_values: + raise ValueError( + "Invalid value for `op` ({0}), must be one of {1}" # noqa: E501 + .format(op, allowed_values) + ) + + self._op = op + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperation, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperation): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_operation_active_directory.py b/jcapiv2/jcapiv2/models/graph_operation_active_directory.py new file mode 100644 index 0000000..08a566e --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation_active_directory.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_operation import GraphOperation # noqa: F401,E501 + +class GraphOperationActiveDirectory(GraphOperation): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'GraphAttributes', + 'type': 'str' + } + if hasattr(GraphOperation, "swagger_types"): + swagger_types.update(GraphOperation.swagger_types) + + attribute_map = { + 'attributes': 'attributes', + 'type': 'type' + } + if hasattr(GraphOperation, "attribute_map"): + attribute_map.update(GraphOperation.attribute_map) + + def __init__(self, attributes=None, type=None, *args, **kwargs): # noqa: E501 + """GraphOperationActiveDirectory - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + self.type = type + GraphOperation.__init__(self, *args, **kwargs) + + @property + def attributes(self): + """Gets the attributes of this GraphOperationActiveDirectory. # noqa: E501 + + + :return: The attributes of this GraphOperationActiveDirectory. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphOperationActiveDirectory. + + + :param attributes: The attributes of this GraphOperationActiveDirectory. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def type(self): + """Gets the type of this GraphOperationActiveDirectory. # noqa: E501 + + Targets which a \"active_directory\" can be associated to. # noqa: E501 + + :return: The type of this GraphOperationActiveDirectory. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GraphOperationActiveDirectory. + + Targets which a \"active_directory\" can be associated to. # noqa: E501 + + :param type: The type of this GraphOperationActiveDirectory. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["user", "user_group"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperationActiveDirectory, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperationActiveDirectory): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_operation_application.py b/jcapiv2/jcapiv2/models/graph_operation_application.py new file mode 100644 index 0000000..3be5131 --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation_application.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_operation import GraphOperation # noqa: F401,E501 + +class GraphOperationApplication(GraphOperation): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'GraphAttributes', + 'type': 'str' + } + if hasattr(GraphOperation, "swagger_types"): + swagger_types.update(GraphOperation.swagger_types) + + attribute_map = { + 'attributes': 'attributes', + 'type': 'type' + } + if hasattr(GraphOperation, "attribute_map"): + attribute_map.update(GraphOperation.attribute_map) + + def __init__(self, attributes=None, type=None, *args, **kwargs): # noqa: E501 + """GraphOperationApplication - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + self.type = type + GraphOperation.__init__(self, *args, **kwargs) + + @property + def attributes(self): + """Gets the attributes of this GraphOperationApplication. # noqa: E501 + + + :return: The attributes of this GraphOperationApplication. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphOperationApplication. + + + :param attributes: The attributes of this GraphOperationApplication. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def type(self): + """Gets the type of this GraphOperationApplication. # noqa: E501 + + Targets which a \"application\" can be associated to. # noqa: E501 + + :return: The type of this GraphOperationApplication. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GraphOperationApplication. + + Targets which a \"application\" can be associated to. # noqa: E501 + + :param type: The type of this GraphOperationApplication. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["user", "user_group"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperationApplication, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperationApplication): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_operation_command.py b/jcapiv2/jcapiv2/models/graph_operation_command.py new file mode 100644 index 0000000..61bc95b --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation_command.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_operation import GraphOperation # noqa: F401,E501 + +class GraphOperationCommand(GraphOperation): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'GraphAttributes', + 'type': 'str' + } + if hasattr(GraphOperation, "swagger_types"): + swagger_types.update(GraphOperation.swagger_types) + + attribute_map = { + 'attributes': 'attributes', + 'type': 'type' + } + if hasattr(GraphOperation, "attribute_map"): + attribute_map.update(GraphOperation.attribute_map) + + def __init__(self, attributes=None, type=None, *args, **kwargs): # noqa: E501 + """GraphOperationCommand - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + self.type = type + GraphOperation.__init__(self, *args, **kwargs) + + @property + def attributes(self): + """Gets the attributes of this GraphOperationCommand. # noqa: E501 + + + :return: The attributes of this GraphOperationCommand. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphOperationCommand. + + + :param attributes: The attributes of this GraphOperationCommand. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def type(self): + """Gets the type of this GraphOperationCommand. # noqa: E501 + + Targets which a \"command\" can be associated to. # noqa: E501 + + :return: The type of this GraphOperationCommand. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GraphOperationCommand. + + Targets which a \"command\" can be associated to. # noqa: E501 + + :param type: The type of this GraphOperationCommand. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["system", "system_group"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperationCommand, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperationCommand): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_operation_g_suite.py b/jcapiv2/jcapiv2/models/graph_operation_g_suite.py new file mode 100644 index 0000000..eda3fbb --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation_g_suite.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_operation import GraphOperation # noqa: F401,E501 + +class GraphOperationGSuite(GraphOperation): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'GraphAttributes', + 'type': 'str' + } + if hasattr(GraphOperation, "swagger_types"): + swagger_types.update(GraphOperation.swagger_types) + + attribute_map = { + 'attributes': 'attributes', + 'type': 'type' + } + if hasattr(GraphOperation, "attribute_map"): + attribute_map.update(GraphOperation.attribute_map) + + def __init__(self, attributes=None, type=None, *args, **kwargs): # noqa: E501 + """GraphOperationGSuite - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + self.type = type + GraphOperation.__init__(self, *args, **kwargs) + + @property + def attributes(self): + """Gets the attributes of this GraphOperationGSuite. # noqa: E501 + + + :return: The attributes of this GraphOperationGSuite. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphOperationGSuite. + + + :param attributes: The attributes of this GraphOperationGSuite. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def type(self): + """Gets the type of this GraphOperationGSuite. # noqa: E501 + + Targets which a \"g_suite\" can be associated to. # noqa: E501 + + :return: The type of this GraphOperationGSuite. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GraphOperationGSuite. + + Targets which a \"g_suite\" can be associated to. # noqa: E501 + + :param type: The type of this GraphOperationGSuite. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["user", "user_group"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperationGSuite, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperationGSuite): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_operation_ldap_server.py b/jcapiv2/jcapiv2/models/graph_operation_ldap_server.py new file mode 100644 index 0000000..509e7b8 --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation_ldap_server.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_operation import GraphOperation # noqa: F401,E501 + +class GraphOperationLdapServer(GraphOperation): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'GraphAttributes', + 'type': 'str' + } + if hasattr(GraphOperation, "swagger_types"): + swagger_types.update(GraphOperation.swagger_types) + + attribute_map = { + 'attributes': 'attributes', + 'type': 'type' + } + if hasattr(GraphOperation, "attribute_map"): + attribute_map.update(GraphOperation.attribute_map) + + def __init__(self, attributes=None, type=None, *args, **kwargs): # noqa: E501 + """GraphOperationLdapServer - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + self.type = type + GraphOperation.__init__(self, *args, **kwargs) + + @property + def attributes(self): + """Gets the attributes of this GraphOperationLdapServer. # noqa: E501 + + + :return: The attributes of this GraphOperationLdapServer. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphOperationLdapServer. + + + :param attributes: The attributes of this GraphOperationLdapServer. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def type(self): + """Gets the type of this GraphOperationLdapServer. # noqa: E501 + + Targets which a \"ldap_server\" can be associated to. # noqa: E501 + + :return: The type of this GraphOperationLdapServer. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GraphOperationLdapServer. + + Targets which a \"ldap_server\" can be associated to. # noqa: E501 + + :param type: The type of this GraphOperationLdapServer. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["user", "user_group"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperationLdapServer, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperationLdapServer): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_operation_office365.py b/jcapiv2/jcapiv2/models/graph_operation_office365.py new file mode 100644 index 0000000..87f55e3 --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation_office365.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_operation import GraphOperation # noqa: F401,E501 + +class GraphOperationOffice365(GraphOperation): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'GraphAttributes', + 'type': 'str' + } + if hasattr(GraphOperation, "swagger_types"): + swagger_types.update(GraphOperation.swagger_types) + + attribute_map = { + 'attributes': 'attributes', + 'type': 'type' + } + if hasattr(GraphOperation, "attribute_map"): + attribute_map.update(GraphOperation.attribute_map) + + def __init__(self, attributes=None, type=None, *args, **kwargs): # noqa: E501 + """GraphOperationOffice365 - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + self.type = type + GraphOperation.__init__(self, *args, **kwargs) + + @property + def attributes(self): + """Gets the attributes of this GraphOperationOffice365. # noqa: E501 + + + :return: The attributes of this GraphOperationOffice365. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphOperationOffice365. + + + :param attributes: The attributes of this GraphOperationOffice365. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def type(self): + """Gets the type of this GraphOperationOffice365. # noqa: E501 + + Targets which a \"office_365\" can be associated to. # noqa: E501 + + :return: The type of this GraphOperationOffice365. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GraphOperationOffice365. + + Targets which a \"office_365\" can be associated to. # noqa: E501 + + :param type: The type of this GraphOperationOffice365. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["user", "user_group"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperationOffice365, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperationOffice365): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_operation_policy.py b/jcapiv2/jcapiv2/models/graph_operation_policy.py new file mode 100644 index 0000000..4e4a04c --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation_policy.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_operation import GraphOperation # noqa: F401,E501 + +class GraphOperationPolicy(GraphOperation): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'GraphAttributes', + 'type': 'str' + } + if hasattr(GraphOperation, "swagger_types"): + swagger_types.update(GraphOperation.swagger_types) + + attribute_map = { + 'attributes': 'attributes', + 'type': 'type' + } + if hasattr(GraphOperation, "attribute_map"): + attribute_map.update(GraphOperation.attribute_map) + + def __init__(self, attributes=None, type=None, *args, **kwargs): # noqa: E501 + """GraphOperationPolicy - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + self.type = type + GraphOperation.__init__(self, *args, **kwargs) + + @property + def attributes(self): + """Gets the attributes of this GraphOperationPolicy. # noqa: E501 + + + :return: The attributes of this GraphOperationPolicy. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphOperationPolicy. + + + :param attributes: The attributes of this GraphOperationPolicy. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def type(self): + """Gets the type of this GraphOperationPolicy. # noqa: E501 + + Targets which a \"policy\" can be associated to. # noqa: E501 + + :return: The type of this GraphOperationPolicy. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GraphOperationPolicy. + + Targets which a \"policy\" can be associated to. # noqa: E501 + + :param type: The type of this GraphOperationPolicy. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["system", "system_group"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperationPolicy, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperationPolicy): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_operation_policy_group.py b/jcapiv2/jcapiv2/models/graph_operation_policy_group.py new file mode 100644 index 0000000..a98d260 --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation_policy_group.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_operation import GraphOperation # noqa: F401,E501 + +class GraphOperationPolicyGroup(GraphOperation): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'GraphAttributes', + 'type': 'str' + } + if hasattr(GraphOperation, "swagger_types"): + swagger_types.update(GraphOperation.swagger_types) + + attribute_map = { + 'attributes': 'attributes', + 'type': 'type' + } + if hasattr(GraphOperation, "attribute_map"): + attribute_map.update(GraphOperation.attribute_map) + + def __init__(self, attributes=None, type=None, *args, **kwargs): # noqa: E501 + """GraphOperationPolicyGroup - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + self.type = type + GraphOperation.__init__(self, *args, **kwargs) + + @property + def attributes(self): + """Gets the attributes of this GraphOperationPolicyGroup. # noqa: E501 + + + :return: The attributes of this GraphOperationPolicyGroup. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphOperationPolicyGroup. + + + :param attributes: The attributes of this GraphOperationPolicyGroup. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def type(self): + """Gets the type of this GraphOperationPolicyGroup. # noqa: E501 + + Targets which a \"policy_group\" can be associated to. # noqa: E501 + + :return: The type of this GraphOperationPolicyGroup. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GraphOperationPolicyGroup. + + Targets which a \"policy_group\" can be associated to. # noqa: E501 + + :param type: The type of this GraphOperationPolicyGroup. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["system", "system_group"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperationPolicyGroup, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperationPolicyGroup): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_operation_policy_group_member.py b/jcapiv2/jcapiv2/models/graph_operation_policy_group_member.py new file mode 100644 index 0000000..2adcea6 --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation_policy_group_member.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_operation import GraphOperation # noqa: F401,E501 + +class GraphOperationPolicyGroupMember(GraphOperation): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'GraphAttributes', + 'type': 'str' + } + if hasattr(GraphOperation, "swagger_types"): + swagger_types.update(GraphOperation.swagger_types) + + attribute_map = { + 'attributes': 'attributes', + 'type': 'type' + } + if hasattr(GraphOperation, "attribute_map"): + attribute_map.update(GraphOperation.attribute_map) + + def __init__(self, attributes=None, type=None, *args, **kwargs): # noqa: E501 + """GraphOperationPolicyGroupMember - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + self.type = type + GraphOperation.__init__(self, *args, **kwargs) + + @property + def attributes(self): + """Gets the attributes of this GraphOperationPolicyGroupMember. # noqa: E501 + + + :return: The attributes of this GraphOperationPolicyGroupMember. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphOperationPolicyGroupMember. + + + :param attributes: The attributes of this GraphOperationPolicyGroupMember. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def type(self): + """Gets the type of this GraphOperationPolicyGroupMember. # noqa: E501 + + The member type. # noqa: E501 + + :return: The type of this GraphOperationPolicyGroupMember. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GraphOperationPolicyGroupMember. + + The member type. # noqa: E501 + + :param type: The type of this GraphOperationPolicyGroupMember. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["policy"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperationPolicyGroupMember, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperationPolicyGroupMember): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_operation_radius_server.py b/jcapiv2/jcapiv2/models/graph_operation_radius_server.py new file mode 100644 index 0000000..168cfb2 --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation_radius_server.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_operation import GraphOperation # noqa: F401,E501 + +class GraphOperationRadiusServer(GraphOperation): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'GraphAttributes', + 'type': 'str' + } + if hasattr(GraphOperation, "swagger_types"): + swagger_types.update(GraphOperation.swagger_types) + + attribute_map = { + 'attributes': 'attributes', + 'type': 'type' + } + if hasattr(GraphOperation, "attribute_map"): + attribute_map.update(GraphOperation.attribute_map) + + def __init__(self, attributes=None, type=None, *args, **kwargs): # noqa: E501 + """GraphOperationRadiusServer - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + self.type = type + GraphOperation.__init__(self, *args, **kwargs) + + @property + def attributes(self): + """Gets the attributes of this GraphOperationRadiusServer. # noqa: E501 + + + :return: The attributes of this GraphOperationRadiusServer. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphOperationRadiusServer. + + + :param attributes: The attributes of this GraphOperationRadiusServer. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def type(self): + """Gets the type of this GraphOperationRadiusServer. # noqa: E501 + + Targets which a \"radius_server\" can be associated to. # noqa: E501 + + :return: The type of this GraphOperationRadiusServer. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GraphOperationRadiusServer. + + Targets which a \"radius_server\" can be associated to. # noqa: E501 + + :param type: The type of this GraphOperationRadiusServer. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["user", "user_group"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperationRadiusServer, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperationRadiusServer): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_operation_software_app.py b/jcapiv2/jcapiv2/models/graph_operation_software_app.py new file mode 100644 index 0000000..855203c --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation_software_app.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_operation import GraphOperation # noqa: F401,E501 + +class GraphOperationSoftwareApp(GraphOperation): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'GraphAttributes', + 'type': 'str' + } + if hasattr(GraphOperation, "swagger_types"): + swagger_types.update(GraphOperation.swagger_types) + + attribute_map = { + 'attributes': 'attributes', + 'type': 'type' + } + if hasattr(GraphOperation, "attribute_map"): + attribute_map.update(GraphOperation.attribute_map) + + def __init__(self, attributes=None, type=None, *args, **kwargs): # noqa: E501 + """GraphOperationSoftwareApp - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + self.type = type + GraphOperation.__init__(self, *args, **kwargs) + + @property + def attributes(self): + """Gets the attributes of this GraphOperationSoftwareApp. # noqa: E501 + + + :return: The attributes of this GraphOperationSoftwareApp. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphOperationSoftwareApp. + + + :param attributes: The attributes of this GraphOperationSoftwareApp. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def type(self): + """Gets the type of this GraphOperationSoftwareApp. # noqa: E501 + + Targets which a \"software_app\" can be associated to. # noqa: E501 + + :return: The type of this GraphOperationSoftwareApp. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GraphOperationSoftwareApp. + + Targets which a \"software_app\" can be associated to. # noqa: E501 + + :param type: The type of this GraphOperationSoftwareApp. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["system", "system_group"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperationSoftwareApp, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperationSoftwareApp): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_operation_system.py b/jcapiv2/jcapiv2/models/graph_operation_system.py new file mode 100644 index 0000000..107b7a2 --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation_system.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_operation import GraphOperation # noqa: F401,E501 + +class GraphOperationSystem(GraphOperation): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'object', + 'type': 'str' + } + if hasattr(GraphOperation, "swagger_types"): + swagger_types.update(GraphOperation.swagger_types) + + attribute_map = { + 'attributes': 'attributes', + 'type': 'type' + } + if hasattr(GraphOperation, "attribute_map"): + attribute_map.update(GraphOperation.attribute_map) + + def __init__(self, attributes=None, type=None, *args, **kwargs): # noqa: E501 + """GraphOperationSystem - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + self.type = type + GraphOperation.__init__(self, *args, **kwargs) + + @property + def attributes(self): + """Gets the attributes of this GraphOperationSystem. # noqa: E501 + + + :return: The attributes of this GraphOperationSystem. # noqa: E501 + :rtype: object + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphOperationSystem. + + + :param attributes: The attributes of this GraphOperationSystem. # noqa: E501 + :type: object + """ + + self._attributes = attributes + + @property + def type(self): + """Gets the type of this GraphOperationSystem. # noqa: E501 + + Targets which a \"system\" can be associated to. # noqa: E501 + + :return: The type of this GraphOperationSystem. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GraphOperationSystem. + + Targets which a \"system\" can be associated to. # noqa: E501 + + :param type: The type of this GraphOperationSystem. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["command", "policy", "policy_group", "user", "user_group"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperationSystem, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperationSystem): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_operation_system_group.py b/jcapiv2/jcapiv2/models/graph_operation_system_group.py new file mode 100644 index 0000000..f52c3b1 --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation_system_group.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_operation import GraphOperation # noqa: F401,E501 + +class GraphOperationSystemGroup(GraphOperation): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'GraphAttributes', + 'type': 'str' + } + if hasattr(GraphOperation, "swagger_types"): + swagger_types.update(GraphOperation.swagger_types) + + attribute_map = { + 'attributes': 'attributes', + 'type': 'type' + } + if hasattr(GraphOperation, "attribute_map"): + attribute_map.update(GraphOperation.attribute_map) + + def __init__(self, attributes=None, type=None, *args, **kwargs): # noqa: E501 + """GraphOperationSystemGroup - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + self.type = type + GraphOperation.__init__(self, *args, **kwargs) + + @property + def attributes(self): + """Gets the attributes of this GraphOperationSystemGroup. # noqa: E501 + + + :return: The attributes of this GraphOperationSystemGroup. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphOperationSystemGroup. + + + :param attributes: The attributes of this GraphOperationSystemGroup. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def type(self): + """Gets the type of this GraphOperationSystemGroup. # noqa: E501 + + Targets which a \"system_group\" can be associated to. # noqa: E501 + + :return: The type of this GraphOperationSystemGroup. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GraphOperationSystemGroup. + + Targets which a \"system_group\" can be associated to. # noqa: E501 + + :param type: The type of this GraphOperationSystemGroup. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["command", "policy", "policy_group", "user", "user_group"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperationSystemGroup, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperationSystemGroup): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_operation_system_group_member.py b/jcapiv2/jcapiv2/models/graph_operation_system_group_member.py new file mode 100644 index 0000000..af4eaf9 --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation_system_group_member.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_operation import GraphOperation # noqa: F401,E501 + +class GraphOperationSystemGroupMember(GraphOperation): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'GraphAttributes', + 'type': 'str' + } + if hasattr(GraphOperation, "swagger_types"): + swagger_types.update(GraphOperation.swagger_types) + + attribute_map = { + 'attributes': 'attributes', + 'type': 'type' + } + if hasattr(GraphOperation, "attribute_map"): + attribute_map.update(GraphOperation.attribute_map) + + def __init__(self, attributes=None, type=None, *args, **kwargs): # noqa: E501 + """GraphOperationSystemGroupMember - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + self.type = type + GraphOperation.__init__(self, *args, **kwargs) + + @property + def attributes(self): + """Gets the attributes of this GraphOperationSystemGroupMember. # noqa: E501 + + + :return: The attributes of this GraphOperationSystemGroupMember. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphOperationSystemGroupMember. + + + :param attributes: The attributes of this GraphOperationSystemGroupMember. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def type(self): + """Gets the type of this GraphOperationSystemGroupMember. # noqa: E501 + + The member type. # noqa: E501 + + :return: The type of this GraphOperationSystemGroupMember. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GraphOperationSystemGroupMember. + + The member type. # noqa: E501 + + :param type: The type of this GraphOperationSystemGroupMember. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["system"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperationSystemGroupMember, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperationSystemGroupMember): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_operation_user.py b/jcapiv2/jcapiv2/models/graph_operation_user.py new file mode 100644 index 0000000..64dd4b8 --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation_user.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_operation import GraphOperation # noqa: F401,E501 + +class GraphOperationUser(GraphOperation): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'object', + 'type': 'str' + } + if hasattr(GraphOperation, "swagger_types"): + swagger_types.update(GraphOperation.swagger_types) + + attribute_map = { + 'attributes': 'attributes', + 'type': 'type' + } + if hasattr(GraphOperation, "attribute_map"): + attribute_map.update(GraphOperation.attribute_map) + + def __init__(self, attributes=None, type=None, *args, **kwargs): # noqa: E501 + """GraphOperationUser - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + self.type = type + GraphOperation.__init__(self, *args, **kwargs) + + @property + def attributes(self): + """Gets the attributes of this GraphOperationUser. # noqa: E501 + + + :return: The attributes of this GraphOperationUser. # noqa: E501 + :rtype: object + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphOperationUser. + + + :param attributes: The attributes of this GraphOperationUser. # noqa: E501 + :type: object + """ + + self._attributes = attributes + + @property + def type(self): + """Gets the type of this GraphOperationUser. # noqa: E501 + + Targets which a \"user\" can be associated to. # noqa: E501 + + :return: The type of this GraphOperationUser. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GraphOperationUser. + + Targets which a \"user\" can be associated to. # noqa: E501 + + :param type: The type of this GraphOperationUser. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["active_directory", "application", "g_suite", "ldap_server", "office_365", "radius_server", "system", "system_group"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperationUser, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperationUser): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_operation_user_group.py b/jcapiv2/jcapiv2/models/graph_operation_user_group.py new file mode 100644 index 0000000..46bb379 --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation_user_group.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_operation import GraphOperation # noqa: F401,E501 + +class GraphOperationUserGroup(GraphOperation): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'GraphAttributes', + 'type': 'str' + } + if hasattr(GraphOperation, "swagger_types"): + swagger_types.update(GraphOperation.swagger_types) + + attribute_map = { + 'attributes': 'attributes', + 'type': 'type' + } + if hasattr(GraphOperation, "attribute_map"): + attribute_map.update(GraphOperation.attribute_map) + + def __init__(self, attributes=None, type=None, *args, **kwargs): # noqa: E501 + """GraphOperationUserGroup - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + self.type = type + GraphOperation.__init__(self, *args, **kwargs) + + @property + def attributes(self): + """Gets the attributes of this GraphOperationUserGroup. # noqa: E501 + + + :return: The attributes of this GraphOperationUserGroup. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphOperationUserGroup. + + + :param attributes: The attributes of this GraphOperationUserGroup. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def type(self): + """Gets the type of this GraphOperationUserGroup. # noqa: E501 + + Targets which a \"user_group\" can be associated to. # noqa: E501 + + :return: The type of this GraphOperationUserGroup. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GraphOperationUserGroup. + + Targets which a \"user_group\" can be associated to. # noqa: E501 + + :param type: The type of this GraphOperationUserGroup. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["active_directory", "application", "g_suite", "ldap_server", "office_365", "radius_server", "system", "system_group"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperationUserGroup, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperationUserGroup): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_operation_user_group_member.py b/jcapiv2/jcapiv2/models/graph_operation_user_group_member.py new file mode 100644 index 0000000..01fa656 --- /dev/null +++ b/jcapiv2/jcapiv2/models/graph_operation_user_group_member.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_operation import GraphOperation # noqa: F401,E501 + +class GraphOperationUserGroupMember(GraphOperation): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'GraphAttributes', + 'type': 'str' + } + if hasattr(GraphOperation, "swagger_types"): + swagger_types.update(GraphOperation.swagger_types) + + attribute_map = { + 'attributes': 'attributes', + 'type': 'type' + } + if hasattr(GraphOperation, "attribute_map"): + attribute_map.update(GraphOperation.attribute_map) + + def __init__(self, attributes=None, type=None, *args, **kwargs): # noqa: E501 + """GraphOperationUserGroupMember - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + self.type = type + GraphOperation.__init__(self, *args, **kwargs) + + @property + def attributes(self): + """Gets the attributes of this GraphOperationUserGroupMember. # noqa: E501 + + + :return: The attributes of this GraphOperationUserGroupMember. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this GraphOperationUserGroupMember. + + + :param attributes: The attributes of this GraphOperationUserGroupMember. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def type(self): + """Gets the type of this GraphOperationUserGroupMember. # noqa: E501 + + The member type. # noqa: E501 + + :return: The type of this GraphOperationUserGroupMember. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this GraphOperationUserGroupMember. + + The member type. # noqa: E501 + + :param type: The type of this GraphOperationUserGroupMember. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["user"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GraphOperationUserGroupMember, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GraphOperationUserGroupMember): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/graph_type.py b/jcapiv2/jcapiv2/models/graph_type.py index a1ecbed..c1aa218 100644 --- a/jcapiv2/jcapiv2/models/graph_type.py +++ b/jcapiv2/jcapiv2/models/graph_type.py @@ -1,22 +1,20 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class GraphType(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -33,12 +31,12 @@ class GraphType(object): LDAP_SERVER = "ldap_server" OFFICE_365 = "office_365" POLICY = "policy" + POLICY_GROUP = "policy_group" RADIUS_SERVER = "radius_server" SYSTEM = "system" SYSTEM_GROUP = "system_group" USER = "user" USER_GROUP = "user_group" - """ Attributes: swagger_types (dict): The key is attribute name diff --git a/jcapiv2/jcapiv2/models/group.py b/jcapiv2/jcapiv2/models/group.py index 8068d3e..a8e43f0 100644 --- a/jcapiv2/jcapiv2/models/group.py +++ b/jcapiv2/jcapiv2/models/group.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.group_type import GroupType # noqa: F401,E501 - - class Group(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,25 +28,38 @@ class Group(object): and the value is json key in definition. """ swagger_types = { + 'attributes': 'GraphAttributes', + 'description': 'str', + 'email': 'str', 'id': 'str', 'name': 'str', 'type': 'GroupType' } attribute_map = { + 'attributes': 'attributes', + 'description': 'description', + 'email': 'email', 'id': 'id', 'name': 'name', 'type': 'type' } - def __init__(self, id=None, name=None, type=None): # noqa: E501 + def __init__(self, attributes=None, description=None, email=None, id=None, name=None, type=None): # noqa: E501 """Group - a model defined in Swagger""" # noqa: E501 - + self._attributes = None + self._description = None + self._email = None self._id = None self._name = None self._type = None self.discriminator = None - + if attributes is not None: + self.attributes = attributes + if description is not None: + self.description = description + if email is not None: + self.email = email if id is not None: self.id = id if name is not None: @@ -59,6 +67,73 @@ def __init__(self, id=None, name=None, type=None): # noqa: E501 if type is not None: self.type = type + @property + def attributes(self): + """Gets the attributes of this Group. # noqa: E501 + + + :return: The attributes of this Group. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this Group. + + + :param attributes: The attributes of this Group. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def description(self): + """Gets the description of this Group. # noqa: E501 + + Description of a Group # noqa: E501 + + :return: The description of this Group. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this Group. + + Description of a Group # noqa: E501 + + :param description: The description of this Group. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def email(self): + """Gets the email of this Group. # noqa: E501 + + E-mail address associated with a Group # noqa: E501 + + :return: The email of this Group. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this Group. + + E-mail address associated with a Group # noqa: E501 + + :param email: The email of this Group. # noqa: E501 + :type: str + """ + + self._email = email + @property def id(self): """Gets the id of this Group. # noqa: E501 diff --git a/jcapiv2/jcapiv2/models/group_attributes_user_group.py b/jcapiv2/jcapiv2/models/group_attributes_user_group.py new file mode 100644 index 0000000..3f06645 --- /dev/null +++ b/jcapiv2/jcapiv2/models/group_attributes_user_group.py @@ -0,0 +1,220 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six +from jcapiv2.models.graph_attributes import GraphAttributes # noqa: F401,E501 + +class GroupAttributesUserGroup(GraphAttributes): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'sudo': 'GraphAttributeSudoSudo', + 'ldap_groups': 'list[LdapGroup]', + 'posix_groups': 'list[GraphAttributePosixGroupsPosixGroups]', + 'radius': 'GraphAttributeRadiusRadius', + 'samba_enabled': 'bool' + } + if hasattr(GraphAttributes, "swagger_types"): + swagger_types.update(GraphAttributes.swagger_types) + + attribute_map = { + 'sudo': 'sudo', + 'ldap_groups': 'ldapGroups', + 'posix_groups': 'posixGroups', + 'radius': 'radius', + 'samba_enabled': 'sambaEnabled' + } + if hasattr(GraphAttributes, "attribute_map"): + attribute_map.update(GraphAttributes.attribute_map) + + def __init__(self, sudo=None, ldap_groups=None, posix_groups=None, radius=None, samba_enabled=None, *args, **kwargs): # noqa: E501 + """GroupAttributesUserGroup - a model defined in Swagger""" # noqa: E501 + self._sudo = None + self._ldap_groups = None + self._posix_groups = None + self._radius = None + self._samba_enabled = None + self.discriminator = None + if sudo is not None: + self.sudo = sudo + if ldap_groups is not None: + self.ldap_groups = ldap_groups + if posix_groups is not None: + self.posix_groups = posix_groups + if radius is not None: + self.radius = radius + if samba_enabled is not None: + self.samba_enabled = samba_enabled + GraphAttributes.__init__(self, *args, **kwargs) + + @property + def sudo(self): + """Gets the sudo of this GroupAttributesUserGroup. # noqa: E501 + + + :return: The sudo of this GroupAttributesUserGroup. # noqa: E501 + :rtype: GraphAttributeSudoSudo + """ + return self._sudo + + @sudo.setter + def sudo(self, sudo): + """Sets the sudo of this GroupAttributesUserGroup. + + + :param sudo: The sudo of this GroupAttributesUserGroup. # noqa: E501 + :type: GraphAttributeSudoSudo + """ + + self._sudo = sudo + + @property + def ldap_groups(self): + """Gets the ldap_groups of this GroupAttributesUserGroup. # noqa: E501 + + + :return: The ldap_groups of this GroupAttributesUserGroup. # noqa: E501 + :rtype: list[LdapGroup] + """ + return self._ldap_groups + + @ldap_groups.setter + def ldap_groups(self, ldap_groups): + """Sets the ldap_groups of this GroupAttributesUserGroup. + + + :param ldap_groups: The ldap_groups of this GroupAttributesUserGroup. # noqa: E501 + :type: list[LdapGroup] + """ + + self._ldap_groups = ldap_groups + + @property + def posix_groups(self): + """Gets the posix_groups of this GroupAttributesUserGroup. # noqa: E501 + + + :return: The posix_groups of this GroupAttributesUserGroup. # noqa: E501 + :rtype: list[GraphAttributePosixGroupsPosixGroups] + """ + return self._posix_groups + + @posix_groups.setter + def posix_groups(self, posix_groups): + """Sets the posix_groups of this GroupAttributesUserGroup. + + + :param posix_groups: The posix_groups of this GroupAttributesUserGroup. # noqa: E501 + :type: list[GraphAttributePosixGroupsPosixGroups] + """ + + self._posix_groups = posix_groups + + @property + def radius(self): + """Gets the radius of this GroupAttributesUserGroup. # noqa: E501 + + + :return: The radius of this GroupAttributesUserGroup. # noqa: E501 + :rtype: GraphAttributeRadiusRadius + """ + return self._radius + + @radius.setter + def radius(self, radius): + """Sets the radius of this GroupAttributesUserGroup. + + + :param radius: The radius of this GroupAttributesUserGroup. # noqa: E501 + :type: GraphAttributeRadiusRadius + """ + + self._radius = radius + + @property + def samba_enabled(self): + """Gets the samba_enabled of this GroupAttributesUserGroup. # noqa: E501 + + + :return: The samba_enabled of this GroupAttributesUserGroup. # noqa: E501 + :rtype: bool + """ + return self._samba_enabled + + @samba_enabled.setter + def samba_enabled(self, samba_enabled): + """Sets the samba_enabled of this GroupAttributesUserGroup. + + + :param samba_enabled: The samba_enabled of this GroupAttributesUserGroup. # noqa: E501 + :type: bool + """ + + self._samba_enabled = samba_enabled + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GroupAttributesUserGroup, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GroupAttributesUserGroup): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/group_id_suggestions_body.py b/jcapiv2/jcapiv2/models/group_id_suggestions_body.py new file mode 100644 index 0000000..609877d --- /dev/null +++ b/jcapiv2/jcapiv2/models/group_id_suggestions_body.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GroupIdSuggestionsBody(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'user_ids': 'list[str]' + } + + attribute_map = { + 'user_ids': 'user_ids' + } + + def __init__(self, user_ids=None): # noqa: E501 + """GroupIdSuggestionsBody - a model defined in Swagger""" # noqa: E501 + self._user_ids = None + self.discriminator = None + if user_ids is not None: + self.user_ids = user_ids + + @property + def user_ids(self): + """Gets the user_ids of this GroupIdSuggestionsBody. # noqa: E501 + + + :return: The user_ids of this GroupIdSuggestionsBody. # noqa: E501 + :rtype: list[str] + """ + return self._user_ids + + @user_ids.setter + def user_ids(self, user_ids): + """Sets the user_ids of this GroupIdSuggestionsBody. + + + :param user_ids: The user_ids of this GroupIdSuggestionsBody. # noqa: E501 + :type: list[str] + """ + + self._user_ids = user_ids + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GroupIdSuggestionsBody, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GroupIdSuggestionsBody): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/group_type.py b/jcapiv2/jcapiv2/models/group_type.py index 4c1d2b3..5f5f449 100644 --- a/jcapiv2/jcapiv2/models/group_type.py +++ b/jcapiv2/jcapiv2/models/group_type.py @@ -1,22 +1,20 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class GroupType(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -26,9 +24,9 @@ class GroupType(object): """ allowed enum values """ + POLICY_GROUP = "policy_group" SYSTEM_GROUP = "system_group" USER_GROUP = "user_group" - """ Attributes: swagger_types (dict): The key is attribute name diff --git a/jcapiv2/jcapiv2/models/gsuite_output.py b/jcapiv2/jcapiv2/models/gsuite_output.py index f0d8d6e..ef890f8 100644 --- a/jcapiv2/jcapiv2/models/gsuite_output.py +++ b/jcapiv2/jcapiv2/models/gsuite_output.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class GsuiteOutput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,32 +28,61 @@ class GsuiteOutput(object): and the value is json key in definition. """ swagger_types = { + 'groups_enabled': 'bool', 'id': 'str', + 'name': 'str', 'user_lockout_action': 'str', 'user_password_expiration_action': 'str' } attribute_map = { + 'groups_enabled': 'groupsEnabled', 'id': 'id', + 'name': 'name', 'user_lockout_action': 'userLockoutAction', 'user_password_expiration_action': 'userPasswordExpirationAction' } - def __init__(self, id=None, user_lockout_action=None, user_password_expiration_action=None): # noqa: E501 + def __init__(self, groups_enabled=None, id=None, name=None, user_lockout_action=None, user_password_expiration_action=None): # noqa: E501 """GsuiteOutput - a model defined in Swagger""" # noqa: E501 - + self._groups_enabled = None self._id = None + self._name = None self._user_lockout_action = None self._user_password_expiration_action = None self.discriminator = None - + if groups_enabled is not None: + self.groups_enabled = groups_enabled if id is not None: self.id = id + if name is not None: + self.name = name if user_lockout_action is not None: self.user_lockout_action = user_lockout_action if user_password_expiration_action is not None: self.user_password_expiration_action = user_password_expiration_action + @property + def groups_enabled(self): + """Gets the groups_enabled of this GsuiteOutput. # noqa: E501 + + + :return: The groups_enabled of this GsuiteOutput. # noqa: E501 + :rtype: bool + """ + return self._groups_enabled + + @groups_enabled.setter + def groups_enabled(self, groups_enabled): + """Sets the groups_enabled of this GsuiteOutput. + + + :param groups_enabled: The groups_enabled of this GsuiteOutput. # noqa: E501 + :type: bool + """ + + self._groups_enabled = groups_enabled + @property def id(self): """Gets the id of this GsuiteOutput. # noqa: E501 @@ -78,6 +104,27 @@ def id(self, id): self._id = id + @property + def name(self): + """Gets the name of this GsuiteOutput. # noqa: E501 + + + :return: The name of this GsuiteOutput. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this GsuiteOutput. + + + :param name: The name of this GsuiteOutput. # noqa: E501 + :type: str + """ + + self._name = name + @property def user_lockout_action(self): """Gets the user_lockout_action of this GsuiteOutput. # noqa: E501 @@ -123,7 +170,7 @@ def user_password_expiration_action(self, user_password_expiration_action): :param user_password_expiration_action: The user_password_expiration_action of this GsuiteOutput. # noqa: E501 :type: str """ - allowed_values = ["suspend", "maintain"] # noqa: E501 + allowed_values = ["suspend", "maintain", "remove_access"] # noqa: E501 if user_password_expiration_action not in allowed_values: raise ValueError( "Invalid value for `user_password_expiration_action` ({0}), must be one of {1}" # noqa: E501 diff --git a/jcapiv2/jcapiv2/models/gsuite_patch_input.py b/jcapiv2/jcapiv2/models/gsuite_patch_input.py index e157012..fb26b4b 100644 --- a/jcapiv2/jcapiv2/models/gsuite_patch_input.py +++ b/jcapiv2/jcapiv2/models/gsuite_patch_input.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class GsuitePatchInput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,27 +28,77 @@ class GsuitePatchInput(object): and the value is json key in definition. """ swagger_types = { + 'groups_enabled': 'bool', + 'name': 'str', 'user_lockout_action': 'str', 'user_password_expiration_action': 'str' } attribute_map = { + 'groups_enabled': 'groupsEnabled', + 'name': 'name', 'user_lockout_action': 'userLockoutAction', 'user_password_expiration_action': 'userPasswordExpirationAction' } - def __init__(self, user_lockout_action=None, user_password_expiration_action=None): # noqa: E501 + def __init__(self, groups_enabled=None, name=None, user_lockout_action=None, user_password_expiration_action=None): # noqa: E501 """GsuitePatchInput - a model defined in Swagger""" # noqa: E501 - + self._groups_enabled = None + self._name = None self._user_lockout_action = None self._user_password_expiration_action = None self.discriminator = None - + if groups_enabled is not None: + self.groups_enabled = groups_enabled + if name is not None: + self.name = name if user_lockout_action is not None: self.user_lockout_action = user_lockout_action if user_password_expiration_action is not None: self.user_password_expiration_action = user_password_expiration_action + @property + def groups_enabled(self): + """Gets the groups_enabled of this GsuitePatchInput. # noqa: E501 + + + :return: The groups_enabled of this GsuitePatchInput. # noqa: E501 + :rtype: bool + """ + return self._groups_enabled + + @groups_enabled.setter + def groups_enabled(self, groups_enabled): + """Sets the groups_enabled of this GsuitePatchInput. + + + :param groups_enabled: The groups_enabled of this GsuitePatchInput. # noqa: E501 + :type: bool + """ + + self._groups_enabled = groups_enabled + + @property + def name(self): + """Gets the name of this GsuitePatchInput. # noqa: E501 + + + :return: The name of this GsuitePatchInput. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this GsuitePatchInput. + + + :param name: The name of this GsuitePatchInput. # noqa: E501 + :type: str + """ + + self._name = name + @property def user_lockout_action(self): """Gets the user_lockout_action of this GsuitePatchInput. # noqa: E501 @@ -97,7 +144,7 @@ def user_password_expiration_action(self, user_password_expiration_action): :param user_password_expiration_action: The user_password_expiration_action of this GsuitePatchInput. # noqa: E501 :type: str """ - allowed_values = ["suspend", "maintain"] # noqa: E501 + allowed_values = ["suspend", "maintain", "remove_access"] # noqa: E501 if user_password_expiration_action not in allowed_values: raise ValueError( "Invalid value for `user_password_expiration_action` ({0}), must be one of {1}" # noqa: E501 diff --git a/jcapiv2/jcapiv2/models/import_user.py b/jcapiv2/jcapiv2/models/import_user.py new file mode 100644 index 0000000..9fdd169 --- /dev/null +++ b/jcapiv2/jcapiv2/models/import_user.py @@ -0,0 +1,526 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ImportUser(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'addresses': 'list[ImportUserAddress]', + 'company': 'str', + 'cost_center': 'str', + 'department': 'str', + 'displayname': 'str', + 'email': 'str', + 'employee_identifier': 'str', + 'employee_type': 'str', + 'firstname': 'str', + 'id': 'str', + 'job_title': 'str', + 'lastname': 'str', + 'location': 'str', + 'manager': 'str', + 'middlename': 'str', + 'phone_numbers': 'list[ImportUserPhoneNumber]', + 'username': 'str' + } + + attribute_map = { + 'addresses': 'addresses', + 'company': 'company', + 'cost_center': 'costCenter', + 'department': 'department', + 'displayname': 'displayname', + 'email': 'email', + 'employee_identifier': 'employeeIdentifier', + 'employee_type': 'employeeType', + 'firstname': 'firstname', + 'id': 'id', + 'job_title': 'jobTitle', + 'lastname': 'lastname', + 'location': 'location', + 'manager': 'manager', + 'middlename': 'middlename', + 'phone_numbers': 'phoneNumbers', + 'username': 'username' + } + + def __init__(self, addresses=None, company=None, cost_center=None, department=None, displayname=None, email=None, employee_identifier=None, employee_type=None, firstname=None, id=None, job_title=None, lastname=None, location=None, manager=None, middlename=None, phone_numbers=None, username=None): # noqa: E501 + """ImportUser - a model defined in Swagger""" # noqa: E501 + self._addresses = None + self._company = None + self._cost_center = None + self._department = None + self._displayname = None + self._email = None + self._employee_identifier = None + self._employee_type = None + self._firstname = None + self._id = None + self._job_title = None + self._lastname = None + self._location = None + self._manager = None + self._middlename = None + self._phone_numbers = None + self._username = None + self.discriminator = None + if addresses is not None: + self.addresses = addresses + if company is not None: + self.company = company + if cost_center is not None: + self.cost_center = cost_center + if department is not None: + self.department = department + if displayname is not None: + self.displayname = displayname + if email is not None: + self.email = email + if employee_identifier is not None: + self.employee_identifier = employee_identifier + if employee_type is not None: + self.employee_type = employee_type + if firstname is not None: + self.firstname = firstname + if id is not None: + self.id = id + if job_title is not None: + self.job_title = job_title + if lastname is not None: + self.lastname = lastname + if location is not None: + self.location = location + if manager is not None: + self.manager = manager + if middlename is not None: + self.middlename = middlename + if phone_numbers is not None: + self.phone_numbers = phone_numbers + if username is not None: + self.username = username + + @property + def addresses(self): + """Gets the addresses of this ImportUser. # noqa: E501 + + + :return: The addresses of this ImportUser. # noqa: E501 + :rtype: list[ImportUserAddress] + """ + return self._addresses + + @addresses.setter + def addresses(self, addresses): + """Sets the addresses of this ImportUser. + + + :param addresses: The addresses of this ImportUser. # noqa: E501 + :type: list[ImportUserAddress] + """ + + self._addresses = addresses + + @property + def company(self): + """Gets the company of this ImportUser. # noqa: E501 + + + :return: The company of this ImportUser. # noqa: E501 + :rtype: str + """ + return self._company + + @company.setter + def company(self, company): + """Sets the company of this ImportUser. + + + :param company: The company of this ImportUser. # noqa: E501 + :type: str + """ + + self._company = company + + @property + def cost_center(self): + """Gets the cost_center of this ImportUser. # noqa: E501 + + + :return: The cost_center of this ImportUser. # noqa: E501 + :rtype: str + """ + return self._cost_center + + @cost_center.setter + def cost_center(self, cost_center): + """Sets the cost_center of this ImportUser. + + + :param cost_center: The cost_center of this ImportUser. # noqa: E501 + :type: str + """ + + self._cost_center = cost_center + + @property + def department(self): + """Gets the department of this ImportUser. # noqa: E501 + + + :return: The department of this ImportUser. # noqa: E501 + :rtype: str + """ + return self._department + + @department.setter + def department(self, department): + """Sets the department of this ImportUser. + + + :param department: The department of this ImportUser. # noqa: E501 + :type: str + """ + + self._department = department + + @property + def displayname(self): + """Gets the displayname of this ImportUser. # noqa: E501 + + + :return: The displayname of this ImportUser. # noqa: E501 + :rtype: str + """ + return self._displayname + + @displayname.setter + def displayname(self, displayname): + """Sets the displayname of this ImportUser. + + + :param displayname: The displayname of this ImportUser. # noqa: E501 + :type: str + """ + + self._displayname = displayname + + @property + def email(self): + """Gets the email of this ImportUser. # noqa: E501 + + + :return: The email of this ImportUser. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this ImportUser. + + + :param email: The email of this ImportUser. # noqa: E501 + :type: str + """ + + self._email = email + + @property + def employee_identifier(self): + """Gets the employee_identifier of this ImportUser. # noqa: E501 + + + :return: The employee_identifier of this ImportUser. # noqa: E501 + :rtype: str + """ + return self._employee_identifier + + @employee_identifier.setter + def employee_identifier(self, employee_identifier): + """Sets the employee_identifier of this ImportUser. + + + :param employee_identifier: The employee_identifier of this ImportUser. # noqa: E501 + :type: str + """ + + self._employee_identifier = employee_identifier + + @property + def employee_type(self): + """Gets the employee_type of this ImportUser. # noqa: E501 + + + :return: The employee_type of this ImportUser. # noqa: E501 + :rtype: str + """ + return self._employee_type + + @employee_type.setter + def employee_type(self, employee_type): + """Sets the employee_type of this ImportUser. + + + :param employee_type: The employee_type of this ImportUser. # noqa: E501 + :type: str + """ + + self._employee_type = employee_type + + @property + def firstname(self): + """Gets the firstname of this ImportUser. # noqa: E501 + + + :return: The firstname of this ImportUser. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this ImportUser. + + + :param firstname: The firstname of this ImportUser. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def id(self): + """Gets the id of this ImportUser. # noqa: E501 + + + :return: The id of this ImportUser. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImportUser. + + + :param id: The id of this ImportUser. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def job_title(self): + """Gets the job_title of this ImportUser. # noqa: E501 + + + :return: The job_title of this ImportUser. # noqa: E501 + :rtype: str + """ + return self._job_title + + @job_title.setter + def job_title(self, job_title): + """Sets the job_title of this ImportUser. + + + :param job_title: The job_title of this ImportUser. # noqa: E501 + :type: str + """ + + self._job_title = job_title + + @property + def lastname(self): + """Gets the lastname of this ImportUser. # noqa: E501 + + + :return: The lastname of this ImportUser. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this ImportUser. + + + :param lastname: The lastname of this ImportUser. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def location(self): + """Gets the location of this ImportUser. # noqa: E501 + + + :return: The location of this ImportUser. # noqa: E501 + :rtype: str + """ + return self._location + + @location.setter + def location(self, location): + """Sets the location of this ImportUser. + + + :param location: The location of this ImportUser. # noqa: E501 + :type: str + """ + + self._location = location + + @property + def manager(self): + """Gets the manager of this ImportUser. # noqa: E501 + + + :return: The manager of this ImportUser. # noqa: E501 + :rtype: str + """ + return self._manager + + @manager.setter + def manager(self, manager): + """Sets the manager of this ImportUser. + + + :param manager: The manager of this ImportUser. # noqa: E501 + :type: str + """ + + self._manager = manager + + @property + def middlename(self): + """Gets the middlename of this ImportUser. # noqa: E501 + + + :return: The middlename of this ImportUser. # noqa: E501 + :rtype: str + """ + return self._middlename + + @middlename.setter + def middlename(self, middlename): + """Sets the middlename of this ImportUser. + + + :param middlename: The middlename of this ImportUser. # noqa: E501 + :type: str + """ + + self._middlename = middlename + + @property + def phone_numbers(self): + """Gets the phone_numbers of this ImportUser. # noqa: E501 + + + :return: The phone_numbers of this ImportUser. # noqa: E501 + :rtype: list[ImportUserPhoneNumber] + """ + return self._phone_numbers + + @phone_numbers.setter + def phone_numbers(self, phone_numbers): + """Sets the phone_numbers of this ImportUser. + + + :param phone_numbers: The phone_numbers of this ImportUser. # noqa: E501 + :type: list[ImportUserPhoneNumber] + """ + + self._phone_numbers = phone_numbers + + @property + def username(self): + """Gets the username of this ImportUser. # noqa: E501 + + + :return: The username of this ImportUser. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this ImportUser. + + + :param username: The username of this ImportUser. # noqa: E501 + :type: str + """ + + self._username = username + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ImportUser, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ImportUser): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/import_user_address.py b/jcapiv2/jcapiv2/models/import_user_address.py new file mode 100644 index 0000000..5e0eec9 --- /dev/null +++ b/jcapiv2/jcapiv2/models/import_user_address.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ImportUserAddress(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'country': 'str', + 'locality': 'str', + 'postal_code': 'str', + 'region': 'str', + 'street_address': 'str', + 'type': 'str' + } + + attribute_map = { + 'country': 'country', + 'locality': 'locality', + 'postal_code': 'postalCode', + 'region': 'region', + 'street_address': 'streetAddress', + 'type': 'type' + } + + def __init__(self, country=None, locality=None, postal_code=None, region=None, street_address=None, type=None): # noqa: E501 + """ImportUserAddress - a model defined in Swagger""" # noqa: E501 + self._country = None + self._locality = None + self._postal_code = None + self._region = None + self._street_address = None + self._type = None + self.discriminator = None + if country is not None: + self.country = country + if locality is not None: + self.locality = locality + if postal_code is not None: + self.postal_code = postal_code + if region is not None: + self.region = region + if street_address is not None: + self.street_address = street_address + if type is not None: + self.type = type + + @property + def country(self): + """Gets the country of this ImportUserAddress. # noqa: E501 + + + :return: The country of this ImportUserAddress. # noqa: E501 + :rtype: str + """ + return self._country + + @country.setter + def country(self, country): + """Sets the country of this ImportUserAddress. + + + :param country: The country of this ImportUserAddress. # noqa: E501 + :type: str + """ + + self._country = country + + @property + def locality(self): + """Gets the locality of this ImportUserAddress. # noqa: E501 + + + :return: The locality of this ImportUserAddress. # noqa: E501 + :rtype: str + """ + return self._locality + + @locality.setter + def locality(self, locality): + """Sets the locality of this ImportUserAddress. + + + :param locality: The locality of this ImportUserAddress. # noqa: E501 + :type: str + """ + + self._locality = locality + + @property + def postal_code(self): + """Gets the postal_code of this ImportUserAddress. # noqa: E501 + + + :return: The postal_code of this ImportUserAddress. # noqa: E501 + :rtype: str + """ + return self._postal_code + + @postal_code.setter + def postal_code(self, postal_code): + """Sets the postal_code of this ImportUserAddress. + + + :param postal_code: The postal_code of this ImportUserAddress. # noqa: E501 + :type: str + """ + + self._postal_code = postal_code + + @property + def region(self): + """Gets the region of this ImportUserAddress. # noqa: E501 + + + :return: The region of this ImportUserAddress. # noqa: E501 + :rtype: str + """ + return self._region + + @region.setter + def region(self, region): + """Sets the region of this ImportUserAddress. + + + :param region: The region of this ImportUserAddress. # noqa: E501 + :type: str + """ + + self._region = region + + @property + def street_address(self): + """Gets the street_address of this ImportUserAddress. # noqa: E501 + + + :return: The street_address of this ImportUserAddress. # noqa: E501 + :rtype: str + """ + return self._street_address + + @street_address.setter + def street_address(self, street_address): + """Sets the street_address of this ImportUserAddress. + + + :param street_address: The street_address of this ImportUserAddress. # noqa: E501 + :type: str + """ + + self._street_address = street_address + + @property + def type(self): + """Gets the type of this ImportUserAddress. # noqa: E501 + + + :return: The type of this ImportUserAddress. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ImportUserAddress. + + + :param type: The type of this ImportUserAddress. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ImportUserAddress, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ImportUserAddress): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/import_user_phone_number.py b/jcapiv2/jcapiv2/models/import_user_phone_number.py new file mode 100644 index 0000000..f86cc5a --- /dev/null +++ b/jcapiv2/jcapiv2/models/import_user_phone_number.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ImportUserPhoneNumber(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'type': 'str', + 'value': 'str' + } + + attribute_map = { + 'type': 'type', + 'value': 'value' + } + + def __init__(self, type=None, value=None): # noqa: E501 + """ImportUserPhoneNumber - a model defined in Swagger""" # noqa: E501 + self._type = None + self._value = None + self.discriminator = None + if type is not None: + self.type = type + if value is not None: + self.value = value + + @property + def type(self): + """Gets the type of this ImportUserPhoneNumber. # noqa: E501 + + + :return: The type of this ImportUserPhoneNumber. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ImportUserPhoneNumber. + + + :param type: The type of this ImportUserPhoneNumber. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def value(self): + """Gets the value of this ImportUserPhoneNumber. # noqa: E501 + + + :return: The value of this ImportUserPhoneNumber. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this ImportUserPhoneNumber. + + + :param value: The value of this ImportUserPhoneNumber. # noqa: E501 + :type: str + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ImportUserPhoneNumber, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ImportUserPhoneNumber): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/import_users_response.py b/jcapiv2/jcapiv2/models/import_users_response.py new file mode 100644 index 0000000..39997f2 --- /dev/null +++ b/jcapiv2/jcapiv2/models/import_users_response.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ImportUsersResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'total_count': 'float', + 'users': 'list[ImportUser]' + } + + attribute_map = { + 'total_count': 'total_count', + 'users': 'users' + } + + def __init__(self, total_count=None, users=None): # noqa: E501 + """ImportUsersResponse - a model defined in Swagger""" # noqa: E501 + self._total_count = None + self._users = None + self.discriminator = None + if total_count is not None: + self.total_count = total_count + if users is not None: + self.users = users + + @property + def total_count(self): + """Gets the total_count of this ImportUsersResponse. # noqa: E501 + + + :return: The total_count of this ImportUsersResponse. # noqa: E501 + :rtype: float + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this ImportUsersResponse. + + + :param total_count: The total_count of this ImportUsersResponse. # noqa: E501 + :type: float + """ + + self._total_count = total_count + + @property + def users(self): + """Gets the users of this ImportUsersResponse. # noqa: E501 + + + :return: The users of this ImportUsersResponse. # noqa: E501 + :rtype: list[ImportUser] + """ + return self._users + + @users.setter + def users(self, users): + """Sets the users of this ImportUsersResponse. + + + :param users: The users of this ImportUsersResponse. # noqa: E501 + :type: list[ImportUser] + """ + + self._users = users + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ImportUsersResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ImportUsersResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/inline_response200.py b/jcapiv2/jcapiv2/models/inline_response200.py index 8774d00..97761a8 100644 --- a/jcapiv2/jcapiv2/models/inline_response200.py +++ b/jcapiv2/jcapiv2/models/inline_response200.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.ldap_server_action import LdapServerAction # noqa: F401,E501 - - class InlineResponse200(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,120 +28,66 @@ class InlineResponse200(object): and the value is json key in definition. """ swagger_types = { - 'id': 'str', - 'name': 'str', - 'user_lockout_action': 'LdapServerAction', - 'user_password_expiration_action': 'LdapServerAction' + 'events_count': 'int', + 'results': 'list[ScheduledUserstateResult]' } attribute_map = { - 'id': 'id', - 'name': 'name', - 'user_lockout_action': 'userLockoutAction', - 'user_password_expiration_action': 'userPasswordExpirationAction' + 'events_count': 'events_count', + 'results': 'results' } - def __init__(self, id=None, name=None, user_lockout_action=None, user_password_expiration_action=None): # noqa: E501 + def __init__(self, events_count=None, results=None): # noqa: E501 """InlineResponse200 - a model defined in Swagger""" # noqa: E501 - - self._id = None - self._name = None - self._user_lockout_action = None - self._user_password_expiration_action = None + self._events_count = None + self._results = None self.discriminator = None - - if id is not None: - self.id = id - if name is not None: - self.name = name - if user_lockout_action is not None: - self.user_lockout_action = user_lockout_action - if user_password_expiration_action is not None: - self.user_password_expiration_action = user_password_expiration_action - - @property - def id(self): - """Gets the id of this InlineResponse200. # noqa: E501 - - - :return: The id of this InlineResponse200. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this InlineResponse200. - - - :param id: The id of this InlineResponse200. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def name(self): - """Gets the name of this InlineResponse200. # noqa: E501 - - - :return: The name of this InlineResponse200. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this InlineResponse200. - - - :param name: The name of this InlineResponse200. # noqa: E501 - :type: str - """ - - self._name = name + if events_count is not None: + self.events_count = events_count + if results is not None: + self.results = results @property - def user_lockout_action(self): - """Gets the user_lockout_action of this InlineResponse200. # noqa: E501 + def events_count(self): + """Gets the events_count of this InlineResponse200. # noqa: E501 - :return: The user_lockout_action of this InlineResponse200. # noqa: E501 - :rtype: LdapServerAction + :return: The events_count of this InlineResponse200. # noqa: E501 + :rtype: int """ - return self._user_lockout_action + return self._events_count - @user_lockout_action.setter - def user_lockout_action(self, user_lockout_action): - """Sets the user_lockout_action of this InlineResponse200. + @events_count.setter + def events_count(self, events_count): + """Sets the events_count of this InlineResponse200. - :param user_lockout_action: The user_lockout_action of this InlineResponse200. # noqa: E501 - :type: LdapServerAction + :param events_count: The events_count of this InlineResponse200. # noqa: E501 + :type: int """ - self._user_lockout_action = user_lockout_action + self._events_count = events_count @property - def user_password_expiration_action(self): - """Gets the user_password_expiration_action of this InlineResponse200. # noqa: E501 + def results(self): + """Gets the results of this InlineResponse200. # noqa: E501 - :return: The user_password_expiration_action of this InlineResponse200. # noqa: E501 - :rtype: LdapServerAction + :return: The results of this InlineResponse200. # noqa: E501 + :rtype: list[ScheduledUserstateResult] """ - return self._user_password_expiration_action + return self._results - @user_password_expiration_action.setter - def user_password_expiration_action(self, user_password_expiration_action): - """Sets the user_password_expiration_action of this InlineResponse200. + @results.setter + def results(self, results): + """Sets the results of this InlineResponse200. - :param user_password_expiration_action: The user_password_expiration_action of this InlineResponse200. # noqa: E501 - :type: LdapServerAction + :param results: The results of this InlineResponse200. # noqa: E501 + :type: list[ScheduledUserstateResult] """ - self._user_password_expiration_action = user_password_expiration_action + self._results = results def to_dict(self): """Returns the model properties as a dict""" diff --git a/jcapiv2/jcapiv2/models/inline_response2001.py b/jcapiv2/jcapiv2/models/inline_response2001.py index fbe8bd4..b5d4af8 100644 --- a/jcapiv2/jcapiv2/models/inline_response2001.py +++ b/jcapiv2/jcapiv2/models/inline_response2001.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.administrator import Administrator # noqa: F401,E501 - - class InlineResponse2001(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,68 +28,66 @@ class InlineResponse2001(object): and the value is json key in definition. """ swagger_types = { - 'results': 'list[Administrator]', - 'total_count': 'int' + 'next_page_token': 'str', + 'users': 'list[User]' } attribute_map = { - 'results': 'results', - 'total_count': 'totalCount' + 'next_page_token': 'nextPageToken', + 'users': 'users' } - def __init__(self, results=None, total_count=None): # noqa: E501 + def __init__(self, next_page_token=None, users=None): # noqa: E501 """InlineResponse2001 - a model defined in Swagger""" # noqa: E501 - - self._results = None - self._total_count = None + self._next_page_token = None + self._users = None self.discriminator = None - - if results is not None: - self.results = results - if total_count is not None: - self.total_count = total_count + if next_page_token is not None: + self.next_page_token = next_page_token + if users is not None: + self.users = users @property - def results(self): - """Gets the results of this InlineResponse2001. # noqa: E501 + def next_page_token(self): + """Gets the next_page_token of this InlineResponse2001. # noqa: E501 - :return: The results of this InlineResponse2001. # noqa: E501 - :rtype: list[Administrator] + :return: The next_page_token of this InlineResponse2001. # noqa: E501 + :rtype: str """ - return self._results + return self._next_page_token - @results.setter - def results(self, results): - """Sets the results of this InlineResponse2001. + @next_page_token.setter + def next_page_token(self, next_page_token): + """Sets the next_page_token of this InlineResponse2001. - :param results: The results of this InlineResponse2001. # noqa: E501 - :type: list[Administrator] + :param next_page_token: The next_page_token of this InlineResponse2001. # noqa: E501 + :type: str """ - self._results = results + self._next_page_token = next_page_token @property - def total_count(self): - """Gets the total_count of this InlineResponse2001. # noqa: E501 + def users(self): + """Gets the users of this InlineResponse2001. # noqa: E501 - :return: The total_count of this InlineResponse2001. # noqa: E501 - :rtype: int + :return: The users of this InlineResponse2001. # noqa: E501 + :rtype: list[User] """ - return self._total_count + return self._users - @total_count.setter - def total_count(self, total_count): - """Sets the total_count of this InlineResponse2001. + @users.setter + def users(self, users): + """Sets the users of this InlineResponse2001. - :param total_count: The total_count of this InlineResponse2001. # noqa: E501 - :type: int + :param users: The users of this InlineResponse2001. # noqa: E501 + :type: list[User] """ - self._total_count = total_count + self._users = users def to_dict(self): """Returns the model properties as a dict""" diff --git a/jcapiv2/jcapiv2/models/inline_response20010.py b/jcapiv2/jcapiv2/models/inline_response20010.py new file mode 100644 index 0000000..712f47b --- /dev/null +++ b/jcapiv2/jcapiv2/models/inline_response20010.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class InlineResponse20010(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str', + 'user_lockout_action': 'LdapServerAction', + 'user_password_expiration_action': 'LdapServerAction' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'user_lockout_action': 'userLockoutAction', + 'user_password_expiration_action': 'userPasswordExpirationAction' + } + + def __init__(self, id=None, name=None, user_lockout_action=None, user_password_expiration_action=None): # noqa: E501 + """InlineResponse20010 - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._user_lockout_action = None + self._user_password_expiration_action = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + if user_lockout_action is not None: + self.user_lockout_action = user_lockout_action + if user_password_expiration_action is not None: + self.user_password_expiration_action = user_password_expiration_action + + @property + def id(self): + """Gets the id of this InlineResponse20010. # noqa: E501 + + + :return: The id of this InlineResponse20010. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this InlineResponse20010. + + + :param id: The id of this InlineResponse20010. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this InlineResponse20010. # noqa: E501 + + + :return: The name of this InlineResponse20010. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this InlineResponse20010. + + + :param name: The name of this InlineResponse20010. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def user_lockout_action(self): + """Gets the user_lockout_action of this InlineResponse20010. # noqa: E501 + + + :return: The user_lockout_action of this InlineResponse20010. # noqa: E501 + :rtype: LdapServerAction + """ + return self._user_lockout_action + + @user_lockout_action.setter + def user_lockout_action(self, user_lockout_action): + """Sets the user_lockout_action of this InlineResponse20010. + + + :param user_lockout_action: The user_lockout_action of this InlineResponse20010. # noqa: E501 + :type: LdapServerAction + """ + + self._user_lockout_action = user_lockout_action + + @property + def user_password_expiration_action(self): + """Gets the user_password_expiration_action of this InlineResponse20010. # noqa: E501 + + + :return: The user_password_expiration_action of this InlineResponse20010. # noqa: E501 + :rtype: LdapServerAction + """ + return self._user_password_expiration_action + + @user_password_expiration_action.setter + def user_password_expiration_action(self, user_password_expiration_action): + """Sets the user_password_expiration_action of this InlineResponse20010. + + + :param user_password_expiration_action: The user_password_expiration_action of this InlineResponse20010. # noqa: E501 + :type: LdapServerAction + """ + + self._user_password_expiration_action = user_password_expiration_action + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InlineResponse20010, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse20010): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/inline_response20011.py b/jcapiv2/jcapiv2/models/inline_response20011.py new file mode 100644 index 0000000..f99fbae --- /dev/null +++ b/jcapiv2/jcapiv2/models/inline_response20011.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class InlineResponse20011(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'skip_token': 'str', + 'top': 'int', + 'users': 'list[InlineResponse20011Users]' + } + + attribute_map = { + 'skip_token': 'skipToken', + 'top': 'top', + 'users': 'users' + } + + def __init__(self, skip_token=None, top=None, users=None): # noqa: E501 + """InlineResponse20011 - a model defined in Swagger""" # noqa: E501 + self._skip_token = None + self._top = None + self._users = None + self.discriminator = None + if skip_token is not None: + self.skip_token = skip_token + if top is not None: + self.top = top + if users is not None: + self.users = users + + @property + def skip_token(self): + """Gets the skip_token of this InlineResponse20011. # noqa: E501 + + + :return: The skip_token of this InlineResponse20011. # noqa: E501 + :rtype: str + """ + return self._skip_token + + @skip_token.setter + def skip_token(self, skip_token): + """Sets the skip_token of this InlineResponse20011. + + + :param skip_token: The skip_token of this InlineResponse20011. # noqa: E501 + :type: str + """ + + self._skip_token = skip_token + + @property + def top(self): + """Gets the top of this InlineResponse20011. # noqa: E501 + + + :return: The top of this InlineResponse20011. # noqa: E501 + :rtype: int + """ + return self._top + + @top.setter + def top(self, top): + """Sets the top of this InlineResponse20011. + + + :param top: The top of this InlineResponse20011. # noqa: E501 + :type: int + """ + + self._top = top + + @property + def users(self): + """Gets the users of this InlineResponse20011. # noqa: E501 + + + :return: The users of this InlineResponse20011. # noqa: E501 + :rtype: list[InlineResponse20011Users] + """ + return self._users + + @users.setter + def users(self, users): + """Sets the users of this InlineResponse20011. + + + :param users: The users of this InlineResponse20011. # noqa: E501 + :type: list[InlineResponse20011Users] + """ + + self._users = users + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InlineResponse20011, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse20011): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/inline_response20011_users.py b/jcapiv2/jcapiv2/models/inline_response20011_users.py new file mode 100644 index 0000000..4e366cc --- /dev/null +++ b/jcapiv2/jcapiv2/models/inline_response20011_users.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class InlineResponse20011Users(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'given_name': 'str', + 'id': 'str', + 'surname': 'str', + 'user_principal_name': 'str' + } + + attribute_map = { + 'given_name': 'givenName', + 'id': 'id', + 'surname': 'surname', + 'user_principal_name': 'userPrincipalName' + } + + def __init__(self, given_name=None, id=None, surname=None, user_principal_name=None): # noqa: E501 + """InlineResponse20011Users - a model defined in Swagger""" # noqa: E501 + self._given_name = None + self._id = None + self._surname = None + self._user_principal_name = None + self.discriminator = None + if given_name is not None: + self.given_name = given_name + if id is not None: + self.id = id + if surname is not None: + self.surname = surname + if user_principal_name is not None: + self.user_principal_name = user_principal_name + + @property + def given_name(self): + """Gets the given_name of this InlineResponse20011Users. # noqa: E501 + + + :return: The given_name of this InlineResponse20011Users. # noqa: E501 + :rtype: str + """ + return self._given_name + + @given_name.setter + def given_name(self, given_name): + """Sets the given_name of this InlineResponse20011Users. + + + :param given_name: The given_name of this InlineResponse20011Users. # noqa: E501 + :type: str + """ + + self._given_name = given_name + + @property + def id(self): + """Gets the id of this InlineResponse20011Users. # noqa: E501 + + + :return: The id of this InlineResponse20011Users. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this InlineResponse20011Users. + + + :param id: The id of this InlineResponse20011Users. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def surname(self): + """Gets the surname of this InlineResponse20011Users. # noqa: E501 + + + :return: The surname of this InlineResponse20011Users. # noqa: E501 + :rtype: str + """ + return self._surname + + @surname.setter + def surname(self, surname): + """Sets the surname of this InlineResponse20011Users. + + + :param surname: The surname of this InlineResponse20011Users. # noqa: E501 + :type: str + """ + + self._surname = surname + + @property + def user_principal_name(self): + """Gets the user_principal_name of this InlineResponse20011Users. # noqa: E501 + + + :return: The user_principal_name of this InlineResponse20011Users. # noqa: E501 + :rtype: str + """ + return self._user_principal_name + + @user_principal_name.setter + def user_principal_name(self, user_principal_name): + """Sets the user_principal_name of this InlineResponse20011Users. + + + :param user_principal_name: The user_principal_name of this InlineResponse20011Users. # noqa: E501 + :type: str + """ + + self._user_principal_name = user_principal_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InlineResponse20011Users, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse20011Users): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/inline_response20012.py b/jcapiv2/jcapiv2/models/inline_response20012.py new file mode 100644 index 0000000..ff07712 --- /dev/null +++ b/jcapiv2/jcapiv2/models/inline_response20012.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class InlineResponse20012(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[Administrator]', + 'total_count': 'int' + } + + attribute_map = { + 'results': 'results', + 'total_count': 'totalCount' + } + + def __init__(self, results=None, total_count=None): # noqa: E501 + """InlineResponse20012 - a model defined in Swagger""" # noqa: E501 + self._results = None + self._total_count = None + self.discriminator = None + if results is not None: + self.results = results + if total_count is not None: + self.total_count = total_count + + @property + def results(self): + """Gets the results of this InlineResponse20012. # noqa: E501 + + + :return: The results of this InlineResponse20012. # noqa: E501 + :rtype: list[Administrator] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this InlineResponse20012. + + + :param results: The results of this InlineResponse20012. # noqa: E501 + :type: list[Administrator] + """ + + self._results = results + + @property + def total_count(self): + """Gets the total_count of this InlineResponse20012. # noqa: E501 + + + :return: The total_count of this InlineResponse20012. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this InlineResponse20012. + + + :param total_count: The total_count of this InlineResponse20012. # noqa: E501 + :type: int + """ + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InlineResponse20012, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse20012): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/inline_response20013.py b/jcapiv2/jcapiv2/models/inline_response20013.py new file mode 100644 index 0000000..e0ba876 --- /dev/null +++ b/jcapiv2/jcapiv2/models/inline_response20013.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class InlineResponse20013(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[Organization]', + 'total_count': 'int' + } + + attribute_map = { + 'results': 'results', + 'total_count': 'totalCount' + } + + def __init__(self, results=None, total_count=None): # noqa: E501 + """InlineResponse20013 - a model defined in Swagger""" # noqa: E501 + self._results = None + self._total_count = None + self.discriminator = None + if results is not None: + self.results = results + if total_count is not None: + self.total_count = total_count + + @property + def results(self): + """Gets the results of this InlineResponse20013. # noqa: E501 + + + :return: The results of this InlineResponse20013. # noqa: E501 + :rtype: list[Organization] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this InlineResponse20013. + + + :param results: The results of this InlineResponse20013. # noqa: E501 + :type: list[Organization] + """ + + self._results = results + + @property + def total_count(self): + """Gets the total_count of this InlineResponse20013. # noqa: E501 + + + :return: The total_count of this InlineResponse20013. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this InlineResponse20013. + + + :param total_count: The total_count of this InlineResponse20013. # noqa: E501 + :type: int + """ + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InlineResponse20013, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse20013): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/inline_response2002.py b/jcapiv2/jcapiv2/models/inline_response2002.py new file mode 100644 index 0000000..38be70a --- /dev/null +++ b/jcapiv2/jcapiv2/models/inline_response2002.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class InlineResponse2002(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'next_page_token': 'str', + 'users': 'list[InlineResponse2002Users]' + } + + attribute_map = { + 'next_page_token': 'nextPageToken', + 'users': 'users' + } + + def __init__(self, next_page_token=None, users=None): # noqa: E501 + """InlineResponse2002 - a model defined in Swagger""" # noqa: E501 + self._next_page_token = None + self._users = None + self.discriminator = None + if next_page_token is not None: + self.next_page_token = next_page_token + if users is not None: + self.users = users + + @property + def next_page_token(self): + """Gets the next_page_token of this InlineResponse2002. # noqa: E501 + + + :return: The next_page_token of this InlineResponse2002. # noqa: E501 + :rtype: str + """ + return self._next_page_token + + @next_page_token.setter + def next_page_token(self, next_page_token): + """Sets the next_page_token of this InlineResponse2002. + + + :param next_page_token: The next_page_token of this InlineResponse2002. # noqa: E501 + :type: str + """ + + self._next_page_token = next_page_token + + @property + def users(self): + """Gets the users of this InlineResponse2002. # noqa: E501 + + + :return: The users of this InlineResponse2002. # noqa: E501 + :rtype: list[InlineResponse2002Users] + """ + return self._users + + @users.setter + def users(self, users): + """Sets the users of this InlineResponse2002. + + + :param users: The users of this InlineResponse2002. # noqa: E501 + :type: list[InlineResponse2002Users] + """ + + self._users = users + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InlineResponse2002, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse2002): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/inline_response2002_users.py b/jcapiv2/jcapiv2/models/inline_response2002_users.py new file mode 100644 index 0000000..ab2339e --- /dev/null +++ b/jcapiv2/jcapiv2/models/inline_response2002_users.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class InlineResponse2002Users(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'family_name': 'str', + 'given_name': 'str', + 'id': 'str', + 'primary_email': 'str', + 'thumbnail_photo_url': 'str' + } + + attribute_map = { + 'family_name': 'familyName', + 'given_name': 'givenName', + 'id': 'id', + 'primary_email': 'primaryEmail', + 'thumbnail_photo_url': 'thumbnailPhotoUrl' + } + + def __init__(self, family_name=None, given_name=None, id=None, primary_email=None, thumbnail_photo_url=None): # noqa: E501 + """InlineResponse2002Users - a model defined in Swagger""" # noqa: E501 + self._family_name = None + self._given_name = None + self._id = None + self._primary_email = None + self._thumbnail_photo_url = None + self.discriminator = None + if family_name is not None: + self.family_name = family_name + if given_name is not None: + self.given_name = given_name + if id is not None: + self.id = id + if primary_email is not None: + self.primary_email = primary_email + if thumbnail_photo_url is not None: + self.thumbnail_photo_url = thumbnail_photo_url + + @property + def family_name(self): + """Gets the family_name of this InlineResponse2002Users. # noqa: E501 + + + :return: The family_name of this InlineResponse2002Users. # noqa: E501 + :rtype: str + """ + return self._family_name + + @family_name.setter + def family_name(self, family_name): + """Sets the family_name of this InlineResponse2002Users. + + + :param family_name: The family_name of this InlineResponse2002Users. # noqa: E501 + :type: str + """ + + self._family_name = family_name + + @property + def given_name(self): + """Gets the given_name of this InlineResponse2002Users. # noqa: E501 + + + :return: The given_name of this InlineResponse2002Users. # noqa: E501 + :rtype: str + """ + return self._given_name + + @given_name.setter + def given_name(self, given_name): + """Sets the given_name of this InlineResponse2002Users. + + + :param given_name: The given_name of this InlineResponse2002Users. # noqa: E501 + :type: str + """ + + self._given_name = given_name + + @property + def id(self): + """Gets the id of this InlineResponse2002Users. # noqa: E501 + + + :return: The id of this InlineResponse2002Users. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this InlineResponse2002Users. + + + :param id: The id of this InlineResponse2002Users. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def primary_email(self): + """Gets the primary_email of this InlineResponse2002Users. # noqa: E501 + + + :return: The primary_email of this InlineResponse2002Users. # noqa: E501 + :rtype: str + """ + return self._primary_email + + @primary_email.setter + def primary_email(self, primary_email): + """Sets the primary_email of this InlineResponse2002Users. + + + :param primary_email: The primary_email of this InlineResponse2002Users. # noqa: E501 + :type: str + """ + + self._primary_email = primary_email + + @property + def thumbnail_photo_url(self): + """Gets the thumbnail_photo_url of this InlineResponse2002Users. # noqa: E501 + + + :return: The thumbnail_photo_url of this InlineResponse2002Users. # noqa: E501 + :rtype: str + """ + return self._thumbnail_photo_url + + @thumbnail_photo_url.setter + def thumbnail_photo_url(self, thumbnail_photo_url): + """Sets the thumbnail_photo_url of this InlineResponse2002Users. + + + :param thumbnail_photo_url: The thumbnail_photo_url of this InlineResponse2002Users. # noqa: E501 + :type: str + """ + + self._thumbnail_photo_url = thumbnail_photo_url + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InlineResponse2002Users, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse2002Users): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/inline_response2003.py b/jcapiv2/jcapiv2/models/inline_response2003.py new file mode 100644 index 0000000..ab673ed --- /dev/null +++ b/jcapiv2/jcapiv2/models/inline_response2003.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class InlineResponse2003(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[AutotaskContract]', + 'total_count': 'int' + } + + attribute_map = { + 'results': 'results', + 'total_count': 'totalCount' + } + + def __init__(self, results=None, total_count=None): # noqa: E501 + """InlineResponse2003 - a model defined in Swagger""" # noqa: E501 + self._results = None + self._total_count = None + self.discriminator = None + if results is not None: + self.results = results + if total_count is not None: + self.total_count = total_count + + @property + def results(self): + """Gets the results of this InlineResponse2003. # noqa: E501 + + + :return: The results of this InlineResponse2003. # noqa: E501 + :rtype: list[AutotaskContract] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this InlineResponse2003. + + + :param results: The results of this InlineResponse2003. # noqa: E501 + :type: list[AutotaskContract] + """ + + self._results = results + + @property + def total_count(self): + """Gets the total_count of this InlineResponse2003. # noqa: E501 + + + :return: The total_count of this InlineResponse2003. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this InlineResponse2003. + + + :param total_count: The total_count of this InlineResponse2003. # noqa: E501 + :type: int + """ + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InlineResponse2003, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse2003): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/inline_response2004.py b/jcapiv2/jcapiv2/models/inline_response2004.py new file mode 100644 index 0000000..93fefa4 --- /dev/null +++ b/jcapiv2/jcapiv2/models/inline_response2004.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class InlineResponse2004(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[AutotaskContractField]', + 'total_count': 'int' + } + + attribute_map = { + 'results': 'results', + 'total_count': 'totalCount' + } + + def __init__(self, results=None, total_count=None): # noqa: E501 + """InlineResponse2004 - a model defined in Swagger""" # noqa: E501 + self._results = None + self._total_count = None + self.discriminator = None + if results is not None: + self.results = results + if total_count is not None: + self.total_count = total_count + + @property + def results(self): + """Gets the results of this InlineResponse2004. # noqa: E501 + + + :return: The results of this InlineResponse2004. # noqa: E501 + :rtype: list[AutotaskContractField] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this InlineResponse2004. + + + :param results: The results of this InlineResponse2004. # noqa: E501 + :type: list[AutotaskContractField] + """ + + self._results = results + + @property + def total_count(self): + """Gets the total_count of this InlineResponse2004. # noqa: E501 + + + :return: The total_count of this InlineResponse2004. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this InlineResponse2004. + + + :param total_count: The total_count of this InlineResponse2004. # noqa: E501 + :type: int + """ + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InlineResponse2004, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse2004): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/inline_response2005.py b/jcapiv2/jcapiv2/models/inline_response2005.py new file mode 100644 index 0000000..376104a --- /dev/null +++ b/jcapiv2/jcapiv2/models/inline_response2005.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class InlineResponse2005(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[AutotaskService]', + 'total_count': 'int' + } + + attribute_map = { + 'results': 'results', + 'total_count': 'totalCount' + } + + def __init__(self, results=None, total_count=None): # noqa: E501 + """InlineResponse2005 - a model defined in Swagger""" # noqa: E501 + self._results = None + self._total_count = None + self.discriminator = None + if results is not None: + self.results = results + if total_count is not None: + self.total_count = total_count + + @property + def results(self): + """Gets the results of this InlineResponse2005. # noqa: E501 + + + :return: The results of this InlineResponse2005. # noqa: E501 + :rtype: list[AutotaskService] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this InlineResponse2005. + + + :param results: The results of this InlineResponse2005. # noqa: E501 + :type: list[AutotaskService] + """ + + self._results = results + + @property + def total_count(self): + """Gets the total_count of this InlineResponse2005. # noqa: E501 + + + :return: The total_count of this InlineResponse2005. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this InlineResponse2005. + + + :param total_count: The total_count of this InlineResponse2005. # noqa: E501 + :type: int + """ + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InlineResponse2005, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse2005): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/inline_response2006.py b/jcapiv2/jcapiv2/models/inline_response2006.py new file mode 100644 index 0000000..8f68fb5 --- /dev/null +++ b/jcapiv2/jcapiv2/models/inline_response2006.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class InlineResponse2006(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'records': 'list[AutotaskMappingResponse]', + 'total_count': 'float' + } + + attribute_map = { + 'records': 'records', + 'total_count': 'totalCount' + } + + def __init__(self, records=None, total_count=None): # noqa: E501 + """InlineResponse2006 - a model defined in Swagger""" # noqa: E501 + self._records = None + self._total_count = None + self.discriminator = None + if records is not None: + self.records = records + if total_count is not None: + self.total_count = total_count + + @property + def records(self): + """Gets the records of this InlineResponse2006. # noqa: E501 + + + :return: The records of this InlineResponse2006. # noqa: E501 + :rtype: list[AutotaskMappingResponse] + """ + return self._records + + @records.setter + def records(self, records): + """Sets the records of this InlineResponse2006. + + + :param records: The records of this InlineResponse2006. # noqa: E501 + :type: list[AutotaskMappingResponse] + """ + + self._records = records + + @property + def total_count(self): + """Gets the total_count of this InlineResponse2006. # noqa: E501 + + + :return: The total_count of this InlineResponse2006. # noqa: E501 + :rtype: float + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this InlineResponse2006. + + + :param total_count: The total_count of this InlineResponse2006. # noqa: E501 + :type: float + """ + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InlineResponse2006, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse2006): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/inline_response2007.py b/jcapiv2/jcapiv2/models/inline_response2007.py new file mode 100644 index 0000000..5a6c85c --- /dev/null +++ b/jcapiv2/jcapiv2/models/inline_response2007.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class InlineResponse2007(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[ConnectwiseAgreement]', + 'total_count': 'int' + } + + attribute_map = { + 'results': 'results', + 'total_count': 'totalCount' + } + + def __init__(self, results=None, total_count=None): # noqa: E501 + """InlineResponse2007 - a model defined in Swagger""" # noqa: E501 + self._results = None + self._total_count = None + self.discriminator = None + if results is not None: + self.results = results + if total_count is not None: + self.total_count = total_count + + @property + def results(self): + """Gets the results of this InlineResponse2007. # noqa: E501 + + + :return: The results of this InlineResponse2007. # noqa: E501 + :rtype: list[ConnectwiseAgreement] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this InlineResponse2007. + + + :param results: The results of this InlineResponse2007. # noqa: E501 + :type: list[ConnectwiseAgreement] + """ + + self._results = results + + @property + def total_count(self): + """Gets the total_count of this InlineResponse2007. # noqa: E501 + + + :return: The total_count of this InlineResponse2007. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this InlineResponse2007. + + + :param total_count: The total_count of this InlineResponse2007. # noqa: E501 + :type: int + """ + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InlineResponse2007, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse2007): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/inline_response2008.py b/jcapiv2/jcapiv2/models/inline_response2008.py new file mode 100644 index 0000000..751f18d --- /dev/null +++ b/jcapiv2/jcapiv2/models/inline_response2008.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class InlineResponse2008(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[ConnectwiseAddition]', + 'total_count': 'int' + } + + attribute_map = { + 'results': 'results', + 'total_count': 'totalCount' + } + + def __init__(self, results=None, total_count=None): # noqa: E501 + """InlineResponse2008 - a model defined in Swagger""" # noqa: E501 + self._results = None + self._total_count = None + self.discriminator = None + if results is not None: + self.results = results + if total_count is not None: + self.total_count = total_count + + @property + def results(self): + """Gets the results of this InlineResponse2008. # noqa: E501 + + + :return: The results of this InlineResponse2008. # noqa: E501 + :rtype: list[ConnectwiseAddition] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this InlineResponse2008. + + + :param results: The results of this InlineResponse2008. # noqa: E501 + :type: list[ConnectwiseAddition] + """ + + self._results = results + + @property + def total_count(self): + """Gets the total_count of this InlineResponse2008. # noqa: E501 + + + :return: The total_count of this InlineResponse2008. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this InlineResponse2008. + + + :param total_count: The total_count of this InlineResponse2008. # noqa: E501 + :type: int + """ + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InlineResponse2008, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse2008): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/inline_response2009.py b/jcapiv2/jcapiv2/models/inline_response2009.py new file mode 100644 index 0000000..6ab5e1c --- /dev/null +++ b/jcapiv2/jcapiv2/models/inline_response2009.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class InlineResponse2009(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'records': 'list[ConnectWiseMappingResponse]', + 'total_count': 'float' + } + + attribute_map = { + 'records': 'records', + 'total_count': 'totalCount' + } + + def __init__(self, records=None, total_count=None): # noqa: E501 + """InlineResponse2009 - a model defined in Swagger""" # noqa: E501 + self._records = None + self._total_count = None + self.discriminator = None + if records is not None: + self.records = records + if total_count is not None: + self.total_count = total_count + + @property + def records(self): + """Gets the records of this InlineResponse2009. # noqa: E501 + + + :return: The records of this InlineResponse2009. # noqa: E501 + :rtype: list[ConnectWiseMappingResponse] + """ + return self._records + + @records.setter + def records(self, records): + """Sets the records of this InlineResponse2009. + + + :param records: The records of this InlineResponse2009. # noqa: E501 + :type: list[ConnectWiseMappingResponse] + """ + + self._records = records + + @property + def total_count(self): + """Gets the total_count of this InlineResponse2009. # noqa: E501 + + + :return: The total_count of this InlineResponse2009. # noqa: E501 + :rtype: float + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this InlineResponse2009. + + + :param total_count: The total_count of this InlineResponse2009. # noqa: E501 + :type: float + """ + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InlineResponse2009, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse2009): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/inline_response201.py b/jcapiv2/jcapiv2/models/inline_response201.py index c13557c..75fadfd 100644 --- a/jcapiv2/jcapiv2/models/inline_response201.py +++ b/jcapiv2/jcapiv2/models/inline_response201.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.apple_mdm import AppleMDM # noqa: F401,E501 - - class InlineResponse201(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,68 +28,43 @@ class InlineResponse201(object): and the value is json key in definition. """ swagger_types = { - 'apple_mdm': 'AppleMDM', - 'signed_csr_plist': 'str' + 'integration_id': 'str' } attribute_map = { - 'apple_mdm': 'appleMdm', - 'signed_csr_plist': 'signedCsrPlist' + 'integration_id': 'integrationId' } - def __init__(self, apple_mdm=None, signed_csr_plist=None): # noqa: E501 + def __init__(self, integration_id=None): # noqa: E501 """InlineResponse201 - a model defined in Swagger""" # noqa: E501 - - self._apple_mdm = None - self._signed_csr_plist = None + self._integration_id = None self.discriminator = None - - if apple_mdm is not None: - self.apple_mdm = apple_mdm - if signed_csr_plist is not None: - self.signed_csr_plist = signed_csr_plist - - @property - def apple_mdm(self): - """Gets the apple_mdm of this InlineResponse201. # noqa: E501 - - - :return: The apple_mdm of this InlineResponse201. # noqa: E501 - :rtype: AppleMDM - """ - return self._apple_mdm - - @apple_mdm.setter - def apple_mdm(self, apple_mdm): - """Sets the apple_mdm of this InlineResponse201. - - - :param apple_mdm: The apple_mdm of this InlineResponse201. # noqa: E501 - :type: AppleMDM - """ - - self._apple_mdm = apple_mdm + self.integration_id = integration_id @property - def signed_csr_plist(self): - """Gets the signed_csr_plist of this InlineResponse201. # noqa: E501 + def integration_id(self): + """Gets the integration_id of this InlineResponse201. # noqa: E501 + The identifier of the created integration # noqa: E501 - :return: The signed_csr_plist of this InlineResponse201. # noqa: E501 + :return: The integration_id of this InlineResponse201. # noqa: E501 :rtype: str """ - return self._signed_csr_plist + return self._integration_id - @signed_csr_plist.setter - def signed_csr_plist(self, signed_csr_plist): - """Sets the signed_csr_plist of this InlineResponse201. + @integration_id.setter + def integration_id(self, integration_id): + """Sets the integration_id of this InlineResponse201. + The identifier of the created integration # noqa: E501 - :param signed_csr_plist: The signed_csr_plist of this InlineResponse201. # noqa: E501 + :param integration_id: The integration_id of this InlineResponse201. # noqa: E501 :type: str """ + if integration_id is None: + raise ValueError("Invalid value for `integration_id`, must not be `None`") # noqa: E501 - self._signed_csr_plist = signed_csr_plist + self._integration_id = integration_id def to_dict(self): """Returns the model properties as a dict""" diff --git a/jcapiv2/jcapiv2/models/inline_response400.py b/jcapiv2/jcapiv2/models/inline_response400.py index ad80258..8800bc2 100644 --- a/jcapiv2/jcapiv2/models/inline_response400.py +++ b/jcapiv2/jcapiv2/models/inline_response400.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class InlineResponse400(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,10 +37,8 @@ class InlineResponse400(object): def __init__(self, message=None): # noqa: E501 """InlineResponse400 - a model defined in Swagger""" # noqa: E501 - self._message = None self.discriminator = None - if message is not None: self.message = message diff --git a/jcapiv2/jcapiv2/models/integration.py b/jcapiv2/jcapiv2/models/integration.py new file mode 100644 index 0000000..8b0046e --- /dev/null +++ b/jcapiv2/jcapiv2/models/integration.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Integration(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'integration_id': 'str', + 'type': 'IntegrationType' + } + + attribute_map = { + 'integration_id': 'integrationId', + 'type': 'type' + } + + def __init__(self, integration_id=None, type=None): # noqa: E501 + """Integration - a model defined in Swagger""" # noqa: E501 + self._integration_id = None + self._type = None + self.discriminator = None + if integration_id is not None: + self.integration_id = integration_id + if type is not None: + self.type = type + + @property + def integration_id(self): + """Gets the integration_id of this Integration. # noqa: E501 + + Unique identifier for this integration # noqa: E501 + + :return: The integration_id of this Integration. # noqa: E501 + :rtype: str + """ + return self._integration_id + + @integration_id.setter + def integration_id(self, integration_id): + """Sets the integration_id of this Integration. + + Unique identifier for this integration # noqa: E501 + + :param integration_id: The integration_id of this Integration. # noqa: E501 + :type: str + """ + + self._integration_id = integration_id + + @property + def type(self): + """Gets the type of this Integration. # noqa: E501 + + + :return: The type of this Integration. # noqa: E501 + :rtype: IntegrationType + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Integration. + + + :param type: The type of this Integration. # noqa: E501 + :type: IntegrationType + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Integration, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Integration): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/integration_sync_error.py b/jcapiv2/jcapiv2/models/integration_sync_error.py new file mode 100644 index 0000000..68b4440 --- /dev/null +++ b/jcapiv2/jcapiv2/models/integration_sync_error.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IntegrationSyncError(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'error_type': 'str', + 'message': 'str', + 'org_id': 'str', + 'timestamp': 'str' + } + + attribute_map = { + 'error_type': 'errorType', + 'message': 'message', + 'org_id': 'orgId', + 'timestamp': 'timestamp' + } + + def __init__(self, error_type=None, message=None, org_id=None, timestamp=None): # noqa: E501 + """IntegrationSyncError - a model defined in Swagger""" # noqa: E501 + self._error_type = None + self._message = None + self._org_id = None + self._timestamp = None + self.discriminator = None + self.error_type = error_type + self.message = message + self.org_id = org_id + self.timestamp = timestamp + + @property + def error_type(self): + """Gets the error_type of this IntegrationSyncError. # noqa: E501 + + + :return: The error_type of this IntegrationSyncError. # noqa: E501 + :rtype: str + """ + return self._error_type + + @error_type.setter + def error_type(self, error_type): + """Sets the error_type of this IntegrationSyncError. + + + :param error_type: The error_type of this IntegrationSyncError. # noqa: E501 + :type: str + """ + if error_type is None: + raise ValueError("Invalid value for `error_type`, must not be `None`") # noqa: E501 + + self._error_type = error_type + + @property + def message(self): + """Gets the message of this IntegrationSyncError. # noqa: E501 + + + :return: The message of this IntegrationSyncError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this IntegrationSyncError. + + + :param message: The message of this IntegrationSyncError. # noqa: E501 + :type: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def org_id(self): + """Gets the org_id of this IntegrationSyncError. # noqa: E501 + + + :return: The org_id of this IntegrationSyncError. # noqa: E501 + :rtype: str + """ + return self._org_id + + @org_id.setter + def org_id(self, org_id): + """Sets the org_id of this IntegrationSyncError. + + + :param org_id: The org_id of this IntegrationSyncError. # noqa: E501 + :type: str + """ + if org_id is None: + raise ValueError("Invalid value for `org_id`, must not be `None`") # noqa: E501 + + self._org_id = org_id + + @property + def timestamp(self): + """Gets the timestamp of this IntegrationSyncError. # noqa: E501 + + + :return: The timestamp of this IntegrationSyncError. # noqa: E501 + :rtype: str + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this IntegrationSyncError. + + + :param timestamp: The timestamp of this IntegrationSyncError. # noqa: E501 + :type: str + """ + if timestamp is None: + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 + + self._timestamp = timestamp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IntegrationSyncError, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IntegrationSyncError): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/integration_sync_error_resp.py b/jcapiv2/jcapiv2/models/integration_sync_error_resp.py new file mode 100644 index 0000000..377e511 --- /dev/null +++ b/jcapiv2/jcapiv2/models/integration_sync_error_resp.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IntegrationSyncErrorResp(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'records': 'list[IntegrationSyncError]', + 'total_count': 'int' + } + + attribute_map = { + 'records': 'records', + 'total_count': 'totalCount' + } + + def __init__(self, records=None, total_count=None): # noqa: E501 + """IntegrationSyncErrorResp - a model defined in Swagger""" # noqa: E501 + self._records = None + self._total_count = None + self.discriminator = None + self.records = records + self.total_count = total_count + + @property + def records(self): + """Gets the records of this IntegrationSyncErrorResp. # noqa: E501 + + + :return: The records of this IntegrationSyncErrorResp. # noqa: E501 + :rtype: list[IntegrationSyncError] + """ + return self._records + + @records.setter + def records(self, records): + """Sets the records of this IntegrationSyncErrorResp. + + + :param records: The records of this IntegrationSyncErrorResp. # noqa: E501 + :type: list[IntegrationSyncError] + """ + if records is None: + raise ValueError("Invalid value for `records`, must not be `None`") # noqa: E501 + + self._records = records + + @property + def total_count(self): + """Gets the total_count of this IntegrationSyncErrorResp. # noqa: E501 + + + :return: The total_count of this IntegrationSyncErrorResp. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this IntegrationSyncErrorResp. + + + :param total_count: The total_count of this IntegrationSyncErrorResp. # noqa: E501 + :type: int + """ + if total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IntegrationSyncErrorResp, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IntegrationSyncErrorResp): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/integration_type.py b/jcapiv2/jcapiv2/models/integration_type.py new file mode 100644 index 0000000..a22b056 --- /dev/null +++ b/jcapiv2/jcapiv2/models/integration_type.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IntegrationType(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + AUTOTASK = "autotask" + CONNECTWISE = "connectwise" + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """IntegrationType - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IntegrationType, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IntegrationType): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/integrations_response.py b/jcapiv2/jcapiv2/models/integrations_response.py new file mode 100644 index 0000000..5493798 --- /dev/null +++ b/jcapiv2/jcapiv2/models/integrations_response.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IntegrationsResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'records': 'list[Integration]', + 'total_count': 'int' + } + + attribute_map = { + 'records': 'records', + 'total_count': 'totalCount' + } + + def __init__(self, records=None, total_count=None): # noqa: E501 + """IntegrationsResponse - a model defined in Swagger""" # noqa: E501 + self._records = None + self._total_count = None + self.discriminator = None + if records is not None: + self.records = records + if total_count is not None: + self.total_count = total_count + + @property + def records(self): + """Gets the records of this IntegrationsResponse. # noqa: E501 + + + :return: The records of this IntegrationsResponse. # noqa: E501 + :rtype: list[Integration] + """ + return self._records + + @records.setter + def records(self, records): + """Sets the records of this IntegrationsResponse. + + + :param records: The records of this IntegrationsResponse. # noqa: E501 + :type: list[Integration] + """ + + self._records = records + + @property + def total_count(self): + """Gets the total_count of this IntegrationsResponse. # noqa: E501 + + + :return: The total_count of this IntegrationsResponse. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this IntegrationsResponse. + + + :param total_count: The total_count of this IntegrationsResponse. # noqa: E501 + :type: int + """ + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IntegrationsResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IntegrationsResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/ip_list.py b/jcapiv2/jcapiv2/models/ip_list.py new file mode 100644 index 0000000..a819a11 --- /dev/null +++ b/jcapiv2/jcapiv2/models/ip_list.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IPList(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'description': 'str', + 'id': 'str', + 'ips': 'list[str]', + 'name': 'str' + } + + attribute_map = { + 'description': 'description', + 'id': 'id', + 'ips': 'ips', + 'name': 'name' + } + + def __init__(self, description=None, id=None, ips=None, name=None): # noqa: E501 + """IPList - a model defined in Swagger""" # noqa: E501 + self._description = None + self._id = None + self._ips = None + self._name = None + self.discriminator = None + if description is not None: + self.description = description + if id is not None: + self.id = id + if ips is not None: + self.ips = ips + if name is not None: + self.name = name + + @property + def description(self): + """Gets the description of this IPList. # noqa: E501 + + + :return: The description of this IPList. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this IPList. + + + :param description: The description of this IPList. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def id(self): + """Gets the id of this IPList. # noqa: E501 + + + :return: The id of this IPList. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this IPList. + + + :param id: The id of this IPList. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def ips(self): + """Gets the ips of this IPList. # noqa: E501 + + + :return: The ips of this IPList. # noqa: E501 + :rtype: list[str] + """ + return self._ips + + @ips.setter + def ips(self, ips): + """Sets the ips of this IPList. + + + :param ips: The ips of this IPList. # noqa: E501 + :type: list[str] + """ + + self._ips = ips + + @property + def name(self): + """Gets the name of this IPList. # noqa: E501 + + + :return: The name of this IPList. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this IPList. + + + :param name: The name of this IPList. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IPList, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IPList): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/ip_list_request.py b/jcapiv2/jcapiv2/models/ip_list_request.py new file mode 100644 index 0000000..76aba51 --- /dev/null +++ b/jcapiv2/jcapiv2/models/ip_list_request.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IPListRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'description': 'str', + 'ips': 'list[str]', + 'name': 'str' + } + + attribute_map = { + 'description': 'description', + 'ips': 'ips', + 'name': 'name' + } + + def __init__(self, description=None, ips=None, name=None): # noqa: E501 + """IPListRequest - a model defined in Swagger""" # noqa: E501 + self._description = None + self._ips = None + self._name = None + self.discriminator = None + if description is not None: + self.description = description + if ips is not None: + self.ips = ips + if name is not None: + self.name = name + + @property + def description(self): + """Gets the description of this IPListRequest. # noqa: E501 + + + :return: The description of this IPListRequest. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this IPListRequest. + + + :param description: The description of this IPListRequest. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def ips(self): + """Gets the ips of this IPListRequest. # noqa: E501 + + + :return: The ips of this IPListRequest. # noqa: E501 + :rtype: list[str] + """ + return self._ips + + @ips.setter + def ips(self, ips): + """Sets the ips of this IPListRequest. + + + :param ips: The ips of this IPListRequest. # noqa: E501 + :type: list[str] + """ + + self._ips = ips + + @property + def name(self): + """Gets the name of this IPListRequest. # noqa: E501 + + + :return: The name of this IPListRequest. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this IPListRequest. + + + :param name: The name of this IPListRequest. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IPListRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IPListRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/jc_enrollment_profile.py b/jcapiv2/jcapiv2/models/jc_enrollment_profile.py deleted file mode 100644 index c62a278..0000000 --- a/jcapiv2/jcapiv2/models/jc_enrollment_profile.py +++ /dev/null @@ -1,219 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class JcEnrollmentProfile(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'groups': 'list[str]', - 'id': 'str', - 'name': 'str', - 'organization': 'str', - 'users': 'list[str]' - } - - attribute_map = { - 'groups': 'groups', - 'id': 'id', - 'name': 'name', - 'organization': 'organization', - 'users': 'users' - } - - def __init__(self, groups=None, id=None, name=None, organization=None, users=None): # noqa: E501 - """JcEnrollmentProfile - a model defined in Swagger""" # noqa: E501 - - self._groups = None - self._id = None - self._name = None - self._organization = None - self._users = None - self.discriminator = None - - if groups is not None: - self.groups = groups - if id is not None: - self.id = id - if name is not None: - self.name = name - if organization is not None: - self.organization = organization - if users is not None: - self.users = users - - @property - def groups(self): - """Gets the groups of this JcEnrollmentProfile. # noqa: E501 - - - :return: The groups of this JcEnrollmentProfile. # noqa: E501 - :rtype: list[str] - """ - return self._groups - - @groups.setter - def groups(self, groups): - """Sets the groups of this JcEnrollmentProfile. - - - :param groups: The groups of this JcEnrollmentProfile. # noqa: E501 - :type: list[str] - """ - - self._groups = groups - - @property - def id(self): - """Gets the id of this JcEnrollmentProfile. # noqa: E501 - - - :return: The id of this JcEnrollmentProfile. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this JcEnrollmentProfile. - - - :param id: The id of this JcEnrollmentProfile. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def name(self): - """Gets the name of this JcEnrollmentProfile. # noqa: E501 - - - :return: The name of this JcEnrollmentProfile. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this JcEnrollmentProfile. - - - :param name: The name of this JcEnrollmentProfile. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def organization(self): - """Gets the organization of this JcEnrollmentProfile. # noqa: E501 - - - :return: The organization of this JcEnrollmentProfile. # noqa: E501 - :rtype: str - """ - return self._organization - - @organization.setter - def organization(self, organization): - """Sets the organization of this JcEnrollmentProfile. - - - :param organization: The organization of this JcEnrollmentProfile. # noqa: E501 - :type: str - """ - - self._organization = organization - - @property - def users(self): - """Gets the users of this JcEnrollmentProfile. # noqa: E501 - - - :return: The users of this JcEnrollmentProfile. # noqa: E501 - :rtype: list[str] - """ - return self._users - - @users.setter - def users(self, users): - """Sets the users of this JcEnrollmentProfile. - - - :param users: The users of this JcEnrollmentProfile. # noqa: E501 - :type: list[str] - """ - - self._users = users - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(JcEnrollmentProfile, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, JcEnrollmentProfile): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/job_details.py b/jcapiv2/jcapiv2/models/job_details.py deleted file mode 100644 index 0262a0c..0000000 --- a/jcapiv2/jcapiv2/models/job_details.py +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class JobDetails(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'admin_id': 'str', - 'id': 'str', - 'meta': 'object', - 'name': 'str', - 'persisted_fields': 'list[str]', - 'status': 'str', - 'updated_at': 'str', - 'work_units_count': 'int' - } - - attribute_map = { - 'admin_id': 'adminId', - 'id': 'id', - 'meta': 'meta', - 'name': 'name', - 'persisted_fields': 'persistedFields', - 'status': 'status', - 'updated_at': 'updatedAt', - 'work_units_count': 'workUnitsCount' - } - - def __init__(self, admin_id=None, id=None, meta=None, name=None, persisted_fields=None, status=None, updated_at=None, work_units_count=None): # noqa: E501 - """JobDetails - a model defined in Swagger""" # noqa: E501 - - self._admin_id = None - self._id = None - self._meta = None - self._name = None - self._persisted_fields = None - self._status = None - self._updated_at = None - self._work_units_count = None - self.discriminator = None - - if admin_id is not None: - self.admin_id = admin_id - if id is not None: - self.id = id - if meta is not None: - self.meta = meta - if name is not None: - self.name = name - if persisted_fields is not None: - self.persisted_fields = persisted_fields - if status is not None: - self.status = status - if updated_at is not None: - self.updated_at = updated_at - if work_units_count is not None: - self.work_units_count = work_units_count - - @property - def admin_id(self): - """Gets the admin_id of this JobDetails. # noqa: E501 - - - :return: The admin_id of this JobDetails. # noqa: E501 - :rtype: str - """ - return self._admin_id - - @admin_id.setter - def admin_id(self, admin_id): - """Sets the admin_id of this JobDetails. - - - :param admin_id: The admin_id of this JobDetails. # noqa: E501 - :type: str - """ - - self._admin_id = admin_id - - @property - def id(self): - """Gets the id of this JobDetails. # noqa: E501 - - - :return: The id of this JobDetails. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this JobDetails. - - - :param id: The id of this JobDetails. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def meta(self): - """Gets the meta of this JobDetails. # noqa: E501 - - - :return: The meta of this JobDetails. # noqa: E501 - :rtype: object - """ - return self._meta - - @meta.setter - def meta(self, meta): - """Sets the meta of this JobDetails. - - - :param meta: The meta of this JobDetails. # noqa: E501 - :type: object - """ - - self._meta = meta - - @property - def name(self): - """Gets the name of this JobDetails. # noqa: E501 - - - :return: The name of this JobDetails. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this JobDetails. - - - :param name: The name of this JobDetails. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def persisted_fields(self): - """Gets the persisted_fields of this JobDetails. # noqa: E501 - - - :return: The persisted_fields of this JobDetails. # noqa: E501 - :rtype: list[str] - """ - return self._persisted_fields - - @persisted_fields.setter - def persisted_fields(self, persisted_fields): - """Sets the persisted_fields of this JobDetails. - - - :param persisted_fields: The persisted_fields of this JobDetails. # noqa: E501 - :type: list[str] - """ - - self._persisted_fields = persisted_fields - - @property - def status(self): - """Gets the status of this JobDetails. # noqa: E501 - - - :return: The status of this JobDetails. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this JobDetails. - - - :param status: The status of this JobDetails. # noqa: E501 - :type: str - """ - - self._status = status - - @property - def updated_at(self): - """Gets the updated_at of this JobDetails. # noqa: E501 - - - :return: The updated_at of this JobDetails. # noqa: E501 - :rtype: str - """ - return self._updated_at - - @updated_at.setter - def updated_at(self, updated_at): - """Sets the updated_at of this JobDetails. - - - :param updated_at: The updated_at of this JobDetails. # noqa: E501 - :type: str - """ - - self._updated_at = updated_at - - @property - def work_units_count(self): - """Gets the work_units_count of this JobDetails. # noqa: E501 - - - :return: The work_units_count of this JobDetails. # noqa: E501 - :rtype: int - """ - return self._work_units_count - - @work_units_count.setter - def work_units_count(self, work_units_count): - """Sets the work_units_count of this JobDetails. - - - :param work_units_count: The work_units_count of this JobDetails. # noqa: E501 - :type: int - """ - - self._work_units_count = work_units_count - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(JobDetails, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, JobDetails): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/job_id.py b/jcapiv2/jcapiv2/models/job_id.py index 158cfe1..1991e67 100644 --- a/jcapiv2/jcapiv2/models/job_id.py +++ b/jcapiv2/jcapiv2/models/job_id.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class JobId(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,10 +37,8 @@ class JobId(object): def __init__(self, job_id=None): # noqa: E501 """JobId - a model defined in Swagger""" # noqa: E501 - self._job_id = None self.discriminator = None - if job_id is not None: self.job_id = job_id diff --git a/jcapiv2/jcapiv2/models/job_workresult.py b/jcapiv2/jcapiv2/models/job_workresult.py index 2831456..76bb2d8 100644 --- a/jcapiv2/jcapiv2/models/job_workresult.py +++ b/jcapiv2/jcapiv2/models/job_workresult.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class JobWorkresult(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,21 +28,91 @@ class JobWorkresult(object): and the value is json key in definition. """ swagger_types = { - 'meta': 'object' + 'created_at': 'str', + 'id': 'str', + 'meta': 'object', + 'persisted_fields': 'object', + 'status': 'str', + 'status_msg': 'str', + 'updated_at': 'str' } attribute_map = { - 'meta': 'meta' + 'created_at': 'createdAt', + 'id': 'id', + 'meta': 'meta', + 'persisted_fields': 'persistedFields', + 'status': 'status', + 'status_msg': 'statusMsg', + 'updated_at': 'updatedAt' } - def __init__(self, meta=None): # noqa: E501 + def __init__(self, created_at=None, id=None, meta=None, persisted_fields=None, status=None, status_msg=None, updated_at=None): # noqa: E501 """JobWorkresult - a model defined in Swagger""" # noqa: E501 - + self._created_at = None + self._id = None self._meta = None + self._persisted_fields = None + self._status = None + self._status_msg = None + self._updated_at = None self.discriminator = None - + if created_at is not None: + self.created_at = created_at + if id is not None: + self.id = id if meta is not None: self.meta = meta + if persisted_fields is not None: + self.persisted_fields = persisted_fields + if status is not None: + self.status = status + if status_msg is not None: + self.status_msg = status_msg + if updated_at is not None: + self.updated_at = updated_at + + @property + def created_at(self): + """Gets the created_at of this JobWorkresult. # noqa: E501 + + + :return: The created_at of this JobWorkresult. # noqa: E501 + :rtype: str + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this JobWorkresult. + + + :param created_at: The created_at of this JobWorkresult. # noqa: E501 + :type: str + """ + + self._created_at = created_at + + @property + def id(self): + """Gets the id of this JobWorkresult. # noqa: E501 + + + :return: The id of this JobWorkresult. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this JobWorkresult. + + + :param id: The id of this JobWorkresult. # noqa: E501 + :type: str + """ + + self._id = id @property def meta(self): @@ -68,6 +135,90 @@ def meta(self, meta): self._meta = meta + @property + def persisted_fields(self): + """Gets the persisted_fields of this JobWorkresult. # noqa: E501 + + + :return: The persisted_fields of this JobWorkresult. # noqa: E501 + :rtype: object + """ + return self._persisted_fields + + @persisted_fields.setter + def persisted_fields(self, persisted_fields): + """Sets the persisted_fields of this JobWorkresult. + + + :param persisted_fields: The persisted_fields of this JobWorkresult. # noqa: E501 + :type: object + """ + + self._persisted_fields = persisted_fields + + @property + def status(self): + """Gets the status of this JobWorkresult. # noqa: E501 + + + :return: The status of this JobWorkresult. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this JobWorkresult. + + + :param status: The status of this JobWorkresult. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def status_msg(self): + """Gets the status_msg of this JobWorkresult. # noqa: E501 + + + :return: The status_msg of this JobWorkresult. # noqa: E501 + :rtype: str + """ + return self._status_msg + + @status_msg.setter + def status_msg(self, status_msg): + """Sets the status_msg of this JobWorkresult. + + + :param status_msg: The status_msg of this JobWorkresult. # noqa: E501 + :type: str + """ + + self._status_msg = status_msg + + @property + def updated_at(self): + """Gets the updated_at of this JobWorkresult. # noqa: E501 + + + :return: The updated_at of this JobWorkresult. # noqa: E501 + :rtype: str + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this JobWorkresult. + + + :param updated_at: The updated_at of this JobWorkresult. # noqa: E501 + :type: str + """ + + self._updated_at = updated_at + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/jcapiv2/jcapiv2/models/ldap_group.py b/jcapiv2/jcapiv2/models/ldap_group.py new file mode 100644 index 0000000..b439d23 --- /dev/null +++ b/jcapiv2/jcapiv2/models/ldap_group.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class LdapGroup(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str' + } + + attribute_map = { + 'name': 'name' + } + + def __init__(self, name=None): # noqa: E501 + """LdapGroup - a model defined in Swagger""" # noqa: E501 + self._name = None + self.discriminator = None + if name is not None: + self.name = name + + @property + def name(self): + """Gets the name of this LdapGroup. # noqa: E501 + + + :return: The name of this LdapGroup. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this LdapGroup. + + + :param name: The name of this LdapGroup. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(LdapGroup, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, LdapGroup): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/ldap_server_action.py b/jcapiv2/jcapiv2/models/ldap_server_action.py index 58bcfcf..53228d7 100644 --- a/jcapiv2/jcapiv2/models/ldap_server_action.py +++ b/jcapiv2/jcapiv2/models/ldap_server_action.py @@ -1,22 +1,20 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class LdapServerAction(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -28,7 +26,6 @@ class LdapServerAction(object): """ DISABLE = "disable" REMOVE = "remove" - """ Attributes: swagger_types (dict): The key is attribute name diff --git a/jcapiv2/jcapiv2/models/ldap_server_input.py b/jcapiv2/jcapiv2/models/ldap_server_input.py index 2ea5301..167c343 100644 --- a/jcapiv2/jcapiv2/models/ldap_server_input.py +++ b/jcapiv2/jcapiv2/models/ldap_server_input.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class LdapServerInput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,12 +41,10 @@ class LdapServerInput(object): def __init__(self, name=None, user_lockout_action=None, user_password_expiration_action=None): # noqa: E501 """LdapServerInput - a model defined in Swagger""" # noqa: E501 - self._name = None self._user_lockout_action = None self._user_password_expiration_action = None self.discriminator = None - if name is not None: self.name = name if user_lockout_action is not None: diff --git a/jcapiv2/jcapiv2/models/ldap_server_output.py b/jcapiv2/jcapiv2/models/ldap_server_output.py index 8021b8b..1f30460 100644 --- a/jcapiv2/jcapiv2/models/ldap_server_output.py +++ b/jcapiv2/jcapiv2/models/ldap_server_output.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.ldap_server_input import LdapServerInput # noqa: F401,E501 - - class LdapServerOutput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -35,33 +30,27 @@ class LdapServerOutput(object): swagger_types = { 'name': 'str', 'user_lockout_action': 'str', - 'user_password_expiration_action': 'str', - 'id': 'str' + 'user_password_expiration_action': 'str' } attribute_map = { 'name': 'name', 'user_lockout_action': 'userLockoutAction', - 'user_password_expiration_action': 'userPasswordExpirationAction', - 'id': 'id' + 'user_password_expiration_action': 'userPasswordExpirationAction' } - def __init__(self, name=None, user_lockout_action=None, user_password_expiration_action=None, id=None): # noqa: E501 + def __init__(self, name=None, user_lockout_action=None, user_password_expiration_action=None): # noqa: E501 """LdapServerOutput - a model defined in Swagger""" # noqa: E501 - self._name = None self._user_lockout_action = None self._user_password_expiration_action = None - self._id = None self.discriminator = None - if name is not None: self.name = name if user_lockout_action is not None: self.user_lockout_action = user_lockout_action if user_password_expiration_action is not None: self.user_password_expiration_action = user_password_expiration_action - self.id = id @property def name(self): @@ -144,31 +133,6 @@ def user_password_expiration_action(self, user_password_expiration_action): self._user_password_expiration_action = user_password_expiration_action - @property - def id(self): - """Gets the id of this LdapServerOutput. # noqa: E501 - - Unique identifier of this LDAP server # noqa: E501 - - :return: The id of this LdapServerOutput. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this LdapServerOutput. - - Unique identifier of this LDAP server # noqa: E501 - - :param id: The id of this LdapServerOutput. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/jcapiv2/jcapiv2/models/ldapservers_id_body.py b/jcapiv2/jcapiv2/models/ldapservers_id_body.py new file mode 100644 index 0000000..5203cf9 --- /dev/null +++ b/jcapiv2/jcapiv2/models/ldapservers_id_body.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class LdapserversIdBody(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'user_lockout_action': 'LdapServerAction', + 'user_password_expiration_action': 'LdapServerAction' + } + + attribute_map = { + 'id': 'id', + 'user_lockout_action': 'userLockoutAction', + 'user_password_expiration_action': 'userPasswordExpirationAction' + } + + def __init__(self, id=None, user_lockout_action=None, user_password_expiration_action=None): # noqa: E501 + """LdapserversIdBody - a model defined in Swagger""" # noqa: E501 + self._id = None + self._user_lockout_action = None + self._user_password_expiration_action = None + self.discriminator = None + if id is not None: + self.id = id + if user_lockout_action is not None: + self.user_lockout_action = user_lockout_action + if user_password_expiration_action is not None: + self.user_password_expiration_action = user_password_expiration_action + + @property + def id(self): + """Gets the id of this LdapserversIdBody. # noqa: E501 + + + :return: The id of this LdapserversIdBody. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this LdapserversIdBody. + + + :param id: The id of this LdapserversIdBody. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def user_lockout_action(self): + """Gets the user_lockout_action of this LdapserversIdBody. # noqa: E501 + + + :return: The user_lockout_action of this LdapserversIdBody. # noqa: E501 + :rtype: LdapServerAction + """ + return self._user_lockout_action + + @user_lockout_action.setter + def user_lockout_action(self, user_lockout_action): + """Sets the user_lockout_action of this LdapserversIdBody. + + + :param user_lockout_action: The user_lockout_action of this LdapserversIdBody. # noqa: E501 + :type: LdapServerAction + """ + + self._user_lockout_action = user_lockout_action + + @property + def user_password_expiration_action(self): + """Gets the user_password_expiration_action of this LdapserversIdBody. # noqa: E501 + + + :return: The user_password_expiration_action of this LdapserversIdBody. # noqa: E501 + :rtype: LdapServerAction + """ + return self._user_password_expiration_action + + @user_password_expiration_action.setter + def user_password_expiration_action(self, user_password_expiration_action): + """Sets the user_password_expiration_action of this LdapserversIdBody. + + + :param user_password_expiration_action: The user_password_expiration_action of this LdapserversIdBody. # noqa: E501 + :type: LdapServerAction + """ + + self._user_password_expiration_action = user_password_expiration_action + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(LdapserversIdBody, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, LdapserversIdBody): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/member_suggestion.py b/jcapiv2/jcapiv2/models/member_suggestion.py new file mode 100644 index 0000000..0180325 --- /dev/null +++ b/jcapiv2/jcapiv2/models/member_suggestion.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MemberSuggestion(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'object': 'GraphObject', + 'op': 'str' + } + + attribute_map = { + 'object': 'object', + 'op': 'op' + } + + def __init__(self, object=None, op=None): # noqa: E501 + """MemberSuggestion - a model defined in Swagger""" # noqa: E501 + self._object = None + self._op = None + self.discriminator = None + if object is not None: + self.object = object + if op is not None: + self.op = op + + @property + def object(self): + """Gets the object of this MemberSuggestion. # noqa: E501 + + + :return: The object of this MemberSuggestion. # noqa: E501 + :rtype: GraphObject + """ + return self._object + + @object.setter + def object(self, object): + """Sets the object of this MemberSuggestion. + + + :param object: The object of this MemberSuggestion. # noqa: E501 + :type: GraphObject + """ + + self._object = object + + @property + def op(self): + """Gets the op of this MemberSuggestion. # noqa: E501 + + How to modify group membership. # noqa: E501 + + :return: The op of this MemberSuggestion. # noqa: E501 + :rtype: str + """ + return self._op + + @op.setter + def op(self, op): + """Sets the op of this MemberSuggestion. + + How to modify group membership. # noqa: E501 + + :param op: The op of this MemberSuggestion. # noqa: E501 + :type: str + """ + allowed_values = ["add", "remove"] # noqa: E501 + if op not in allowed_values: + raise ValueError( + "Invalid value for `op` ({0}), must be one of {1}" # noqa: E501 + .format(op, allowed_values) + ) + + self._op = op + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MemberSuggestion, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MemberSuggestion): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/member_suggestions_post_result.py b/jcapiv2/jcapiv2/models/member_suggestions_post_result.py new file mode 100644 index 0000000..3046f64 --- /dev/null +++ b/jcapiv2/jcapiv2/models/member_suggestions_post_result.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MemberSuggestionsPostResult(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'suggestions_found': 'list[str]', + 'suggestions_not_found': 'list[str]' + } + + attribute_map = { + 'suggestions_found': 'suggestions_found', + 'suggestions_not_found': 'suggestions_not_found' + } + + def __init__(self, suggestions_found=None, suggestions_not_found=None): # noqa: E501 + """MemberSuggestionsPostResult - a model defined in Swagger""" # noqa: E501 + self._suggestions_found = None + self._suggestions_not_found = None + self.discriminator = None + if suggestions_found is not None: + self.suggestions_found = suggestions_found + if suggestions_not_found is not None: + self.suggestions_not_found = suggestions_not_found + + @property + def suggestions_found(self): + """Gets the suggestions_found of this MemberSuggestionsPostResult. # noqa: E501 + + + :return: The suggestions_found of this MemberSuggestionsPostResult. # noqa: E501 + :rtype: list[str] + """ + return self._suggestions_found + + @suggestions_found.setter + def suggestions_found(self, suggestions_found): + """Sets the suggestions_found of this MemberSuggestionsPostResult. + + + :param suggestions_found: The suggestions_found of this MemberSuggestionsPostResult. # noqa: E501 + :type: list[str] + """ + + self._suggestions_found = suggestions_found + + @property + def suggestions_not_found(self): + """Gets the suggestions_not_found of this MemberSuggestionsPostResult. # noqa: E501 + + + :return: The suggestions_not_found of this MemberSuggestionsPostResult. # noqa: E501 + :rtype: list[str] + """ + return self._suggestions_not_found + + @suggestions_not_found.setter + def suggestions_not_found(self, suggestions_not_found): + """Sets the suggestions_not_found of this MemberSuggestionsPostResult. + + + :param suggestions_not_found: The suggestions_not_found of this MemberSuggestionsPostResult. # noqa: E501 + :type: list[str] + """ + + self._suggestions_not_found = suggestions_not_found + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MemberSuggestionsPostResult, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MemberSuggestionsPostResult): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/mfa.py b/jcapiv2/jcapiv2/models/mfa.py deleted file mode 100644 index 0570b37..0000000 --- a/jcapiv2/jcapiv2/models/mfa.py +++ /dev/null @@ -1,167 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Mfa(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'configured': 'bool', - 'exclusion': 'bool', - 'exclusion_until': 'datetime' - } - - attribute_map = { - 'configured': 'configured', - 'exclusion': 'exclusion', - 'exclusion_until': 'exclusionUntil' - } - - def __init__(self, configured=None, exclusion=None, exclusion_until=None): # noqa: E501 - """Mfa - a model defined in Swagger""" # noqa: E501 - - self._configured = None - self._exclusion = None - self._exclusion_until = None - self.discriminator = None - - if configured is not None: - self.configured = configured - if exclusion is not None: - self.exclusion = exclusion - if exclusion_until is not None: - self.exclusion_until = exclusion_until - - @property - def configured(self): - """Gets the configured of this Mfa. # noqa: E501 - - - :return: The configured of this Mfa. # noqa: E501 - :rtype: bool - """ - return self._configured - - @configured.setter - def configured(self, configured): - """Sets the configured of this Mfa. - - - :param configured: The configured of this Mfa. # noqa: E501 - :type: bool - """ - - self._configured = configured - - @property - def exclusion(self): - """Gets the exclusion of this Mfa. # noqa: E501 - - - :return: The exclusion of this Mfa. # noqa: E501 - :rtype: bool - """ - return self._exclusion - - @exclusion.setter - def exclusion(self, exclusion): - """Sets the exclusion of this Mfa. - - - :param exclusion: The exclusion of this Mfa. # noqa: E501 - :type: bool - """ - - self._exclusion = exclusion - - @property - def exclusion_until(self): - """Gets the exclusion_until of this Mfa. # noqa: E501 - - - :return: The exclusion_until of this Mfa. # noqa: E501 - :rtype: datetime - """ - return self._exclusion_until - - @exclusion_until.setter - def exclusion_until(self, exclusion_until): - """Sets the exclusion_until of this Mfa. - - - :param exclusion_until: The exclusion_until of this Mfa. # noqa: E501 - :type: datetime - """ - - self._exclusion_until = exclusion_until - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Mfa, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Mfa): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/mobileconfig.py b/jcapiv2/jcapiv2/models/mobileconfig.py index f5e3394..57a219f 100644 --- a/jcapiv2/jcapiv2/models/mobileconfig.py +++ b/jcapiv2/jcapiv2/models/mobileconfig.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class Mobileconfig(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name diff --git a/jcapiv2/jcapiv2/models/oauth_code_input.py b/jcapiv2/jcapiv2/models/oauth_code_input.py deleted file mode 100644 index 2e70698..0000000 --- a/jcapiv2/jcapiv2/models/oauth_code_input.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class OauthCodeInput(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'code': 'str' - } - - attribute_map = { - 'code': 'code' - } - - def __init__(self, code=None): # noqa: E501 - """OauthCodeInput - a model defined in Swagger""" # noqa: E501 - - self._code = None - self.discriminator = None - - if code is not None: - self.code = code - - @property - def code(self): - """Gets the code of this OauthCodeInput. # noqa: E501 - - - :return: The code of this OauthCodeInput. # noqa: E501 - :rtype: str - """ - return self._code - - @code.setter - def code(self, code): - """Sets the code of this OauthCodeInput. - - - :param code: The code of this OauthCodeInput. # noqa: E501 - :type: str - """ - - self._code = code - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(OauthCodeInput, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OauthCodeInput): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/office365_builtin_translation.py b/jcapiv2/jcapiv2/models/office365_builtin_translation.py index 07fcf97..0c86051 100644 --- a/jcapiv2/jcapiv2/models/office365_builtin_translation.py +++ b/jcapiv2/jcapiv2/models/office365_builtin_translation.py @@ -1,22 +1,20 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class Office365BuiltinTranslation(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -26,17 +24,19 @@ class Office365BuiltinTranslation(object): """ allowed enum values """ - STREET_ADDRESS = "user_street_address" + ALTERNATE_EMAIL = "user_alternate_email" + BUSINESS_PHONES = "user_business_phones" CITY = "user_city" - STATE = "user_state" COUNTRY = "user_country" - POSTAL_CODE = "user_postal_code" - BUSINESS_PHONES = "user_business_phones" - MOBILE_PHONE = "user_mobile_phone" DEPARTMENT = "user_department" JOB_TITLE = "user_job_title" + MANAGER = "user_manager" + MOBILE_PHONE = "user_mobile_phone" OFFICE_LOCATION = "user_office_location" - + POSTAL_CODE = "user_postal_code" + PRINCIPAL_NAME_FROM_ALTERNATE_EMAIL = "user_principal_name_from_alternate_email" + STATE = "user_state" + STREET_ADDRESS = "user_street_address" """ Attributes: swagger_types (dict): The key is attribute name diff --git a/jcapiv2/jcapiv2/models/office365_direction_translation.py b/jcapiv2/jcapiv2/models/office365_direction_translation.py new file mode 100644 index 0000000..e8767c7 --- /dev/null +++ b/jcapiv2/jcapiv2/models/office365_direction_translation.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Office365DirectionTranslation(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + EXPORT = "export" + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """Office365DirectionTranslation - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Office365DirectionTranslation, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Office365DirectionTranslation): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/office365_output.py b/jcapiv2/jcapiv2/models/office365_output.py new file mode 100644 index 0000000..985094e --- /dev/null +++ b/jcapiv2/jcapiv2/models/office365_output.py @@ -0,0 +1,229 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Office365Output(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'groups_enabled': 'bool', + 'id': 'str', + 'name': 'str', + 'user_lockout_action': 'str', + 'user_password_expiration_action': 'str' + } + + attribute_map = { + 'groups_enabled': 'groupsEnabled', + 'id': 'id', + 'name': 'name', + 'user_lockout_action': 'userLockoutAction', + 'user_password_expiration_action': 'userPasswordExpirationAction' + } + + def __init__(self, groups_enabled=None, id=None, name=None, user_lockout_action=None, user_password_expiration_action=None): # noqa: E501 + """Office365Output - a model defined in Swagger""" # noqa: E501 + self._groups_enabled = None + self._id = None + self._name = None + self._user_lockout_action = None + self._user_password_expiration_action = None + self.discriminator = None + if groups_enabled is not None: + self.groups_enabled = groups_enabled + self.id = id + if name is not None: + self.name = name + self.user_lockout_action = user_lockout_action + self.user_password_expiration_action = user_password_expiration_action + + @property + def groups_enabled(self): + """Gets the groups_enabled of this Office365Output. # noqa: E501 + + + :return: The groups_enabled of this Office365Output. # noqa: E501 + :rtype: bool + """ + return self._groups_enabled + + @groups_enabled.setter + def groups_enabled(self, groups_enabled): + """Sets the groups_enabled of this Office365Output. + + + :param groups_enabled: The groups_enabled of this Office365Output. # noqa: E501 + :type: bool + """ + + self._groups_enabled = groups_enabled + + @property + def id(self): + """Gets the id of this Office365Output. # noqa: E501 + + + :return: The id of this Office365Output. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Office365Output. + + + :param id: The id of this Office365Output. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this Office365Output. # noqa: E501 + + + :return: The name of this Office365Output. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Office365Output. + + + :param name: The name of this Office365Output. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def user_lockout_action(self): + """Gets the user_lockout_action of this Office365Output. # noqa: E501 + + + :return: The user_lockout_action of this Office365Output. # noqa: E501 + :rtype: str + """ + return self._user_lockout_action + + @user_lockout_action.setter + def user_lockout_action(self, user_lockout_action): + """Sets the user_lockout_action of this Office365Output. + + + :param user_lockout_action: The user_lockout_action of this Office365Output. # noqa: E501 + :type: str + """ + if user_lockout_action is None: + raise ValueError("Invalid value for `user_lockout_action`, must not be `None`") # noqa: E501 + allowed_values = ["suspend", "maintain"] # noqa: E501 + if user_lockout_action not in allowed_values: + raise ValueError( + "Invalid value for `user_lockout_action` ({0}), must be one of {1}" # noqa: E501 + .format(user_lockout_action, allowed_values) + ) + + self._user_lockout_action = user_lockout_action + + @property + def user_password_expiration_action(self): + """Gets the user_password_expiration_action of this Office365Output. # noqa: E501 + + + :return: The user_password_expiration_action of this Office365Output. # noqa: E501 + :rtype: str + """ + return self._user_password_expiration_action + + @user_password_expiration_action.setter + def user_password_expiration_action(self, user_password_expiration_action): + """Sets the user_password_expiration_action of this Office365Output. + + + :param user_password_expiration_action: The user_password_expiration_action of this Office365Output. # noqa: E501 + :type: str + """ + if user_password_expiration_action is None: + raise ValueError("Invalid value for `user_password_expiration_action`, must not be `None`") # noqa: E501 + allowed_values = ["suspend", "maintain"] # noqa: E501 + if user_password_expiration_action not in allowed_values: + raise ValueError( + "Invalid value for `user_password_expiration_action` ({0}), must be one of {1}" # noqa: E501 + .format(user_password_expiration_action, allowed_values) + ) + + self._user_password_expiration_action = user_password_expiration_action + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Office365Output, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Office365Output): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/office365_patch_input.py b/jcapiv2/jcapiv2/models/office365_patch_input.py new file mode 100644 index 0000000..ee2dee1 --- /dev/null +++ b/jcapiv2/jcapiv2/models/office365_patch_input.py @@ -0,0 +1,200 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Office365PatchInput(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'groups_enabled': 'bool', + 'name': 'str', + 'user_lockout_action': 'str', + 'user_password_expiration_action': 'str' + } + + attribute_map = { + 'groups_enabled': 'groupsEnabled', + 'name': 'name', + 'user_lockout_action': 'userLockoutAction', + 'user_password_expiration_action': 'userPasswordExpirationAction' + } + + def __init__(self, groups_enabled=None, name=None, user_lockout_action=None, user_password_expiration_action=None): # noqa: E501 + """Office365PatchInput - a model defined in Swagger""" # noqa: E501 + self._groups_enabled = None + self._name = None + self._user_lockout_action = None + self._user_password_expiration_action = None + self.discriminator = None + if groups_enabled is not None: + self.groups_enabled = groups_enabled + if name is not None: + self.name = name + if user_lockout_action is not None: + self.user_lockout_action = user_lockout_action + if user_password_expiration_action is not None: + self.user_password_expiration_action = user_password_expiration_action + + @property + def groups_enabled(self): + """Gets the groups_enabled of this Office365PatchInput. # noqa: E501 + + + :return: The groups_enabled of this Office365PatchInput. # noqa: E501 + :rtype: bool + """ + return self._groups_enabled + + @groups_enabled.setter + def groups_enabled(self, groups_enabled): + """Sets the groups_enabled of this Office365PatchInput. + + + :param groups_enabled: The groups_enabled of this Office365PatchInput. # noqa: E501 + :type: bool + """ + + self._groups_enabled = groups_enabled + + @property + def name(self): + """Gets the name of this Office365PatchInput. # noqa: E501 + + + :return: The name of this Office365PatchInput. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Office365PatchInput. + + + :param name: The name of this Office365PatchInput. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def user_lockout_action(self): + """Gets the user_lockout_action of this Office365PatchInput. # noqa: E501 + + + :return: The user_lockout_action of this Office365PatchInput. # noqa: E501 + :rtype: str + """ + return self._user_lockout_action + + @user_lockout_action.setter + def user_lockout_action(self, user_lockout_action): + """Sets the user_lockout_action of this Office365PatchInput. + + + :param user_lockout_action: The user_lockout_action of this Office365PatchInput. # noqa: E501 + :type: str + """ + allowed_values = ["suspend", "maintain"] # noqa: E501 + if user_lockout_action not in allowed_values: + raise ValueError( + "Invalid value for `user_lockout_action` ({0}), must be one of {1}" # noqa: E501 + .format(user_lockout_action, allowed_values) + ) + + self._user_lockout_action = user_lockout_action + + @property + def user_password_expiration_action(self): + """Gets the user_password_expiration_action of this Office365PatchInput. # noqa: E501 + + + :return: The user_password_expiration_action of this Office365PatchInput. # noqa: E501 + :rtype: str + """ + return self._user_password_expiration_action + + @user_password_expiration_action.setter + def user_password_expiration_action(self, user_password_expiration_action): + """Sets the user_password_expiration_action of this Office365PatchInput. + + + :param user_password_expiration_action: The user_password_expiration_action of this Office365PatchInput. # noqa: E501 + :type: str + """ + allowed_values = ["suspend", "maintain"] # noqa: E501 + if user_password_expiration_action not in allowed_values: + raise ValueError( + "Invalid value for `user_password_expiration_action` ({0}), must be one of {1}" # noqa: E501 + .format(user_password_expiration_action, allowed_values) + ) + + self._user_password_expiration_action = user_password_expiration_action + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Office365PatchInput, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Office365PatchInput): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/office365_translation_rule.py b/jcapiv2/jcapiv2/models/office365_translation_rule.py index 06a6412..f4668f8 100644 --- a/jcapiv2/jcapiv2/models/office365_translation_rule.py +++ b/jcapiv2/jcapiv2/models/office365_translation_rule.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.office365_builtin_translation import Office365BuiltinTranslation # noqa: F401,E501 - - class Office365TranslationRule(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -34,23 +29,26 @@ class Office365TranslationRule(object): """ swagger_types = { 'built_in': 'Office365BuiltinTranslation', + 'direction': 'Office365DirectionTranslation', 'id': 'str' } attribute_map = { 'built_in': 'builtIn', + 'direction': 'direction', 'id': 'id' } - def __init__(self, built_in=None, id=None): # noqa: E501 + def __init__(self, built_in=None, direction=None, id=None): # noqa: E501 """Office365TranslationRule - a model defined in Swagger""" # noqa: E501 - self._built_in = None + self._direction = None self._id = None self.discriminator = None - if built_in is not None: self.built_in = built_in + if direction is not None: + self.direction = direction if id is not None: self.id = id @@ -75,6 +73,27 @@ def built_in(self, built_in): self._built_in = built_in + @property + def direction(self): + """Gets the direction of this Office365TranslationRule. # noqa: E501 + + + :return: The direction of this Office365TranslationRule. # noqa: E501 + :rtype: Office365DirectionTranslation + """ + return self._direction + + @direction.setter + def direction(self, direction): + """Sets the direction of this Office365TranslationRule. + + + :param direction: The direction of this Office365TranslationRule. # noqa: E501 + :type: Office365DirectionTranslation + """ + + self._direction = direction + @property def id(self): """Gets the id of this Office365TranslationRule. # noqa: E501 diff --git a/jcapiv2/jcapiv2/models/office365_translation_rule_request.py b/jcapiv2/jcapiv2/models/office365_translation_rule_request.py index 0830542..f822f44 100644 --- a/jcapiv2/jcapiv2/models/office365_translation_rule_request.py +++ b/jcapiv2/jcapiv2/models/office365_translation_rule_request.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.office365_builtin_translation import Office365BuiltinTranslation # noqa: F401,E501 - - class Office365TranslationRuleRequest(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,21 +28,24 @@ class Office365TranslationRuleRequest(object): and the value is json key in definition. """ swagger_types = { - 'built_in': 'Office365BuiltinTranslation' + 'built_in': 'Office365BuiltinTranslation', + 'direction': 'Office365DirectionTranslation' } attribute_map = { - 'built_in': 'builtIn' + 'built_in': 'builtIn', + 'direction': 'direction' } - def __init__(self, built_in=None): # noqa: E501 + def __init__(self, built_in=None, direction=None): # noqa: E501 """Office365TranslationRuleRequest - a model defined in Swagger""" # noqa: E501 - self._built_in = None + self._direction = None self.discriminator = None - if built_in is not None: self.built_in = built_in + if direction is not None: + self.direction = direction @property def built_in(self): @@ -70,6 +68,27 @@ def built_in(self, built_in): self._built_in = built_in + @property + def direction(self): + """Gets the direction of this Office365TranslationRuleRequest. # noqa: E501 + + + :return: The direction of this Office365TranslationRuleRequest. # noqa: E501 + :rtype: Office365DirectionTranslation + """ + return self._direction + + @direction.setter + def direction(self, direction): + """Sets the direction of this Office365TranslationRuleRequest. + + + :param direction: The direction of this Office365TranslationRuleRequest. # noqa: E501 + :type: Office365DirectionTranslation + """ + + self._direction = direction + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/jcapiv2/jcapiv2/models/org_crypto_settings.py b/jcapiv2/jcapiv2/models/org_crypto_settings.py deleted file mode 100644 index 91b4304..0000000 --- a/jcapiv2/jcapiv2/models/org_crypto_settings.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - -from jcapiv2.models.orgcryptosettings_ssh_keys import OrgcryptosettingsSshKeys # noqa: F401,E501 - - -class OrgCryptoSettings(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'ssh_keys': 'OrgcryptosettingsSshKeys' - } - - attribute_map = { - 'ssh_keys': 'sshKeys' - } - - def __init__(self, ssh_keys=None): # noqa: E501 - """OrgCryptoSettings - a model defined in Swagger""" # noqa: E501 - - self._ssh_keys = None - self.discriminator = None - - if ssh_keys is not None: - self.ssh_keys = ssh_keys - - @property - def ssh_keys(self): - """Gets the ssh_keys of this OrgCryptoSettings. # noqa: E501 - - - :return: The ssh_keys of this OrgCryptoSettings. # noqa: E501 - :rtype: OrgcryptosettingsSshKeys - """ - return self._ssh_keys - - @ssh_keys.setter - def ssh_keys(self, ssh_keys): - """Sets the ssh_keys of this OrgCryptoSettings. - - - :param ssh_keys: The ssh_keys of this OrgCryptoSettings. # noqa: E501 - :type: OrgcryptosettingsSshKeys - """ - - self._ssh_keys = ssh_keys - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(OrgCryptoSettings, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OrgCryptoSettings): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/organization.py b/jcapiv2/jcapiv2/models/organization.py new file mode 100644 index 0000000..c6378b4 --- /dev/null +++ b/jcapiv2/jcapiv2/models/organization.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Organization(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'max_system_users': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'max_system_users': 'maxSystemUsers', + 'name': 'name' + } + + def __init__(self, id=None, max_system_users=None, name=None): # noqa: E501 + """Organization - a model defined in Swagger""" # noqa: E501 + self._id = None + self._max_system_users = None + self._name = None + self.discriminator = None + if id is not None: + self.id = id + if max_system_users is not None: + self.max_system_users = max_system_users + if name is not None: + self.name = name + + @property + def id(self): + """Gets the id of this Organization. # noqa: E501 + + + :return: The id of this Organization. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Organization. + + + :param id: The id of this Organization. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def max_system_users(self): + """Gets the max_system_users of this Organization. # noqa: E501 + + The maximum number of users allowed in this organization. Requires organizations.billing scope to modify. # noqa: E501 + + :return: The max_system_users of this Organization. # noqa: E501 + :rtype: int + """ + return self._max_system_users + + @max_system_users.setter + def max_system_users(self, max_system_users): + """Sets the max_system_users of this Organization. + + The maximum number of users allowed in this organization. Requires organizations.billing scope to modify. # noqa: E501 + + :param max_system_users: The max_system_users of this Organization. # noqa: E501 + :type: int + """ + + self._max_system_users = max_system_users + + @property + def name(self): + """Gets the name of this Organization. # noqa: E501 + + + :return: The name of this Organization. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Organization. + + + :param name: The name of this Organization. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Organization, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Organization): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/organization_case.py b/jcapiv2/jcapiv2/models/organization_case.py new file mode 100644 index 0000000..533b86a --- /dev/null +++ b/jcapiv2/jcapiv2/models/organization_case.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationCase(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'case_number': 'str', + '_date': 'str', + 'description': 'str', + 'label': 'str', + 'reporter': 'str', + 'reporter_email': 'str', + 'status': 'str', + 'subject': 'str' + } + + attribute_map = { + 'case_number': 'caseNumber', + '_date': 'date', + 'description': 'description', + 'label': 'label', + 'reporter': 'reporter', + 'reporter_email': 'reporterEmail', + 'status': 'status', + 'subject': 'subject' + } + + def __init__(self, case_number=None, _date=None, description=None, label=None, reporter=None, reporter_email=None, status=None, subject=None): # noqa: E501 + """OrganizationCase - a model defined in Swagger""" # noqa: E501 + self._case_number = None + self.__date = None + self._description = None + self._label = None + self._reporter = None + self._reporter_email = None + self._status = None + self._subject = None + self.discriminator = None + if case_number is not None: + self.case_number = case_number + if _date is not None: + self._date = _date + if description is not None: + self.description = description + if label is not None: + self.label = label + if reporter is not None: + self.reporter = reporter + if reporter_email is not None: + self.reporter_email = reporter_email + if status is not None: + self.status = status + if subject is not None: + self.subject = subject + + @property + def case_number(self): + """Gets the case_number of this OrganizationCase. # noqa: E501 + + + :return: The case_number of this OrganizationCase. # noqa: E501 + :rtype: str + """ + return self._case_number + + @case_number.setter + def case_number(self, case_number): + """Sets the case_number of this OrganizationCase. + + + :param case_number: The case_number of this OrganizationCase. # noqa: E501 + :type: str + """ + + self._case_number = case_number + + @property + def _date(self): + """Gets the _date of this OrganizationCase. # noqa: E501 + + + :return: The _date of this OrganizationCase. # noqa: E501 + :rtype: str + """ + return self.__date + + @_date.setter + def _date(self, _date): + """Sets the _date of this OrganizationCase. + + + :param _date: The _date of this OrganizationCase. # noqa: E501 + :type: str + """ + + self.__date = _date + + @property + def description(self): + """Gets the description of this OrganizationCase. # noqa: E501 + + + :return: The description of this OrganizationCase. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this OrganizationCase. + + + :param description: The description of this OrganizationCase. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def label(self): + """Gets the label of this OrganizationCase. # noqa: E501 + + + :return: The label of this OrganizationCase. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this OrganizationCase. + + + :param label: The label of this OrganizationCase. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def reporter(self): + """Gets the reporter of this OrganizationCase. # noqa: E501 + + + :return: The reporter of this OrganizationCase. # noqa: E501 + :rtype: str + """ + return self._reporter + + @reporter.setter + def reporter(self, reporter): + """Sets the reporter of this OrganizationCase. + + + :param reporter: The reporter of this OrganizationCase. # noqa: E501 + :type: str + """ + + self._reporter = reporter + + @property + def reporter_email(self): + """Gets the reporter_email of this OrganizationCase. # noqa: E501 + + + :return: The reporter_email of this OrganizationCase. # noqa: E501 + :rtype: str + """ + return self._reporter_email + + @reporter_email.setter + def reporter_email(self, reporter_email): + """Sets the reporter_email of this OrganizationCase. + + + :param reporter_email: The reporter_email of this OrganizationCase. # noqa: E501 + :type: str + """ + + self._reporter_email = reporter_email + + @property + def status(self): + """Gets the status of this OrganizationCase. # noqa: E501 + + + :return: The status of this OrganizationCase. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this OrganizationCase. + + + :param status: The status of this OrganizationCase. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def subject(self): + """Gets the subject of this OrganizationCase. # noqa: E501 + + + :return: The subject of this OrganizationCase. # noqa: E501 + :rtype: str + """ + return self._subject + + @subject.setter + def subject(self, subject): + """Sets the subject of this OrganizationCase. + + + :param subject: The subject of this OrganizationCase. # noqa: E501 + :type: str + """ + + self._subject = subject + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationCase, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationCase): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/organization_cases_response.py b/jcapiv2/jcapiv2/models/organization_cases_response.py new file mode 100644 index 0000000..ed2c9ef --- /dev/null +++ b/jcapiv2/jcapiv2/models/organization_cases_response.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OrganizationCasesResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[OrganizationCase]', + 'total_count': 'int' + } + + attribute_map = { + 'results': 'results', + 'total_count': 'totalCount' + } + + def __init__(self, results=None, total_count=None): # noqa: E501 + """OrganizationCasesResponse - a model defined in Swagger""" # noqa: E501 + self._results = None + self._total_count = None + self.discriminator = None + if results is not None: + self.results = results + if total_count is not None: + self.total_count = total_count + + @property + def results(self): + """Gets the results of this OrganizationCasesResponse. # noqa: E501 + + + :return: The results of this OrganizationCasesResponse. # noqa: E501 + :rtype: list[OrganizationCase] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this OrganizationCasesResponse. + + + :param results: The results of this OrganizationCasesResponse. # noqa: E501 + :type: list[OrganizationCase] + """ + + self._results = results + + @property + def total_count(self): + """Gets the total_count of this OrganizationCasesResponse. # noqa: E501 + + + :return: The total_count of this OrganizationCasesResponse. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this OrganizationCasesResponse. + + + :param total_count: The total_count of this OrganizationCasesResponse. # noqa: E501 + :type: int + """ + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OrganizationCasesResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OrganizationCasesResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/orgcryptosettings_ssh_keys.py b/jcapiv2/jcapiv2/models/orgcryptosettings_ssh_keys.py deleted file mode 100644 index 5882cc8..0000000 --- a/jcapiv2/jcapiv2/models/orgcryptosettings_ssh_keys.py +++ /dev/null @@ -1,167 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class OrgcryptosettingsSshKeys(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'key_size': 'int', - 'validate': 'bool', - 'validate_key_size': 'bool' - } - - attribute_map = { - 'key_size': 'keySize', - 'validate': 'validate', - 'validate_key_size': 'validateKeySize' - } - - def __init__(self, key_size=None, validate=None, validate_key_size=None): # noqa: E501 - """OrgcryptosettingsSshKeys - a model defined in Swagger""" # noqa: E501 - - self._key_size = None - self._validate = None - self._validate_key_size = None - self.discriminator = None - - if key_size is not None: - self.key_size = key_size - if validate is not None: - self.validate = validate - if validate_key_size is not None: - self.validate_key_size = validate_key_size - - @property - def key_size(self): - """Gets the key_size of this OrgcryptosettingsSshKeys. # noqa: E501 - - - :return: The key_size of this OrgcryptosettingsSshKeys. # noqa: E501 - :rtype: int - """ - return self._key_size - - @key_size.setter - def key_size(self, key_size): - """Sets the key_size of this OrgcryptosettingsSshKeys. - - - :param key_size: The key_size of this OrgcryptosettingsSshKeys. # noqa: E501 - :type: int - """ - - self._key_size = key_size - - @property - def validate(self): - """Gets the validate of this OrgcryptosettingsSshKeys. # noqa: E501 - - - :return: The validate of this OrgcryptosettingsSshKeys. # noqa: E501 - :rtype: bool - """ - return self._validate - - @validate.setter - def validate(self, validate): - """Sets the validate of this OrgcryptosettingsSshKeys. - - - :param validate: The validate of this OrgcryptosettingsSshKeys. # noqa: E501 - :type: bool - """ - - self._validate = validate - - @property - def validate_key_size(self): - """Gets the validate_key_size of this OrgcryptosettingsSshKeys. # noqa: E501 - - - :return: The validate_key_size of this OrgcryptosettingsSshKeys. # noqa: E501 - :rtype: bool - """ - return self._validate_key_size - - @validate_key_size.setter - def validate_key_size(self, validate_key_size): - """Sets the validate_key_size of this OrgcryptosettingsSshKeys. - - - :param validate_key_size: The validate_key_size of this OrgcryptosettingsSshKeys. # noqa: E501 - :type: bool - """ - - self._validate_key_size = validate_key_size - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(OrgcryptosettingsSshKeys, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OrgcryptosettingsSshKeys): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/os_restriction.py b/jcapiv2/jcapiv2/models/os_restriction.py new file mode 100644 index 0000000..f1728aa --- /dev/null +++ b/jcapiv2/jcapiv2/models/os_restriction.py @@ -0,0 +1,229 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OSRestriction(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'apple_restrictions': 'OSRestrictionAppleRestrictions', + 'deprecated_version': 'str', + 'earliest_version': 'str', + 'os_name': 'str', + 'supported_enrollment_types': 'list[str]' + } + + attribute_map = { + 'apple_restrictions': 'appleRestrictions', + 'deprecated_version': 'deprecatedVersion', + 'earliest_version': 'earliestVersion', + 'os_name': 'osName', + 'supported_enrollment_types': 'supportedEnrollmentTypes' + } + + def __init__(self, apple_restrictions=None, deprecated_version=None, earliest_version=None, os_name=None, supported_enrollment_types=None): # noqa: E501 + """OSRestriction - a model defined in Swagger""" # noqa: E501 + self._apple_restrictions = None + self._deprecated_version = None + self._earliest_version = None + self._os_name = None + self._supported_enrollment_types = None + self.discriminator = None + if apple_restrictions is not None: + self.apple_restrictions = apple_restrictions + if deprecated_version is not None: + self.deprecated_version = deprecated_version + if earliest_version is not None: + self.earliest_version = earliest_version + if os_name is not None: + self.os_name = os_name + if supported_enrollment_types is not None: + self.supported_enrollment_types = supported_enrollment_types + + @property + def apple_restrictions(self): + """Gets the apple_restrictions of this OSRestriction. # noqa: E501 + + + :return: The apple_restrictions of this OSRestriction. # noqa: E501 + :rtype: OSRestrictionAppleRestrictions + """ + return self._apple_restrictions + + @apple_restrictions.setter + def apple_restrictions(self, apple_restrictions): + """Sets the apple_restrictions of this OSRestriction. + + + :param apple_restrictions: The apple_restrictions of this OSRestriction. # noqa: E501 + :type: OSRestrictionAppleRestrictions + """ + + self._apple_restrictions = apple_restrictions + + @property + def deprecated_version(self): + """Gets the deprecated_version of this OSRestriction. # noqa: E501 + + The version of the OS in which the policy was deprecated # noqa: E501 + + :return: The deprecated_version of this OSRestriction. # noqa: E501 + :rtype: str + """ + return self._deprecated_version + + @deprecated_version.setter + def deprecated_version(self, deprecated_version): + """Sets the deprecated_version of this OSRestriction. + + The version of the OS in which the policy was deprecated # noqa: E501 + + :param deprecated_version: The deprecated_version of this OSRestriction. # noqa: E501 + :type: str + """ + + self._deprecated_version = deprecated_version + + @property + def earliest_version(self): + """Gets the earliest_version of this OSRestriction. # noqa: E501 + + The earliest version of the OS in which the policy can be applied # noqa: E501 + + :return: The earliest_version of this OSRestriction. # noqa: E501 + :rtype: str + """ + return self._earliest_version + + @earliest_version.setter + def earliest_version(self, earliest_version): + """Sets the earliest_version of this OSRestriction. + + The earliest version of the OS in which the policy can be applied # noqa: E501 + + :param earliest_version: The earliest_version of this OSRestriction. # noqa: E501 + :type: str + """ + + self._earliest_version = earliest_version + + @property + def os_name(self): + """Gets the os_name of this OSRestriction. # noqa: E501 + + The name of the OS in which this restriction applies # noqa: E501 + + :return: The os_name of this OSRestriction. # noqa: E501 + :rtype: str + """ + return self._os_name + + @os_name.setter + def os_name(self, os_name): + """Sets the os_name of this OSRestriction. + + The name of the OS in which this restriction applies # noqa: E501 + + :param os_name: The os_name of this OSRestriction. # noqa: E501 + :type: str + """ + + self._os_name = os_name + + @property + def supported_enrollment_types(self): + """Gets the supported_enrollment_types of this OSRestriction. # noqa: E501 + + This field is deprecated and will be ignored. Use appleRestrictions.supportedEnrollmentTypes instead # noqa: E501 + + :return: The supported_enrollment_types of this OSRestriction. # noqa: E501 + :rtype: list[str] + """ + return self._supported_enrollment_types + + @supported_enrollment_types.setter + def supported_enrollment_types(self, supported_enrollment_types): + """Sets the supported_enrollment_types of this OSRestriction. + + This field is deprecated and will be ignored. Use appleRestrictions.supportedEnrollmentTypes instead # noqa: E501 + + :param supported_enrollment_types: The supported_enrollment_types of this OSRestriction. # noqa: E501 + :type: list[str] + """ + allowed_values = ["automated", "device", "user"] # noqa: E501 + if not set(supported_enrollment_types).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `supported_enrollment_types` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(supported_enrollment_types) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._supported_enrollment_types = supported_enrollment_types + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OSRestriction, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OSRestriction): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/os_restriction_apple_restrictions.py b/jcapiv2/jcapiv2/models/os_restriction_apple_restrictions.py new file mode 100644 index 0000000..016f750 --- /dev/null +++ b/jcapiv2/jcapiv2/models/os_restriction_apple_restrictions.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class OSRestrictionAppleRestrictions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'requires_supervision': 'bool', + 'supported_enrollment_types': 'list[str]' + } + + attribute_map = { + 'requires_supervision': 'requiresSupervision', + 'supported_enrollment_types': 'supportedEnrollmentTypes' + } + + def __init__(self, requires_supervision=None, supported_enrollment_types=None): # noqa: E501 + """OSRestrictionAppleRestrictions - a model defined in Swagger""" # noqa: E501 + self._requires_supervision = None + self._supported_enrollment_types = None + self.discriminator = None + if requires_supervision is not None: + self.requires_supervision = requires_supervision + if supported_enrollment_types is not None: + self.supported_enrollment_types = supported_enrollment_types + + @property + def requires_supervision(self): + """Gets the requires_supervision of this OSRestrictionAppleRestrictions. # noqa: E501 + + Boolean representing if the policy requires the Apple devices to be MDM supervised # noqa: E501 + + :return: The requires_supervision of this OSRestrictionAppleRestrictions. # noqa: E501 + :rtype: bool + """ + return self._requires_supervision + + @requires_supervision.setter + def requires_supervision(self, requires_supervision): + """Sets the requires_supervision of this OSRestrictionAppleRestrictions. + + Boolean representing if the policy requires the Apple devices to be MDM supervised # noqa: E501 + + :param requires_supervision: The requires_supervision of this OSRestrictionAppleRestrictions. # noqa: E501 + :type: bool + """ + + self._requires_supervision = requires_supervision + + @property + def supported_enrollment_types(self): + """Gets the supported_enrollment_types of this OSRestrictionAppleRestrictions. # noqa: E501 + + The supported Apple enrollment types for this policy # noqa: E501 + + :return: The supported_enrollment_types of this OSRestrictionAppleRestrictions. # noqa: E501 + :rtype: list[str] + """ + return self._supported_enrollment_types + + @supported_enrollment_types.setter + def supported_enrollment_types(self, supported_enrollment_types): + """Sets the supported_enrollment_types of this OSRestrictionAppleRestrictions. + + The supported Apple enrollment types for this policy # noqa: E501 + + :param supported_enrollment_types: The supported_enrollment_types of this OSRestrictionAppleRestrictions. # noqa: E501 + :type: list[str] + """ + allowed_values = ["automated", "device", "user"] # noqa: E501 + if not set(supported_enrollment_types).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `supported_enrollment_types` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(supported_enrollment_types) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._supported_enrollment_types = supported_enrollment_types + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OSRestrictionAppleRestrictions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OSRestrictionAppleRestrictions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/phone_number.py b/jcapiv2/jcapiv2/models/phone_number.py new file mode 100644 index 0000000..154a103 --- /dev/null +++ b/jcapiv2/jcapiv2/models/phone_number.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PhoneNumber(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'number': 'str', + 'type': 'str' + } + + attribute_map = { + 'id': 'id', + 'number': 'number', + 'type': 'type' + } + + def __init__(self, id=None, number=None, type=None): # noqa: E501 + """PhoneNumber - a model defined in Swagger""" # noqa: E501 + self._id = None + self._number = None + self._type = None + self.discriminator = None + if id is not None: + self.id = id + if number is not None: + self.number = number + if type is not None: + self.type = type + + @property + def id(self): + """Gets the id of this PhoneNumber. # noqa: E501 + + + :return: The id of this PhoneNumber. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this PhoneNumber. + + + :param id: The id of this PhoneNumber. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def number(self): + """Gets the number of this PhoneNumber. # noqa: E501 + + + :return: The number of this PhoneNumber. # noqa: E501 + :rtype: str + """ + return self._number + + @number.setter + def number(self, number): + """Sets the number of this PhoneNumber. + + + :param number: The number of this PhoneNumber. # noqa: E501 + :type: str + """ + + self._number = number + + @property + def type(self): + """Gets the type of this PhoneNumber. # noqa: E501 + + + :return: The type of this PhoneNumber. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this PhoneNumber. + + + :param type: The type of this PhoneNumber. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PhoneNumber, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PhoneNumber): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/policy.py b/jcapiv2/jcapiv2/models/policy.py index 2d48c3b..ef4ae5d 100644 --- a/jcapiv2/jcapiv2/models/policy.py +++ b/jcapiv2/jcapiv2/models/policy.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.policy_template import PolicyTemplate # noqa: F401,E501 - - class Policy(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -46,12 +41,10 @@ class Policy(object): def __init__(self, id=None, name=None, template=None): # noqa: E501 """Policy - a model defined in Swagger""" # noqa: E501 - self._id = None self._name = None self._template = None self.discriminator = None - if id is not None: self.id = id if name is not None: diff --git a/jcapiv2/jcapiv2/models/policy_group.py b/jcapiv2/jcapiv2/models/policy_group.py new file mode 100644 index 0000000..a23a118 --- /dev/null +++ b/jcapiv2/jcapiv2/models/policy_group.py @@ -0,0 +1,256 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PolicyGroup(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'GraphAttributes', + 'description': 'str', + 'email': 'str', + 'id': 'str', + 'name': 'str', + 'type': 'str' + } + + attribute_map = { + 'attributes': 'attributes', + 'description': 'description', + 'email': 'email', + 'id': 'id', + 'name': 'name', + 'type': 'type' + } + + def __init__(self, attributes=None, description=None, email=None, id=None, name=None, type=None): # noqa: E501 + """PolicyGroup - a model defined in Swagger""" # noqa: E501 + self._attributes = None + self._description = None + self._email = None + self._id = None + self._name = None + self._type = None + self.discriminator = None + if attributes is not None: + self.attributes = attributes + if description is not None: + self.description = description + if email is not None: + self.email = email + if id is not None: + self.id = id + if name is not None: + self.name = name + if type is not None: + self.type = type + + @property + def attributes(self): + """Gets the attributes of this PolicyGroup. # noqa: E501 + + + :return: The attributes of this PolicyGroup. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this PolicyGroup. + + + :param attributes: The attributes of this PolicyGroup. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def description(self): + """Gets the description of this PolicyGroup. # noqa: E501 + + Description of a Policy Group # noqa: E501 + + :return: The description of this PolicyGroup. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this PolicyGroup. + + Description of a Policy Group # noqa: E501 + + :param description: The description of this PolicyGroup. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def email(self): + """Gets the email of this PolicyGroup. # noqa: E501 + + E-mail address associated with a Policy Group # noqa: E501 + + :return: The email of this PolicyGroup. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this PolicyGroup. + + E-mail address associated with a Policy Group # noqa: E501 + + :param email: The email of this PolicyGroup. # noqa: E501 + :type: str + """ + + self._email = email + + @property + def id(self): + """Gets the id of this PolicyGroup. # noqa: E501 + + ObjectId uniquely identifying a Policy Group. # noqa: E501 + + :return: The id of this PolicyGroup. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this PolicyGroup. + + ObjectId uniquely identifying a Policy Group. # noqa: E501 + + :param id: The id of this PolicyGroup. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this PolicyGroup. # noqa: E501 + + Display name of a Policy Group. # noqa: E501 + + :return: The name of this PolicyGroup. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this PolicyGroup. + + Display name of a Policy Group. # noqa: E501 + + :param name: The name of this PolicyGroup. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def type(self): + """Gets the type of this PolicyGroup. # noqa: E501 + + The type of the group; always 'policy' for a Policy Group. # noqa: E501 + + :return: The type of this PolicyGroup. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this PolicyGroup. + + The type of the group; always 'policy' for a Policy Group. # noqa: E501 + + :param type: The type of this PolicyGroup. # noqa: E501 + :type: str + """ + allowed_values = ["policy_group"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PolicyGroup, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PolicyGroup): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/policy_group_data.py b/jcapiv2/jcapiv2/models/policy_group_data.py new file mode 100644 index 0000000..bf0a210 --- /dev/null +++ b/jcapiv2/jcapiv2/models/policy_group_data.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PolicyGroupData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str' + } + + attribute_map = { + 'name': 'name' + } + + def __init__(self, name=None): # noqa: E501 + """PolicyGroupData - a model defined in Swagger""" # noqa: E501 + self._name = None + self.discriminator = None + self.name = name + + @property + def name(self): + """Gets the name of this PolicyGroupData. # noqa: E501 + + Display name of a Policy Group. # noqa: E501 + + :return: The name of this PolicyGroupData. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this PolicyGroupData. + + Display name of a Policy Group. # noqa: E501 + + :param name: The name of this PolicyGroupData. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PolicyGroupData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PolicyGroupData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/policy_request.py b/jcapiv2/jcapiv2/models/policy_request.py index 3f83749..dff6703 100644 --- a/jcapiv2/jcapiv2/models/policy_request.py +++ b/jcapiv2/jcapiv2/models/policy_request.py @@ -1,31 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.policy_request_template import PolicyRequestTemplate # noqa: F401,E501 -from jcapiv2.models.policy_value import PolicyValue # noqa: F401,E501 - - class PolicyRequest(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -47,12 +41,10 @@ class PolicyRequest(object): def __init__(self, name=None, template=None, values=None): # noqa: E501 """PolicyRequest - a model defined in Swagger""" # noqa: E501 - self._name = None self._template = None self._values = None self.discriminator = None - self.name = name if template is not None: self.template = template diff --git a/jcapiv2/jcapiv2/models/policy_request_template.py b/jcapiv2/jcapiv2/models/policy_request_template.py index 0bfc8ea..5d7f996 100644 --- a/jcapiv2/jcapiv2/models/policy_request_template.py +++ b/jcapiv2/jcapiv2/models/policy_request_template.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class PolicyRequestTemplate(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,10 +37,8 @@ class PolicyRequestTemplate(object): def __init__(self, id=None): # noqa: E501 """PolicyRequestTemplate - a model defined in Swagger""" # noqa: E501 - self._id = None self.discriminator = None - if id is not None: self.id = id diff --git a/jcapiv2/jcapiv2/models/policy_result.py b/jcapiv2/jcapiv2/models/policy_result.py index 740116e..1d6f3a7 100644 --- a/jcapiv2/jcapiv2/models/policy_result.py +++ b/jcapiv2/jcapiv2/models/policy_result.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class PolicyResult(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -60,7 +57,6 @@ class PolicyResult(object): def __init__(self, detail=None, ended_at=None, exit_status=None, id=None, policy_id=None, started_at=None, state=None, std_err=None, std_out=None, success=None, system_id=None): # noqa: E501 """PolicyResult - a model defined in Swagger""" # noqa: E501 - self._detail = None self._ended_at = None self._exit_status = None @@ -73,7 +69,6 @@ def __init__(self, detail=None, ended_at=None, exit_status=None, id=None, policy self._success = None self._system_id = None self.discriminator = None - if detail is not None: self.detail = detail if ended_at is not None: diff --git a/jcapiv2/jcapiv2/models/policy_template.py b/jcapiv2/jcapiv2/models/policy_template.py index bd3a31e..25be1e7 100644 --- a/jcapiv2/jcapiv2/models/policy_template.py +++ b/jcapiv2/jcapiv2/models/policy_template.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class PolicyTemplate(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -32,43 +29,57 @@ class PolicyTemplate(object): """ swagger_types = { 'activation': 'str', + 'alert': 'str', 'behavior': 'str', + 'delivery_types': 'list[str]', 'description': 'str', 'display_name': 'str', 'id': 'str', 'name': 'str', 'os_meta_family': 'str', + 'os_restrictions': 'list[OSRestriction]', + 'reference': 'str', 'state': 'str' } attribute_map = { 'activation': 'activation', + 'alert': 'alert', 'behavior': 'behavior', + 'delivery_types': 'deliveryTypes', 'description': 'description', 'display_name': 'displayName', 'id': 'id', 'name': 'name', 'os_meta_family': 'osMetaFamily', + 'os_restrictions': 'osRestrictions', + 'reference': 'reference', 'state': 'state' } - def __init__(self, activation=None, behavior=None, description=None, display_name=None, id=None, name=None, os_meta_family=None, state=''): # noqa: E501 + def __init__(self, activation=None, alert=None, behavior=None, delivery_types=None, description=None, display_name=None, id=None, name=None, os_meta_family=None, os_restrictions=None, reference=None, state=''): # noqa: E501 """PolicyTemplate - a model defined in Swagger""" # noqa: E501 - self._activation = None + self._alert = None self._behavior = None + self._delivery_types = None self._description = None self._display_name = None self._id = None self._name = None self._os_meta_family = None + self._os_restrictions = None + self._reference = None self._state = None self.discriminator = None - if activation is not None: self.activation = activation + if alert is not None: + self.alert = alert if behavior is not None: self.behavior = behavior + if delivery_types is not None: + self.delivery_types = delivery_types if description is not None: self.description = description if display_name is not None: @@ -79,6 +90,10 @@ def __init__(self, activation=None, behavior=None, description=None, display_nam self.name = name if os_meta_family is not None: self.os_meta_family = os_meta_family + if os_restrictions is not None: + self.os_restrictions = os_restrictions + if reference is not None: + self.reference = reference if state is not None: self.state = state @@ -105,6 +120,29 @@ def activation(self, activation): self._activation = activation + @property + def alert(self): + """Gets the alert of this PolicyTemplate. # noqa: E501 + + Text to describe any risk associated with this policy. # noqa: E501 + + :return: The alert of this PolicyTemplate. # noqa: E501 + :rtype: str + """ + return self._alert + + @alert.setter + def alert(self, alert): + """Sets the alert of this PolicyTemplate. + + Text to describe any risk associated with this policy. # noqa: E501 + + :param alert: The alert of this PolicyTemplate. # noqa: E501 + :type: str + """ + + self._alert = alert + @property def behavior(self): """Gets the behavior of this PolicyTemplate. # noqa: E501 @@ -128,6 +166,36 @@ def behavior(self, behavior): self._behavior = behavior + @property + def delivery_types(self): + """Gets the delivery_types of this PolicyTemplate. # noqa: E501 + + The supported delivery mechanisms for this policy template. # noqa: E501 + + :return: The delivery_types of this PolicyTemplate. # noqa: E501 + :rtype: list[str] + """ + return self._delivery_types + + @delivery_types.setter + def delivery_types(self, delivery_types): + """Sets the delivery_types of this PolicyTemplate. + + The supported delivery mechanisms for this policy template. # noqa: E501 + + :param delivery_types: The delivery_types of this PolicyTemplate. # noqa: E501 + :type: list[str] + """ + allowed_values = ["agent", "mdm"] # noqa: E501 + if not set(delivery_types).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `delivery_types` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(delivery_types) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._delivery_types = delivery_types + @property def description(self): """Gets the description of this PolicyTemplate. # noqa: E501 @@ -238,7 +306,7 @@ def os_meta_family(self, os_meta_family): :param os_meta_family: The os_meta_family of this PolicyTemplate. # noqa: E501 :type: str """ - allowed_values = ["linux", "darwin", "windows"] # noqa: E501 + allowed_values = ["linux", "darwin", "windows", "ios", "universal"] # noqa: E501 if os_meta_family not in allowed_values: raise ValueError( "Invalid value for `os_meta_family` ({0}), must be one of {1}" # noqa: E501 @@ -247,6 +315,50 @@ def os_meta_family(self, os_meta_family): self._os_meta_family = os_meta_family + @property + def os_restrictions(self): + """Gets the os_restrictions of this PolicyTemplate. # noqa: E501 + + + :return: The os_restrictions of this PolicyTemplate. # noqa: E501 + :rtype: list[OSRestriction] + """ + return self._os_restrictions + + @os_restrictions.setter + def os_restrictions(self, os_restrictions): + """Sets the os_restrictions of this PolicyTemplate. + + + :param os_restrictions: The os_restrictions of this PolicyTemplate. # noqa: E501 + :type: list[OSRestriction] + """ + + self._os_restrictions = os_restrictions + + @property + def reference(self): + """Gets the reference of this PolicyTemplate. # noqa: E501 + + URL to visit for further information. # noqa: E501 + + :return: The reference of this PolicyTemplate. # noqa: E501 + :rtype: str + """ + return self._reference + + @reference.setter + def reference(self, reference): + """Sets the reference of this PolicyTemplate. + + URL to visit for further information. # noqa: E501 + + :param reference: The reference of this PolicyTemplate. # noqa: E501 + :type: str + """ + + self._reference = reference + @property def state(self): """Gets the state of this PolicyTemplate. # noqa: E501 diff --git a/jcapiv2/jcapiv2/models/policy_template_config_field.py b/jcapiv2/jcapiv2/models/policy_template_config_field.py index ef03a34..863b6d9 100644 --- a/jcapiv2/jcapiv2/models/policy_template_config_field.py +++ b/jcapiv2/jcapiv2/models/policy_template_config_field.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.policy_template_config_field_tooltip import PolicyTemplateConfigFieldTooltip # noqa: F401,E501 - - class PolicyTemplateConfigField(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,6 +28,8 @@ class PolicyTemplateConfigField(object): and the value is json key in definition. """ swagger_types = { + 'default_value': 'str', + 'display_options': 'object', 'display_type': 'str', 'id': 'str', 'label': 'str', @@ -40,10 +37,13 @@ class PolicyTemplateConfigField(object): 'position': 'float', 'read_only': 'bool', 'required': 'bool', + 'sensitive': 'bool', 'tooltip': 'PolicyTemplateConfigFieldTooltip' } attribute_map = { + 'default_value': 'defaultValue', + 'display_options': 'displayOptions', 'display_type': 'displayType', 'id': 'id', 'label': 'label', @@ -51,12 +51,14 @@ class PolicyTemplateConfigField(object): 'position': 'position', 'read_only': 'readOnly', 'required': 'required', + 'sensitive': 'sensitive', 'tooltip': 'tooltip' } - def __init__(self, display_type=None, id=None, label=None, name=None, position=None, read_only=None, required=None, tooltip=None): # noqa: E501 + def __init__(self, default_value=None, display_options=None, display_type=None, id=None, label=None, name=None, position=None, read_only=None, required=None, sensitive=None, tooltip=None): # noqa: E501 """PolicyTemplateConfigField - a model defined in Swagger""" # noqa: E501 - + self._default_value = None + self._display_options = None self._display_type = None self._id = None self._label = None @@ -64,9 +66,13 @@ def __init__(self, display_type=None, id=None, label=None, name=None, position=N self._position = None self._read_only = None self._required = None + self._sensitive = None self._tooltip = None self.discriminator = None - + if default_value is not None: + self.default_value = default_value + if display_options is not None: + self.display_options = display_options if display_type is not None: self.display_type = display_type self.id = id @@ -79,9 +85,57 @@ def __init__(self, display_type=None, id=None, label=None, name=None, position=N self.read_only = read_only if required is not None: self.required = required + if sensitive is not None: + self.sensitive = sensitive if tooltip is not None: self.tooltip = tooltip + @property + def default_value(self): + """Gets the default_value of this PolicyTemplateConfigField. # noqa: E501 + + The default value for this field. # noqa: E501 + + :return: The default_value of this PolicyTemplateConfigField. # noqa: E501 + :rtype: str + """ + return self._default_value + + @default_value.setter + def default_value(self, default_value): + """Sets the default_value of this PolicyTemplateConfigField. + + The default value for this field. # noqa: E501 + + :param default_value: The default_value of this PolicyTemplateConfigField. # noqa: E501 + :type: str + """ + + self._default_value = default_value + + @property + def display_options(self): + """Gets the display_options of this PolicyTemplateConfigField. # noqa: E501 + + The options that correspond to the display_type. # noqa: E501 + + :return: The display_options of this PolicyTemplateConfigField. # noqa: E501 + :rtype: object + """ + return self._display_options + + @display_options.setter + def display_options(self, display_options): + """Sets the display_options of this PolicyTemplateConfigField. + + The options that correspond to the display_type. # noqa: E501 + + :param display_options: The display_options of this PolicyTemplateConfigField. # noqa: E501 + :type: object + """ + + self._display_options = display_options + @property def display_type(self): """Gets the display_type of this PolicyTemplateConfigField. # noqa: E501 @@ -102,7 +156,7 @@ def display_type(self, display_type): :param display_type: The display_type of this PolicyTemplateConfigField. # noqa: E501 :type: str """ - allowed_values = ["checkbox", "date", "email", "number", "select", "text", "textarea"] # noqa: E501 + allowed_values = ["checkbox", "date", "email", "file", "number", "select", "text", "textarea", "singlelistbox", "doublelistbox", "table"] # noqa: E501 if display_type not in allowed_values: raise ValueError( "Invalid value for `display_type` ({0}), must be one of {1}" # noqa: E501 @@ -253,6 +307,29 @@ def required(self, required): self._required = required + @property + def sensitive(self): + """Gets the sensitive of this PolicyTemplateConfigField. # noqa: E501 + + Defines if the policy template config field is sensitive or not. # noqa: E501 + + :return: The sensitive of this PolicyTemplateConfigField. # noqa: E501 + :rtype: bool + """ + return self._sensitive + + @sensitive.setter + def sensitive(self, sensitive): + """Sets the sensitive of this PolicyTemplateConfigField. + + Defines if the policy template config field is sensitive or not. # noqa: E501 + + :param sensitive: The sensitive of this PolicyTemplateConfigField. # noqa: E501 + :type: bool + """ + + self._sensitive = sensitive + @property def tooltip(self): """Gets the tooltip of this PolicyTemplateConfigField. # noqa: E501 diff --git a/jcapiv2/jcapiv2/models/policy_template_config_field_tooltip.py b/jcapiv2/jcapiv2/models/policy_template_config_field_tooltip.py index f9bef62..ad79c96 100644 --- a/jcapiv2/jcapiv2/models/policy_template_config_field_tooltip.py +++ b/jcapiv2/jcapiv2/models/policy_template_config_field_tooltip.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.policy_template_config_field_tooltip_variables import PolicyTemplateConfigFieldTooltipVariables # noqa: F401,E501 - - class PolicyTemplateConfigFieldTooltip(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,11 +39,9 @@ class PolicyTemplateConfigFieldTooltip(object): def __init__(self, template=None, variables=None): # noqa: E501 """PolicyTemplateConfigFieldTooltip - a model defined in Swagger""" # noqa: E501 - self._template = None self._variables = None self.discriminator = None - if template is not None: self.template = template if variables is not None: diff --git a/jcapiv2/jcapiv2/models/policy_template_config_field_tooltip_variables.py b/jcapiv2/jcapiv2/models/policy_template_config_field_tooltip_variables.py index 309f128..74e55f6 100644 --- a/jcapiv2/jcapiv2/models/policy_template_config_field_tooltip_variables.py +++ b/jcapiv2/jcapiv2/models/policy_template_config_field_tooltip_variables.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class PolicyTemplateConfigFieldTooltipVariables(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,11 +39,9 @@ class PolicyTemplateConfigFieldTooltipVariables(object): def __init__(self, icon=None, message=None): # noqa: E501 """PolicyTemplateConfigFieldTooltipVariables - a model defined in Swagger""" # noqa: E501 - self._icon = None self._message = None self.discriminator = None - if icon is not None: self.icon = icon if message is not None: diff --git a/jcapiv2/jcapiv2/models/policy_template_with_details.py b/jcapiv2/jcapiv2/models/policy_template_with_details.py index 38f7c58..30f734e 100644 --- a/jcapiv2/jcapiv2/models/policy_template_with_details.py +++ b/jcapiv2/jcapiv2/models/policy_template_with_details.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.policy_template_config_field import PolicyTemplateConfigField # noqa: F401,E501 - - class PolicyTemplateWithDetails(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,7 +35,8 @@ class PolicyTemplateWithDetails(object): 'display_name': 'str', 'id': 'str', 'name': 'str', - 'os_meta_family': 'str' + 'os_meta_family': 'str', + 'os_restrictions': 'list[OSRestriction]' } attribute_map = { @@ -51,12 +47,12 @@ class PolicyTemplateWithDetails(object): 'display_name': 'displayName', 'id': 'id', 'name': 'name', - 'os_meta_family': 'osMetaFamily' + 'os_meta_family': 'osMetaFamily', + 'os_restrictions': 'osRestrictions' } - def __init__(self, activation=None, behavior=None, config_fields=None, description=None, display_name=None, id=None, name=None, os_meta_family=None): # noqa: E501 + def __init__(self, activation=None, behavior=None, config_fields=None, description=None, display_name=None, id=None, name=None, os_meta_family=None, os_restrictions=None): # noqa: E501 """PolicyTemplateWithDetails - a model defined in Swagger""" # noqa: E501 - self._activation = None self._behavior = None self._config_fields = None @@ -65,8 +61,8 @@ def __init__(self, activation=None, behavior=None, config_fields=None, descripti self._id = None self._name = None self._os_meta_family = None + self._os_restrictions = None self.discriminator = None - if activation is not None: self.activation = activation if behavior is not None: @@ -83,6 +79,8 @@ def __init__(self, activation=None, behavior=None, config_fields=None, descripti self.name = name if os_meta_family is not None: self.os_meta_family = os_meta_family + if os_restrictions is not None: + self.os_restrictions = os_restrictions @property def activation(self): @@ -263,7 +261,7 @@ def os_meta_family(self, os_meta_family): :param os_meta_family: The os_meta_family of this PolicyTemplateWithDetails. # noqa: E501 :type: str """ - allowed_values = ["linux", "darwin", "windows"] # noqa: E501 + allowed_values = ["linux", "darwin", "windows", "ios", "universal"] # noqa: E501 if os_meta_family not in allowed_values: raise ValueError( "Invalid value for `os_meta_family` ({0}), must be one of {1}" # noqa: E501 @@ -272,6 +270,27 @@ def os_meta_family(self, os_meta_family): self._os_meta_family = os_meta_family + @property + def os_restrictions(self): + """Gets the os_restrictions of this PolicyTemplateWithDetails. # noqa: E501 + + + :return: The os_restrictions of this PolicyTemplateWithDetails. # noqa: E501 + :rtype: list[OSRestriction] + """ + return self._os_restrictions + + @os_restrictions.setter + def os_restrictions(self, os_restrictions): + """Sets the os_restrictions of this PolicyTemplateWithDetails. + + + :param os_restrictions: The os_restrictions of this PolicyTemplateWithDetails. # noqa: E501 + :type: list[OSRestriction] + """ + + self._os_restrictions = os_restrictions + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/jcapiv2/jcapiv2/models/policy_value.py b/jcapiv2/jcapiv2/models/policy_value.py index 8a6aed5..92271f9 100644 --- a/jcapiv2/jcapiv2/models/policy_value.py +++ b/jcapiv2/jcapiv2/models/policy_value.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class PolicyValue(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,21 +28,29 @@ class PolicyValue(object): and the value is json key in definition. """ swagger_types = { - 'config_field_id': 'str' + 'config_field_id': 'str', + 'sensitive': 'bool', + 'value': 'str' } attribute_map = { - 'config_field_id': 'configFieldID' + 'config_field_id': 'configFieldID', + 'sensitive': 'sensitive', + 'value': 'value' } - def __init__(self, config_field_id=None): # noqa: E501 + def __init__(self, config_field_id=None, sensitive=None, value=None): # noqa: E501 """PolicyValue - a model defined in Swagger""" # noqa: E501 - self._config_field_id = None + self._sensitive = None + self._value = None self.discriminator = None - if config_field_id is not None: self.config_field_id = config_field_id + if sensitive is not None: + self.sensitive = sensitive + if value is not None: + self.value = value @property def config_field_id(self): @@ -70,6 +75,52 @@ def config_field_id(self, config_field_id): self._config_field_id = config_field_id + @property + def sensitive(self): + """Gets the sensitive of this PolicyValue. # noqa: E501 + + Defines if the value is sensitive or not. # noqa: E501 + + :return: The sensitive of this PolicyValue. # noqa: E501 + :rtype: bool + """ + return self._sensitive + + @sensitive.setter + def sensitive(self, sensitive): + """Sets the sensitive of this PolicyValue. + + Defines if the value is sensitive or not. # noqa: E501 + + :param sensitive: The sensitive of this PolicyValue. # noqa: E501 + :type: bool + """ + + self._sensitive = sensitive + + @property + def value(self): + """Gets the value of this PolicyValue. # noqa: E501 + + The value for the configuration field for this Policy instance. # noqa: E501 + + :return: The value of this PolicyValue. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this PolicyValue. + + The value for the configuration field for this Policy instance. # noqa: E501 + + :param value: The value of this PolicyValue. # noqa: E501 + :type: str + """ + + self._value = value + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/jcapiv2/jcapiv2/models/policy_with_details.py b/jcapiv2/jcapiv2/models/policy_with_details.py index a86f32c..ee6e437 100644 --- a/jcapiv2/jcapiv2/models/policy_with_details.py +++ b/jcapiv2/jcapiv2/models/policy_with_details.py @@ -1,32 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.policy_template import PolicyTemplate # noqa: F401,E501 -from jcapiv2.models.policy_template_config_field import PolicyTemplateConfigField # noqa: F401,E501 -from jcapiv2.models.policy_value import PolicyValue # noqa: F401,E501 - - class PolicyWithDetails(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -52,14 +45,12 @@ class PolicyWithDetails(object): def __init__(self, config_fields=None, id=None, name=None, template=None, values=None): # noqa: E501 """PolicyWithDetails - a model defined in Swagger""" # noqa: E501 - self._config_fields = None self._id = None self._name = None self._template = None self._values = None self.discriminator = None - if config_fields is not None: self.config_fields = config_fields if id is not None: diff --git a/jcapiv2/jcapiv2/models/provider.py b/jcapiv2/jcapiv2/models/provider.py index 5d0469d..9781d8f 100644 --- a/jcapiv2/jcapiv2/models/provider.py +++ b/jcapiv2/jcapiv2/models/provider.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.provider_contact import ProviderContact # noqa: F401,E501 - - class Provider(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,68 +28,66 @@ class Provider(object): and the value is json key in definition. """ swagger_types = { - 'contact': 'ProviderContact', - 'name': 'str' + 'disallow_org_creation': 'bool', + 'id': 'str' } attribute_map = { - 'contact': 'contact', - 'name': 'name' + 'disallow_org_creation': 'disallowOrgCreation', + 'id': 'id' } - def __init__(self, contact=None, name=None): # noqa: E501 + def __init__(self, disallow_org_creation=None, id=None): # noqa: E501 """Provider - a model defined in Swagger""" # noqa: E501 - - self._contact = None - self._name = None + self._disallow_org_creation = None + self._id = None self.discriminator = None - - if contact is not None: - self.contact = contact - if name is not None: - self.name = name + if disallow_org_creation is not None: + self.disallow_org_creation = disallow_org_creation + if id is not None: + self.id = id @property - def contact(self): - """Gets the contact of this Provider. # noqa: E501 + def disallow_org_creation(self): + """Gets the disallow_org_creation of this Provider. # noqa: E501 - :return: The contact of this Provider. # noqa: E501 - :rtype: ProviderContact + :return: The disallow_org_creation of this Provider. # noqa: E501 + :rtype: bool """ - return self._contact + return self._disallow_org_creation - @contact.setter - def contact(self, contact): - """Sets the contact of this Provider. + @disallow_org_creation.setter + def disallow_org_creation(self, disallow_org_creation): + """Sets the disallow_org_creation of this Provider. - :param contact: The contact of this Provider. # noqa: E501 - :type: ProviderContact + :param disallow_org_creation: The disallow_org_creation of this Provider. # noqa: E501 + :type: bool """ - self._contact = contact + self._disallow_org_creation = disallow_org_creation @property - def name(self): - """Gets the name of this Provider. # noqa: E501 + def id(self): + """Gets the id of this Provider. # noqa: E501 - :return: The name of this Provider. # noqa: E501 + :return: The id of this Provider. # noqa: E501 :rtype: str """ - return self._name + return self._id - @name.setter - def name(self, name): - """Sets the name of this Provider. + @id.setter + def id(self, id): + """Sets the id of this Provider. - :param name: The name of this Provider. # noqa: E501 + :param id: The id of this Provider. # noqa: E501 :type: str """ - self._name = name + self._id = id def to_dict(self): """Returns the model properties as a dict""" diff --git a/jcapiv2/jcapiv2/models/provider_admin_req.py b/jcapiv2/jcapiv2/models/provider_admin_req.py index cbe2b61..b0170da 100644 --- a/jcapiv2/jcapiv2/models/provider_admin_req.py +++ b/jcapiv2/jcapiv2/models/provider_admin_req.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class ProviderAdminReq(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,28 +28,37 @@ class ProviderAdminReq(object): and the value is json key in definition. """ swagger_types = { + 'bind_no_orgs': 'bool', 'email': 'str', 'enable_multi_factor': 'bool', 'firstname': 'str', - 'lastname': 'str' + 'lastname': 'str', + 'role': 'str', + 'role_name': 'str' } attribute_map = { + 'bind_no_orgs': 'bindNoOrgs', 'email': 'email', 'enable_multi_factor': 'enableMultiFactor', 'firstname': 'firstname', - 'lastname': 'lastname' + 'lastname': 'lastname', + 'role': 'role', + 'role_name': 'roleName' } - def __init__(self, email=None, enable_multi_factor=None, firstname=None, lastname=None): # noqa: E501 + def __init__(self, bind_no_orgs=False, email=None, enable_multi_factor=None, firstname=None, lastname=None, role=None, role_name=None): # noqa: E501 """ProviderAdminReq - a model defined in Swagger""" # noqa: E501 - + self._bind_no_orgs = None self._email = None self._enable_multi_factor = None self._firstname = None self._lastname = None + self._role = None + self._role_name = None self.discriminator = None - + if bind_no_orgs is not None: + self.bind_no_orgs = bind_no_orgs self.email = email if enable_multi_factor is not None: self.enable_multi_factor = enable_multi_factor @@ -60,6 +66,31 @@ def __init__(self, email=None, enable_multi_factor=None, firstname=None, lastnam self.firstname = firstname if lastname is not None: self.lastname = lastname + if role is not None: + self.role = role + if role_name is not None: + self.role_name = role_name + + @property + def bind_no_orgs(self): + """Gets the bind_no_orgs of this ProviderAdminReq. # noqa: E501 + + + :return: The bind_no_orgs of this ProviderAdminReq. # noqa: E501 + :rtype: bool + """ + return self._bind_no_orgs + + @bind_no_orgs.setter + def bind_no_orgs(self, bind_no_orgs): + """Sets the bind_no_orgs of this ProviderAdminReq. + + + :param bind_no_orgs: The bind_no_orgs of this ProviderAdminReq. # noqa: E501 + :type: bool + """ + + self._bind_no_orgs = bind_no_orgs @property def email(self): @@ -147,6 +178,48 @@ def lastname(self, lastname): self._lastname = lastname + @property + def role(self): + """Gets the role of this ProviderAdminReq. # noqa: E501 + + + :return: The role of this ProviderAdminReq. # noqa: E501 + :rtype: str + """ + return self._role + + @role.setter + def role(self, role): + """Sets the role of this ProviderAdminReq. + + + :param role: The role of this ProviderAdminReq. # noqa: E501 + :type: str + """ + + self._role = role + + @property + def role_name(self): + """Gets the role_name of this ProviderAdminReq. # noqa: E501 + + + :return: The role_name of this ProviderAdminReq. # noqa: E501 + :rtype: str + """ + return self._role_name + + @role_name.setter + def role_name(self, role_name): + """Sets the role_name of this ProviderAdminReq. + + + :param role_name: The role_name of this ProviderAdminReq. # noqa: E501 + :type: str + """ + + self._role_name = role_name + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/jcapiv2/jcapiv2/models/provider_contact.py b/jcapiv2/jcapiv2/models/provider_contact.py deleted file mode 100644 index 2ee1b39..0000000 --- a/jcapiv2/jcapiv2/models/provider_contact.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class ProviderContact(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'email': 'str', - 'name': 'str' - } - - attribute_map = { - 'email': 'email', - 'name': 'name' - } - - def __init__(self, email=None, name=None): # noqa: E501 - """ProviderContact - a model defined in Swagger""" # noqa: E501 - - self._email = None - self._name = None - self.discriminator = None - - if email is not None: - self.email = email - if name is not None: - self.name = name - - @property - def email(self): - """Gets the email of this ProviderContact. # noqa: E501 - - - :return: The email of this ProviderContact. # noqa: E501 - :rtype: str - """ - return self._email - - @email.setter - def email(self, email): - """Sets the email of this ProviderContact. - - - :param email: The email of this ProviderContact. # noqa: E501 - :type: str - """ - - self._email = email - - @property - def name(self): - """Gets the name of this ProviderContact. # noqa: E501 - - - :return: The name of this ProviderContact. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this ProviderContact. - - - :param name: The name of this ProviderContact. # noqa: E501 - :type: str - """ - - self._name = name - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(ProviderContact, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ProviderContact): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/provider_invoice.py b/jcapiv2/jcapiv2/models/provider_invoice.py new file mode 100644 index 0000000..62568be --- /dev/null +++ b/jcapiv2/jcapiv2/models/provider_invoice.py @@ -0,0 +1,266 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ProviderInvoice(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'amount_billed': 'str', + 'amount_paid': 'str', + 'amount_remaining': 'str', + 'currency': 'str', + 'due_date': 'str', + 'id': 'str', + 'status': 'str' + } + + attribute_map = { + 'amount_billed': 'amountBilled', + 'amount_paid': 'amountPaid', + 'amount_remaining': 'amountRemaining', + 'currency': 'currency', + 'due_date': 'dueDate', + 'id': 'id', + 'status': 'status' + } + + def __init__(self, amount_billed=None, amount_paid=None, amount_remaining=None, currency=None, due_date=None, id=None, status=None): # noqa: E501 + """ProviderInvoice - a model defined in Swagger""" # noqa: E501 + self._amount_billed = None + self._amount_paid = None + self._amount_remaining = None + self._currency = None + self._due_date = None + self._id = None + self._status = None + self.discriminator = None + if amount_billed is not None: + self.amount_billed = amount_billed + if amount_paid is not None: + self.amount_paid = amount_paid + if amount_remaining is not None: + self.amount_remaining = amount_remaining + if currency is not None: + self.currency = currency + if due_date is not None: + self.due_date = due_date + if id is not None: + self.id = id + if status is not None: + self.status = status + + @property + def amount_billed(self): + """Gets the amount_billed of this ProviderInvoice. # noqa: E501 + + + :return: The amount_billed of this ProviderInvoice. # noqa: E501 + :rtype: str + """ + return self._amount_billed + + @amount_billed.setter + def amount_billed(self, amount_billed): + """Sets the amount_billed of this ProviderInvoice. + + + :param amount_billed: The amount_billed of this ProviderInvoice. # noqa: E501 + :type: str + """ + + self._amount_billed = amount_billed + + @property + def amount_paid(self): + """Gets the amount_paid of this ProviderInvoice. # noqa: E501 + + + :return: The amount_paid of this ProviderInvoice. # noqa: E501 + :rtype: str + """ + return self._amount_paid + + @amount_paid.setter + def amount_paid(self, amount_paid): + """Sets the amount_paid of this ProviderInvoice. + + + :param amount_paid: The amount_paid of this ProviderInvoice. # noqa: E501 + :type: str + """ + + self._amount_paid = amount_paid + + @property + def amount_remaining(self): + """Gets the amount_remaining of this ProviderInvoice. # noqa: E501 + + + :return: The amount_remaining of this ProviderInvoice. # noqa: E501 + :rtype: str + """ + return self._amount_remaining + + @amount_remaining.setter + def amount_remaining(self, amount_remaining): + """Sets the amount_remaining of this ProviderInvoice. + + + :param amount_remaining: The amount_remaining of this ProviderInvoice. # noqa: E501 + :type: str + """ + + self._amount_remaining = amount_remaining + + @property + def currency(self): + """Gets the currency of this ProviderInvoice. # noqa: E501 + + + :return: The currency of this ProviderInvoice. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this ProviderInvoice. + + + :param currency: The currency of this ProviderInvoice. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def due_date(self): + """Gets the due_date of this ProviderInvoice. # noqa: E501 + + + :return: The due_date of this ProviderInvoice. # noqa: E501 + :rtype: str + """ + return self._due_date + + @due_date.setter + def due_date(self, due_date): + """Sets the due_date of this ProviderInvoice. + + + :param due_date: The due_date of this ProviderInvoice. # noqa: E501 + :type: str + """ + + self._due_date = due_date + + @property + def id(self): + """Gets the id of this ProviderInvoice. # noqa: E501 + + + :return: The id of this ProviderInvoice. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ProviderInvoice. + + + :param id: The id of this ProviderInvoice. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def status(self): + """Gets the status of this ProviderInvoice. # noqa: E501 + + + :return: The status of this ProviderInvoice. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ProviderInvoice. + + + :param status: The status of this ProviderInvoice. # noqa: E501 + :type: str + """ + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ProviderInvoice, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ProviderInvoice): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/provider_invoice_response.py b/jcapiv2/jcapiv2/models/provider_invoice_response.py new file mode 100644 index 0000000..70daf24 --- /dev/null +++ b/jcapiv2/jcapiv2/models/provider_invoice_response.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ProviderInvoiceResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'records': 'list[ProviderInvoice]', + 'total_count': 'int' + } + + attribute_map = { + 'records': 'records', + 'total_count': 'totalCount' + } + + def __init__(self, records=None, total_count=None): # noqa: E501 + """ProviderInvoiceResponse - a model defined in Swagger""" # noqa: E501 + self._records = None + self._total_count = None + self.discriminator = None + if records is not None: + self.records = records + if total_count is not None: + self.total_count = total_count + + @property + def records(self): + """Gets the records of this ProviderInvoiceResponse. # noqa: E501 + + + :return: The records of this ProviderInvoiceResponse. # noqa: E501 + :rtype: list[ProviderInvoice] + """ + return self._records + + @records.setter + def records(self, records): + """Sets the records of this ProviderInvoiceResponse. + + + :param records: The records of this ProviderInvoiceResponse. # noqa: E501 + :type: list[ProviderInvoice] + """ + + self._records = records + + @property + def total_count(self): + """Gets the total_count of this ProviderInvoiceResponse. # noqa: E501 + + + :return: The total_count of this ProviderInvoiceResponse. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this ProviderInvoiceResponse. + + + :param total_count: The total_count of this ProviderInvoiceResponse. # noqa: E501 + :type: int + """ + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ProviderInvoiceResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ProviderInvoiceResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/push_endpoint_response.py b/jcapiv2/jcapiv2/models/push_endpoint_response.py new file mode 100644 index 0000000..573d1ea --- /dev/null +++ b/jcapiv2/jcapiv2/models/push_endpoint_response.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PushEndpointResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'device': 'PushEndpointResponseDevice', + 'enrollment_date': 'datetime', + 'id': 'str', + 'last_used_date': 'datetime', + 'name': 'str', + 'state': 'str' + } + + attribute_map = { + 'device': 'device', + 'enrollment_date': 'enrollmentDate', + 'id': 'id', + 'last_used_date': 'lastUsedDate', + 'name': 'name', + 'state': 'state' + } + + def __init__(self, device=None, enrollment_date=None, id=None, last_used_date=None, name=None, state=None): # noqa: E501 + """PushEndpointResponse - a model defined in Swagger""" # noqa: E501 + self._device = None + self._enrollment_date = None + self._id = None + self._last_used_date = None + self._name = None + self._state = None + self.discriminator = None + if device is not None: + self.device = device + if enrollment_date is not None: + self.enrollment_date = enrollment_date + if id is not None: + self.id = id + if last_used_date is not None: + self.last_used_date = last_used_date + if name is not None: + self.name = name + if state is not None: + self.state = state + + @property + def device(self): + """Gets the device of this PushEndpointResponse. # noqa: E501 + + + :return: The device of this PushEndpointResponse. # noqa: E501 + :rtype: PushEndpointResponseDevice + """ + return self._device + + @device.setter + def device(self, device): + """Sets the device of this PushEndpointResponse. + + + :param device: The device of this PushEndpointResponse. # noqa: E501 + :type: PushEndpointResponseDevice + """ + + self._device = device + + @property + def enrollment_date(self): + """Gets the enrollment_date of this PushEndpointResponse. # noqa: E501 + + + :return: The enrollment_date of this PushEndpointResponse. # noqa: E501 + :rtype: datetime + """ + return self._enrollment_date + + @enrollment_date.setter + def enrollment_date(self, enrollment_date): + """Sets the enrollment_date of this PushEndpointResponse. + + + :param enrollment_date: The enrollment_date of this PushEndpointResponse. # noqa: E501 + :type: datetime + """ + + self._enrollment_date = enrollment_date + + @property + def id(self): + """Gets the id of this PushEndpointResponse. # noqa: E501 + + + :return: The id of this PushEndpointResponse. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this PushEndpointResponse. + + + :param id: The id of this PushEndpointResponse. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def last_used_date(self): + """Gets the last_used_date of this PushEndpointResponse. # noqa: E501 + + + :return: The last_used_date of this PushEndpointResponse. # noqa: E501 + :rtype: datetime + """ + return self._last_used_date + + @last_used_date.setter + def last_used_date(self, last_used_date): + """Sets the last_used_date of this PushEndpointResponse. + + + :param last_used_date: The last_used_date of this PushEndpointResponse. # noqa: E501 + :type: datetime + """ + + self._last_used_date = last_used_date + + @property + def name(self): + """Gets the name of this PushEndpointResponse. # noqa: E501 + + + :return: The name of this PushEndpointResponse. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this PushEndpointResponse. + + + :param name: The name of this PushEndpointResponse. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def state(self): + """Gets the state of this PushEndpointResponse. # noqa: E501 + + + :return: The state of this PushEndpointResponse. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this PushEndpointResponse. + + + :param state: The state of this PushEndpointResponse. # noqa: E501 + :type: str + """ + + self._state = state + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PushEndpointResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PushEndpointResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/push_endpoint_response_device.py b/jcapiv2/jcapiv2/models/push_endpoint_response_device.py new file mode 100644 index 0000000..0c6dd67 --- /dev/null +++ b/jcapiv2/jcapiv2/models/push_endpoint_response_device.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PushEndpointResponseDevice(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'app_version': 'str', + 'make': 'str', + 'model': 'str', + 'os': 'str', + 'os_version': 'str', + 'uv_enabled': 'bool' + } + + attribute_map = { + 'app_version': 'appVersion', + 'make': 'make', + 'model': 'model', + 'os': 'os', + 'os_version': 'osVersion', + 'uv_enabled': 'uvEnabled' + } + + def __init__(self, app_version=None, make=None, model=None, os=None, os_version=None, uv_enabled=None): # noqa: E501 + """PushEndpointResponseDevice - a model defined in Swagger""" # noqa: E501 + self._app_version = None + self._make = None + self._model = None + self._os = None + self._os_version = None + self._uv_enabled = None + self.discriminator = None + if app_version is not None: + self.app_version = app_version + if make is not None: + self.make = make + if model is not None: + self.model = model + if os is not None: + self.os = os + if os_version is not None: + self.os_version = os_version + if uv_enabled is not None: + self.uv_enabled = uv_enabled + + @property + def app_version(self): + """Gets the app_version of this PushEndpointResponseDevice. # noqa: E501 + + + :return: The app_version of this PushEndpointResponseDevice. # noqa: E501 + :rtype: str + """ + return self._app_version + + @app_version.setter + def app_version(self, app_version): + """Sets the app_version of this PushEndpointResponseDevice. + + + :param app_version: The app_version of this PushEndpointResponseDevice. # noqa: E501 + :type: str + """ + + self._app_version = app_version + + @property + def make(self): + """Gets the make of this PushEndpointResponseDevice. # noqa: E501 + + + :return: The make of this PushEndpointResponseDevice. # noqa: E501 + :rtype: str + """ + return self._make + + @make.setter + def make(self, make): + """Sets the make of this PushEndpointResponseDevice. + + + :param make: The make of this PushEndpointResponseDevice. # noqa: E501 + :type: str + """ + + self._make = make + + @property + def model(self): + """Gets the model of this PushEndpointResponseDevice. # noqa: E501 + + + :return: The model of this PushEndpointResponseDevice. # noqa: E501 + :rtype: str + """ + return self._model + + @model.setter + def model(self, model): + """Sets the model of this PushEndpointResponseDevice. + + + :param model: The model of this PushEndpointResponseDevice. # noqa: E501 + :type: str + """ + + self._model = model + + @property + def os(self): + """Gets the os of this PushEndpointResponseDevice. # noqa: E501 + + + :return: The os of this PushEndpointResponseDevice. # noqa: E501 + :rtype: str + """ + return self._os + + @os.setter + def os(self, os): + """Sets the os of this PushEndpointResponseDevice. + + + :param os: The os of this PushEndpointResponseDevice. # noqa: E501 + :type: str + """ + + self._os = os + + @property + def os_version(self): + """Gets the os_version of this PushEndpointResponseDevice. # noqa: E501 + + + :return: The os_version of this PushEndpointResponseDevice. # noqa: E501 + :rtype: str + """ + return self._os_version + + @os_version.setter + def os_version(self, os_version): + """Sets the os_version of this PushEndpointResponseDevice. + + + :param os_version: The os_version of this PushEndpointResponseDevice. # noqa: E501 + :type: str + """ + + self._os_version = os_version + + @property + def uv_enabled(self): + """Gets the uv_enabled of this PushEndpointResponseDevice. # noqa: E501 + + + :return: The uv_enabled of this PushEndpointResponseDevice. # noqa: E501 + :rtype: bool + """ + return self._uv_enabled + + @uv_enabled.setter + def uv_enabled(self, uv_enabled): + """Sets the uv_enabled of this PushEndpointResponseDevice. + + + :param uv_enabled: The uv_enabled of this PushEndpointResponseDevice. # noqa: E501 + :type: bool + """ + + self._uv_enabled = uv_enabled + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PushEndpointResponseDevice, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PushEndpointResponseDevice): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/pushendpoints_push_endpoint_id_body.py b/jcapiv2/jcapiv2/models/pushendpoints_push_endpoint_id_body.py new file mode 100644 index 0000000..7973548 --- /dev/null +++ b/jcapiv2/jcapiv2/models/pushendpoints_push_endpoint_id_body.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PushendpointsPushEndpointIdBody(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'state': 'str' + } + + attribute_map = { + 'name': 'name', + 'state': 'state' + } + + def __init__(self, name=None, state=None): # noqa: E501 + """PushendpointsPushEndpointIdBody - a model defined in Swagger""" # noqa: E501 + self._name = None + self._state = None + self.discriminator = None + if name is not None: + self.name = name + if state is not None: + self.state = state + + @property + def name(self): + """Gets the name of this PushendpointsPushEndpointIdBody. # noqa: E501 + + + :return: The name of this PushendpointsPushEndpointIdBody. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this PushendpointsPushEndpointIdBody. + + + :param name: The name of this PushendpointsPushEndpointIdBody. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def state(self): + """Gets the state of this PushendpointsPushEndpointIdBody. # noqa: E501 + + + :return: The state of this PushendpointsPushEndpointIdBody. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this PushendpointsPushEndpointIdBody. + + + :param state: The state of this PushendpointsPushEndpointIdBody. # noqa: E501 + :type: str + """ + allowed_values = ["active", "inactive"] # noqa: E501 + if state not in allowed_values: + raise ValueError( + "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 + .format(state, allowed_values) + ) + + self._state = state + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PushendpointsPushEndpointIdBody, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PushendpointsPushEndpointIdBody): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/pwm_all_users.py b/jcapiv2/jcapiv2/models/pwm_all_users.py new file mode 100644 index 0000000..0b002be --- /dev/null +++ b/jcapiv2/jcapiv2/models/pwm_all_users.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PwmAllUsers(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[PwmAllUsersResults]', + 'total_count': 'int' + } + + attribute_map = { + 'results': 'results', + 'total_count': 'totalCount' + } + + def __init__(self, results=None, total_count=None): # noqa: E501 + """PwmAllUsers - a model defined in Swagger""" # noqa: E501 + self._results = None + self._total_count = None + self.discriminator = None + self.results = results + self.total_count = total_count + + @property + def results(self): + """Gets the results of this PwmAllUsers. # noqa: E501 + + + :return: The results of this PwmAllUsers. # noqa: E501 + :rtype: list[PwmAllUsersResults] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this PwmAllUsers. + + + :param results: The results of this PwmAllUsers. # noqa: E501 + :type: list[PwmAllUsersResults] + """ + if results is None: + raise ValueError("Invalid value for `results`, must not be `None`") # noqa: E501 + + self._results = results + + @property + def total_count(self): + """Gets the total_count of this PwmAllUsers. # noqa: E501 + + + :return: The total_count of this PwmAllUsers. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this PwmAllUsers. + + + :param total_count: The total_count of this PwmAllUsers. # noqa: E501 + :type: int + """ + if total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PwmAllUsers, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PwmAllUsers): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/pwm_all_users_groups.py b/jcapiv2/jcapiv2/models/pwm_all_users_groups.py new file mode 100644 index 0000000..03d47cc --- /dev/null +++ b/jcapiv2/jcapiv2/models/pwm_all_users_groups.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PwmAllUsersGroups(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """PwmAllUsersGroups - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + self.id = id + self.name = name + + @property + def id(self): + """Gets the id of this PwmAllUsersGroups. # noqa: E501 + + + :return: The id of this PwmAllUsersGroups. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this PwmAllUsersGroups. + + + :param id: The id of this PwmAllUsersGroups. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this PwmAllUsersGroups. # noqa: E501 + + + :return: The name of this PwmAllUsersGroups. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this PwmAllUsersGroups. + + + :param name: The name of this PwmAllUsersGroups. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PwmAllUsersGroups, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PwmAllUsersGroups): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/pwm_all_users_results.py b/jcapiv2/jcapiv2/models/pwm_all_users_results.py new file mode 100644 index 0000000..9755e3f --- /dev/null +++ b/jcapiv2/jcapiv2/models/pwm_all_users_results.py @@ -0,0 +1,218 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PwmAllUsersResults(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'email': 'str', + 'groups': 'list[PwmAllUsersGroups]', + 'id': 'str', + 'name': 'str', + 'status': 'str' + } + + attribute_map = { + 'email': 'email', + 'groups': 'groups', + 'id': 'id', + 'name': 'name', + 'status': 'status' + } + + def __init__(self, email=None, groups=None, id=None, name=None, status=None): # noqa: E501 + """PwmAllUsersResults - a model defined in Swagger""" # noqa: E501 + self._email = None + self._groups = None + self._id = None + self._name = None + self._status = None + self.discriminator = None + self.email = email + if groups is not None: + self.groups = groups + self.id = id + self.name = name + self.status = status + + @property + def email(self): + """Gets the email of this PwmAllUsersResults. # noqa: E501 + + + :return: The email of this PwmAllUsersResults. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this PwmAllUsersResults. + + + :param email: The email of this PwmAllUsersResults. # noqa: E501 + :type: str + """ + if email is None: + raise ValueError("Invalid value for `email`, must not be `None`") # noqa: E501 + + self._email = email + + @property + def groups(self): + """Gets the groups of this PwmAllUsersResults. # noqa: E501 + + + :return: The groups of this PwmAllUsersResults. # noqa: E501 + :rtype: list[PwmAllUsersGroups] + """ + return self._groups + + @groups.setter + def groups(self, groups): + """Sets the groups of this PwmAllUsersResults. + + + :param groups: The groups of this PwmAllUsersResults. # noqa: E501 + :type: list[PwmAllUsersGroups] + """ + + self._groups = groups + + @property + def id(self): + """Gets the id of this PwmAllUsersResults. # noqa: E501 + + + :return: The id of this PwmAllUsersResults. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this PwmAllUsersResults. + + + :param id: The id of this PwmAllUsersResults. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this PwmAllUsersResults. # noqa: E501 + + + :return: The name of this PwmAllUsersResults. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this PwmAllUsersResults. + + + :param name: The name of this PwmAllUsersResults. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def status(self): + """Gets the status of this PwmAllUsersResults. # noqa: E501 + + + :return: The status of this PwmAllUsersResults. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this PwmAllUsersResults. + + + :param status: The status of this PwmAllUsersResults. # noqa: E501 + :type: str + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PwmAllUsersResults, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PwmAllUsersResults): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/pwm_overview_app_versions.py b/jcapiv2/jcapiv2/models/pwm_overview_app_versions.py new file mode 100644 index 0000000..c6f2608 --- /dev/null +++ b/jcapiv2/jcapiv2/models/pwm_overview_app_versions.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PwmOverviewAppVersions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[PwmOverviewAppVersionsResults]', + 'total_count': 'int' + } + + attribute_map = { + 'results': 'results', + 'total_count': 'totalCount' + } + + def __init__(self, results=None, total_count=None): # noqa: E501 + """PwmOverviewAppVersions - a model defined in Swagger""" # noqa: E501 + self._results = None + self._total_count = None + self.discriminator = None + self.results = results + self.total_count = total_count + + @property + def results(self): + """Gets the results of this PwmOverviewAppVersions. # noqa: E501 + + + :return: The results of this PwmOverviewAppVersions. # noqa: E501 + :rtype: list[PwmOverviewAppVersionsResults] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this PwmOverviewAppVersions. + + + :param results: The results of this PwmOverviewAppVersions. # noqa: E501 + :type: list[PwmOverviewAppVersionsResults] + """ + if results is None: + raise ValueError("Invalid value for `results`, must not be `None`") # noqa: E501 + + self._results = results + + @property + def total_count(self): + """Gets the total_count of this PwmOverviewAppVersions. # noqa: E501 + + + :return: The total_count of this PwmOverviewAppVersions. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this PwmOverviewAppVersions. + + + :param total_count: The total_count of this PwmOverviewAppVersions. # noqa: E501 + :type: int + """ + if total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PwmOverviewAppVersions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PwmOverviewAppVersions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/pwm_overview_app_versions_results.py b/jcapiv2/jcapiv2/models/pwm_overview_app_versions_results.py new file mode 100644 index 0000000..b4d0244 --- /dev/null +++ b/jcapiv2/jcapiv2/models/pwm_overview_app_versions_results.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PwmOverviewAppVersionsResults(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'users_count': 'int', + 'version': 'str' + } + + attribute_map = { + 'users_count': 'usersCount', + 'version': 'version' + } + + def __init__(self, users_count=None, version=None): # noqa: E501 + """PwmOverviewAppVersionsResults - a model defined in Swagger""" # noqa: E501 + self._users_count = None + self._version = None + self.discriminator = None + if users_count is not None: + self.users_count = users_count + if version is not None: + self.version = version + + @property + def users_count(self): + """Gets the users_count of this PwmOverviewAppVersionsResults. # noqa: E501 + + + :return: The users_count of this PwmOverviewAppVersionsResults. # noqa: E501 + :rtype: int + """ + return self._users_count + + @users_count.setter + def users_count(self, users_count): + """Sets the users_count of this PwmOverviewAppVersionsResults. + + + :param users_count: The users_count of this PwmOverviewAppVersionsResults. # noqa: E501 + :type: int + """ + + self._users_count = users_count + + @property + def version(self): + """Gets the version of this PwmOverviewAppVersionsResults. # noqa: E501 + + + :return: The version of this PwmOverviewAppVersionsResults. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this PwmOverviewAppVersionsResults. + + + :param version: The version of this PwmOverviewAppVersionsResults. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PwmOverviewAppVersionsResults, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PwmOverviewAppVersionsResults): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/pwm_overview_main.py b/jcapiv2/jcapiv2/models/pwm_overview_main.py new file mode 100644 index 0000000..8e81b13 --- /dev/null +++ b/jcapiv2/jcapiv2/models/pwm_overview_main.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PwmOverviewMain(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'devices': 'list[PwmOverviewMainDevices]', + 'pending_invites': 'int', + 'shared_folders': 'int', + 'total_users': 'int' + } + + attribute_map = { + 'devices': 'devices', + 'pending_invites': 'pendingInvites', + 'shared_folders': 'sharedFolders', + 'total_users': 'totalUsers' + } + + def __init__(self, devices=None, pending_invites=None, shared_folders=None, total_users=None): # noqa: E501 + """PwmOverviewMain - a model defined in Swagger""" # noqa: E501 + self._devices = None + self._pending_invites = None + self._shared_folders = None + self._total_users = None + self.discriminator = None + self.devices = devices + self.pending_invites = pending_invites + self.shared_folders = shared_folders + self.total_users = total_users + + @property + def devices(self): + """Gets the devices of this PwmOverviewMain. # noqa: E501 + + + :return: The devices of this PwmOverviewMain. # noqa: E501 + :rtype: list[PwmOverviewMainDevices] + """ + return self._devices + + @devices.setter + def devices(self, devices): + """Sets the devices of this PwmOverviewMain. + + + :param devices: The devices of this PwmOverviewMain. # noqa: E501 + :type: list[PwmOverviewMainDevices] + """ + if devices is None: + raise ValueError("Invalid value for `devices`, must not be `None`") # noqa: E501 + + self._devices = devices + + @property + def pending_invites(self): + """Gets the pending_invites of this PwmOverviewMain. # noqa: E501 + + + :return: The pending_invites of this PwmOverviewMain. # noqa: E501 + :rtype: int + """ + return self._pending_invites + + @pending_invites.setter + def pending_invites(self, pending_invites): + """Sets the pending_invites of this PwmOverviewMain. + + + :param pending_invites: The pending_invites of this PwmOverviewMain. # noqa: E501 + :type: int + """ + if pending_invites is None: + raise ValueError("Invalid value for `pending_invites`, must not be `None`") # noqa: E501 + + self._pending_invites = pending_invites + + @property + def shared_folders(self): + """Gets the shared_folders of this PwmOverviewMain. # noqa: E501 + + + :return: The shared_folders of this PwmOverviewMain. # noqa: E501 + :rtype: int + """ + return self._shared_folders + + @shared_folders.setter + def shared_folders(self, shared_folders): + """Sets the shared_folders of this PwmOverviewMain. + + + :param shared_folders: The shared_folders of this PwmOverviewMain. # noqa: E501 + :type: int + """ + if shared_folders is None: + raise ValueError("Invalid value for `shared_folders`, must not be `None`") # noqa: E501 + + self._shared_folders = shared_folders + + @property + def total_users(self): + """Gets the total_users of this PwmOverviewMain. # noqa: E501 + + + :return: The total_users of this PwmOverviewMain. # noqa: E501 + :rtype: int + """ + return self._total_users + + @total_users.setter + def total_users(self, total_users): + """Sets the total_users of this PwmOverviewMain. + + + :param total_users: The total_users of this PwmOverviewMain. # noqa: E501 + :type: int + """ + if total_users is None: + raise ValueError("Invalid value for `total_users`, must not be `None`") # noqa: E501 + + self._total_users = total_users + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PwmOverviewMain, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PwmOverviewMain): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/pwm_overview_main_devices.py b/jcapiv2/jcapiv2/models/pwm_overview_main_devices.py new file mode 100644 index 0000000..5585de3 --- /dev/null +++ b/jcapiv2/jcapiv2/models/pwm_overview_main_devices.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PwmOverviewMainDevices(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'count': 'int', + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'count': 'count', + 'id': 'id', + 'name': 'name' + } + + def __init__(self, count=None, id=None, name=None): # noqa: E501 + """PwmOverviewMainDevices - a model defined in Swagger""" # noqa: E501 + self._count = None + self._id = None + self._name = None + self.discriminator = None + if count is not None: + self.count = count + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def count(self): + """Gets the count of this PwmOverviewMainDevices. # noqa: E501 + + + :return: The count of this PwmOverviewMainDevices. # noqa: E501 + :rtype: int + """ + return self._count + + @count.setter + def count(self, count): + """Sets the count of this PwmOverviewMainDevices. + + + :param count: The count of this PwmOverviewMainDevices. # noqa: E501 + :type: int + """ + + self._count = count + + @property + def id(self): + """Gets the id of this PwmOverviewMainDevices. # noqa: E501 + + + :return: The id of this PwmOverviewMainDevices. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this PwmOverviewMainDevices. + + + :param id: The id of this PwmOverviewMainDevices. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this PwmOverviewMainDevices. # noqa: E501 + + + :return: The name of this PwmOverviewMainDevices. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this PwmOverviewMainDevices. + + + :param name: The name of this PwmOverviewMainDevices. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PwmOverviewMainDevices, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PwmOverviewMainDevices): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/query.py b/jcapiv2/jcapiv2/models/query.py new file mode 100644 index 0000000..0370df9 --- /dev/null +++ b/jcapiv2/jcapiv2/models/query.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Query(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'query_type': 'str' + } + + attribute_map = { + 'query_type': 'queryType' + } + + discriminator_value_class_map = { + 'FilterQuery': 'FilterQuery' } + + def __init__(self, query_type=None): # noqa: E501 + """Query - a model defined in Swagger""" # noqa: E501 + self._query_type = None + self.discriminator = 'queryType' + self.query_type = query_type + + @property + def query_type(self): + """Gets the query_type of this Query. # noqa: E501 + + + :return: The query_type of this Query. # noqa: E501 + :rtype: str + """ + return self._query_type + + @query_type.setter + def query_type(self, query_type): + """Sets the query_type of this Query. + + + :param query_type: The query_type of this Query. # noqa: E501 + :type: str + """ + if query_type is None: + raise ValueError("Invalid value for `query_type`, must not be `None`") # noqa: E501 + allowed_values = ["FilterQuery"] # noqa: E501 + if query_type not in allowed_values: + raise ValueError( + "Invalid value for `query_type` ({0}), must be one of {1}" # noqa: E501 + .format(query_type, allowed_values) + ) + + self._query_type = query_type + + def get_real_child_model(self, data): + """Returns the real base class specified by the discriminator""" + discriminator_value = data[self.discriminator].lower() + return self.discriminator_value_class_map.get(discriminator_value) + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Query, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Query): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/queued_command_list.py b/jcapiv2/jcapiv2/models/queued_command_list.py new file mode 100644 index 0000000..c8cedba --- /dev/null +++ b/jcapiv2/jcapiv2/models/queued_command_list.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class QueuedCommandList(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[QueuedCommandListResults]', + 'total_count': 'int' + } + + attribute_map = { + 'results': 'results', + 'total_count': 'totalCount' + } + + def __init__(self, results=None, total_count=None): # noqa: E501 + """QueuedCommandList - a model defined in Swagger""" # noqa: E501 + self._results = None + self._total_count = None + self.discriminator = None + if results is not None: + self.results = results + if total_count is not None: + self.total_count = total_count + + @property + def results(self): + """Gets the results of this QueuedCommandList. # noqa: E501 + + + :return: The results of this QueuedCommandList. # noqa: E501 + :rtype: list[QueuedCommandListResults] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this QueuedCommandList. + + + :param results: The results of this QueuedCommandList. # noqa: E501 + :type: list[QueuedCommandListResults] + """ + + self._results = results + + @property + def total_count(self): + """Gets the total_count of this QueuedCommandList. # noqa: E501 + + The total number of queued command results. # noqa: E501 + + :return: The total_count of this QueuedCommandList. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this QueuedCommandList. + + The total number of queued command results. # noqa: E501 + + :param total_count: The total_count of this QueuedCommandList. # noqa: E501 + :type: int + """ + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(QueuedCommandList, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, QueuedCommandList): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/queued_command_list_results.py b/jcapiv2/jcapiv2/models/queued_command_list_results.py new file mode 100644 index 0000000..b8bbd56 --- /dev/null +++ b/jcapiv2/jcapiv2/models/queued_command_list_results.py @@ -0,0 +1,196 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class QueuedCommandListResults(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'command': 'str', + 'id': 'str', + 'pending_count': 'int', + 'system': 'str' + } + + attribute_map = { + 'command': 'command', + 'id': 'id', + 'pending_count': 'pendingCount', + 'system': 'system' + } + + def __init__(self, command=None, id=None, pending_count=None, system=None): # noqa: E501 + """QueuedCommandListResults - a model defined in Swagger""" # noqa: E501 + self._command = None + self._id = None + self._pending_count = None + self._system = None + self.discriminator = None + if command is not None: + self.command = command + if id is not None: + self.id = id + if pending_count is not None: + self.pending_count = pending_count + if system is not None: + self.system = system + + @property + def command(self): + """Gets the command of this QueuedCommandListResults. # noqa: E501 + + The ID of the command, from savedAgentCommands. # noqa: E501 + + :return: The command of this QueuedCommandListResults. # noqa: E501 + :rtype: str + """ + return self._command + + @command.setter + def command(self, command): + """Sets the command of this QueuedCommandListResults. + + The ID of the command, from savedAgentCommands. # noqa: E501 + + :param command: The command of this QueuedCommandListResults. # noqa: E501 + :type: str + """ + + self._command = command + + @property + def id(self): + """Gets the id of this QueuedCommandListResults. # noqa: E501 + + The workflowInstanceId. # noqa: E501 + + :return: The id of this QueuedCommandListResults. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this QueuedCommandListResults. + + The workflowInstanceId. # noqa: E501 + + :param id: The id of this QueuedCommandListResults. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def pending_count(self): + """Gets the pending_count of this QueuedCommandListResults. # noqa: E501 + + The number of devices that still haven't received the directive. # noqa: E501 + + :return: The pending_count of this QueuedCommandListResults. # noqa: E501 + :rtype: int + """ + return self._pending_count + + @pending_count.setter + def pending_count(self, pending_count): + """Sets the pending_count of this QueuedCommandListResults. + + The number of devices that still haven't received the directive. # noqa: E501 + + :param pending_count: The pending_count of this QueuedCommandListResults. # noqa: E501 + :type: int + """ + + self._pending_count = pending_count + + @property + def system(self): + """Gets the system of this QueuedCommandListResults. # noqa: E501 + + The ID of the device the command is bound to. # noqa: E501 + + :return: The system of this QueuedCommandListResults. # noqa: E501 + :rtype: str + """ + return self._system + + @system.setter + def system(self, system): + """Sets the system of this QueuedCommandListResults. + + The ID of the device the command is bound to. # noqa: E501 + + :param system: The system of this QueuedCommandListResults. # noqa: E501 + :type: str + """ + + self._system = system + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(QueuedCommandListResults, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, QueuedCommandListResults): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/salesforce_knowledge_list_output.py b/jcapiv2/jcapiv2/models/salesforce_knowledge_list_output.py deleted file mode 100644 index 4830409..0000000 --- a/jcapiv2/jcapiv2/models/salesforce_knowledge_list_output.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - -from jcapiv2.models.salesforceknowledgelistoutput_inner import SalesforceknowledgelistoutputInner # noqa: F401,E501 - - -class SalesforceKnowledgeListOutput(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """SalesforceKnowledgeListOutput - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SalesforceKnowledgeListOutput, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SalesforceKnowledgeListOutput): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/salesforceknowledgelistoutput_inner.py b/jcapiv2/jcapiv2/models/salesforceknowledgelistoutput_inner.py deleted file mode 100644 index 100bce1..0000000 --- a/jcapiv2/jcapiv2/models/salesforceknowledgelistoutput_inner.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class SalesforceknowledgelistoutputInner(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'str' - } - - attribute_map = { - 'id': 'id' - } - - def __init__(self, id=None): # noqa: E501 - """SalesforceknowledgelistoutputInner - a model defined in Swagger""" # noqa: E501 - - self._id = None - self.discriminator = None - - if id is not None: - self.id = id - - @property - def id(self): - """Gets the id of this SalesforceknowledgelistoutputInner. # noqa: E501 - - - :return: The id of this SalesforceknowledgelistoutputInner. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this SalesforceknowledgelistoutputInner. - - - :param id: The id of this SalesforceknowledgelistoutputInner. # noqa: E501 - :type: str - """ - - self._id = id - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SalesforceknowledgelistoutputInner, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SalesforceknowledgelistoutputInner): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/samba_domain_input.py b/jcapiv2/jcapiv2/models/samba_domain_input.py index adf7252..1f6ec2a 100644 --- a/jcapiv2/jcapiv2/models/samba_domain_input.py +++ b/jcapiv2/jcapiv2/models/samba_domain_input.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SambaDomainInput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,11 +39,9 @@ class SambaDomainInput(object): def __init__(self, name=None, sid=None): # noqa: E501 """SambaDomainInput - a model defined in Swagger""" # noqa: E501 - self._name = None self._sid = None self.discriminator = None - self.name = name self.sid = sid diff --git a/jcapiv2/jcapiv2/models/samba_domain_output.py b/jcapiv2/jcapiv2/models/samba_domain_output.py index 844c2fb..e6c3496 100644 --- a/jcapiv2/jcapiv2/models/samba_domain_output.py +++ b/jcapiv2/jcapiv2/models/samba_domain_output.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.samba_domain_input import SambaDomainInput # noqa: F401,E501 - - class SambaDomainOutput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -34,27 +29,21 @@ class SambaDomainOutput(object): """ swagger_types = { 'name': 'str', - 'sid': 'str', - 'id': 'str' + 'sid': 'str' } attribute_map = { 'name': 'name', - 'sid': 'sid', - 'id': 'id' + 'sid': 'sid' } - def __init__(self, name=None, sid=None, id=None): # noqa: E501 + def __init__(self, name=None, sid=None): # noqa: E501 """SambaDomainOutput - a model defined in Swagger""" # noqa: E501 - self._name = None self._sid = None - self._id = None self.discriminator = None - self.name = name self.sid = sid - self.id = id @property def name(self): @@ -106,31 +95,6 @@ def sid(self, sid): self._sid = sid - @property - def id(self): - """Gets the id of this SambaDomainOutput. # noqa: E501 - - Unique identifier of this domain # noqa: E501 - - :return: The id of this SambaDomainOutput. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this SambaDomainOutput. - - Unique identifier of this domain # noqa: E501 - - :param id: The id of this SambaDomainOutput. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/jcapiv2/jcapiv2/models/scheduled_userstate_result.py b/jcapiv2/jcapiv2/models/scheduled_userstate_result.py new file mode 100644 index 0000000..5baf7b0 --- /dev/null +++ b/jcapiv2/jcapiv2/models/scheduled_userstate_result.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ScheduledUserstateResult(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'scheduled_date': 'str', + 'scheduled_job_id': 'str', + 'state': 'str', + 'system_user_id': 'str' + } + + attribute_map = { + 'scheduled_date': 'scheduledDate', + 'scheduled_job_id': 'scheduledJobId', + 'state': 'state', + 'system_user_id': 'systemUserId' + } + + def __init__(self, scheduled_date=None, scheduled_job_id=None, state=None, system_user_id=None): # noqa: E501 + """ScheduledUserstateResult - a model defined in Swagger""" # noqa: E501 + self._scheduled_date = None + self._scheduled_job_id = None + self._state = None + self._system_user_id = None + self.discriminator = None + if scheduled_date is not None: + self.scheduled_date = scheduled_date + if scheduled_job_id is not None: + self.scheduled_job_id = scheduled_job_id + if state is not None: + self.state = state + if system_user_id is not None: + self.system_user_id = system_user_id + + @property + def scheduled_date(self): + """Gets the scheduled_date of this ScheduledUserstateResult. # noqa: E501 + + + :return: The scheduled_date of this ScheduledUserstateResult. # noqa: E501 + :rtype: str + """ + return self._scheduled_date + + @scheduled_date.setter + def scheduled_date(self, scheduled_date): + """Sets the scheduled_date of this ScheduledUserstateResult. + + + :param scheduled_date: The scheduled_date of this ScheduledUserstateResult. # noqa: E501 + :type: str + """ + + self._scheduled_date = scheduled_date + + @property + def scheduled_job_id(self): + """Gets the scheduled_job_id of this ScheduledUserstateResult. # noqa: E501 + + + :return: The scheduled_job_id of this ScheduledUserstateResult. # noqa: E501 + :rtype: str + """ + return self._scheduled_job_id + + @scheduled_job_id.setter + def scheduled_job_id(self, scheduled_job_id): + """Sets the scheduled_job_id of this ScheduledUserstateResult. + + + :param scheduled_job_id: The scheduled_job_id of this ScheduledUserstateResult. # noqa: E501 + :type: str + """ + + self._scheduled_job_id = scheduled_job_id + + @property + def state(self): + """Gets the state of this ScheduledUserstateResult. # noqa: E501 + + + :return: The state of this ScheduledUserstateResult. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this ScheduledUserstateResult. + + + :param state: The state of this ScheduledUserstateResult. # noqa: E501 + :type: str + """ + + self._state = state + + @property + def system_user_id(self): + """Gets the system_user_id of this ScheduledUserstateResult. # noqa: E501 + + + :return: The system_user_id of this ScheduledUserstateResult. # noqa: E501 + :rtype: str + """ + return self._system_user_id + + @system_user_id.setter + def system_user_id(self, system_user_id): + """Sets the system_user_id of this ScheduledUserstateResult. + + + :param system_user_id: The system_user_id of this ScheduledUserstateResult. # noqa: E501 + :type: str + """ + + self._system_user_id = system_user_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ScheduledUserstateResult, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ScheduledUserstateResult): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/setup_assistant_option.py b/jcapiv2/jcapiv2/models/setup_assistant_option.py new file mode 100644 index 0000000..b5358cc --- /dev/null +++ b/jcapiv2/jcapiv2/models/setup_assistant_option.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SetupAssistantOption(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + ACCESSIBILITY = "accessibility" + APPEARANCE = "appearance" + APPLEID = "appleID" + BIOMETRIC = "biometric" + DIAGNOSTICS = "diagnostics" + DISPLAYTONE = "displayTone" + FILEVAULT = "fileVault" + ICLOUDDIAGNOSTICS = "icloudDiagnostics" + ICLOUDSTORAGE = "icloudStorage" + LOCATION = "location" + PAYMENT = "payment" + PRIVACY = "privacy" + RESTORE = "restore" + SCREENTIME = "screenTime" + SIRI = "siri" + TOS = "tos" + APPSTORE = "appStore" + DISPLAYZOOM = "displayZoom" + DEVICETODEVICEMIGRATION = "deviceToDeviceMigration" + HOMEBUTTON = "homeButton" + IMESSAGEANDFACETIME = "imessageAndFacetime" + MESSAGINGACTIVATIONUSINGPHONENUMBER = "messagingActivationUsingPhoneNumber" + MOVEFROMANDROID = "moveFromAndroid" + PASSCODE = "passcode" + RESTORECOMPLETE = "restoreComplete" + SETUPCELLULAR = "setupCellular" + SOFTWAREUPDATE = "softwareUpdate" + UNLOCKWITHWATCH = "unlockWithWatch" + UPDATECOMPLETE = "updateComplete" + WATCHMIGRATION = "watchMigration" + WELCOME = "welcome" + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """SetupAssistantOption - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SetupAssistantOption, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SetupAssistantOption): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/shared_folder_access_levels.py b/jcapiv2/jcapiv2/models/shared_folder_access_levels.py new file mode 100644 index 0000000..cd29149 --- /dev/null +++ b/jcapiv2/jcapiv2/models/shared_folder_access_levels.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SharedFolderAccessLevels(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[SharedFolderAccessLevelsResults]' + } + + attribute_map = { + 'results': 'results' + } + + def __init__(self, results=None): # noqa: E501 + """SharedFolderAccessLevels - a model defined in Swagger""" # noqa: E501 + self._results = None + self.discriminator = None + self.results = results + + @property + def results(self): + """Gets the results of this SharedFolderAccessLevels. # noqa: E501 + + + :return: The results of this SharedFolderAccessLevels. # noqa: E501 + :rtype: list[SharedFolderAccessLevelsResults] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this SharedFolderAccessLevels. + + + :param results: The results of this SharedFolderAccessLevels. # noqa: E501 + :type: list[SharedFolderAccessLevelsResults] + """ + if results is None: + raise ValueError("Invalid value for `results`, must not be `None`") # noqa: E501 + + self._results = results + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SharedFolderAccessLevels, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SharedFolderAccessLevels): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/shared_folder_access_levels_results.py b/jcapiv2/jcapiv2/models/shared_folder_access_levels_results.py new file mode 100644 index 0000000..30212d3 --- /dev/null +++ b/jcapiv2/jcapiv2/models/shared_folder_access_levels_results.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SharedFolderAccessLevelsResults(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'description': 'str', + 'id': 'str', + 'name': 'str' + } + + attribute_map = { + 'description': 'description', + 'id': 'id', + 'name': 'name' + } + + def __init__(self, description=None, id=None, name=None): # noqa: E501 + """SharedFolderAccessLevelsResults - a model defined in Swagger""" # noqa: E501 + self._description = None + self._id = None + self._name = None + self.discriminator = None + if description is not None: + self.description = description + self.id = id + self.name = name + + @property + def description(self): + """Gets the description of this SharedFolderAccessLevelsResults. # noqa: E501 + + + :return: The description of this SharedFolderAccessLevelsResults. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this SharedFolderAccessLevelsResults. + + + :param description: The description of this SharedFolderAccessLevelsResults. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def id(self): + """Gets the id of this SharedFolderAccessLevelsResults. # noqa: E501 + + + :return: The id of this SharedFolderAccessLevelsResults. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SharedFolderAccessLevelsResults. + + + :param id: The id of this SharedFolderAccessLevelsResults. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this SharedFolderAccessLevelsResults. # noqa: E501 + + + :return: The name of this SharedFolderAccessLevelsResults. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SharedFolderAccessLevelsResults. + + + :param name: The name of this SharedFolderAccessLevelsResults. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SharedFolderAccessLevelsResults, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SharedFolderAccessLevelsResults): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/shared_folder_details.py b/jcapiv2/jcapiv2/models/shared_folder_details.py new file mode 100644 index 0000000..f6eeaaa --- /dev/null +++ b/jcapiv2/jcapiv2/models/shared_folder_details.py @@ -0,0 +1,219 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SharedFolderDetails(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'str', + 'items_in_folder': 'int', + 'name': 'str', + 'users_with_access': 'int', + 'uuid': 'str' + } + + attribute_map = { + 'created_at': 'createdAt', + 'items_in_folder': 'itemsInFolder', + 'name': 'name', + 'users_with_access': 'usersWithAccess', + 'uuid': 'uuid' + } + + def __init__(self, created_at=None, items_in_folder=None, name=None, users_with_access=None, uuid=None): # noqa: E501 + """SharedFolderDetails - a model defined in Swagger""" # noqa: E501 + self._created_at = None + self._items_in_folder = None + self._name = None + self._users_with_access = None + self._uuid = None + self.discriminator = None + self.created_at = created_at + self.items_in_folder = items_in_folder + self.name = name + self.users_with_access = users_with_access + self.uuid = uuid + + @property + def created_at(self): + """Gets the created_at of this SharedFolderDetails. # noqa: E501 + + + :return: The created_at of this SharedFolderDetails. # noqa: E501 + :rtype: str + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this SharedFolderDetails. + + + :param created_at: The created_at of this SharedFolderDetails. # noqa: E501 + :type: str + """ + if created_at is None: + raise ValueError("Invalid value for `created_at`, must not be `None`") # noqa: E501 + + self._created_at = created_at + + @property + def items_in_folder(self): + """Gets the items_in_folder of this SharedFolderDetails. # noqa: E501 + + + :return: The items_in_folder of this SharedFolderDetails. # noqa: E501 + :rtype: int + """ + return self._items_in_folder + + @items_in_folder.setter + def items_in_folder(self, items_in_folder): + """Sets the items_in_folder of this SharedFolderDetails. + + + :param items_in_folder: The items_in_folder of this SharedFolderDetails. # noqa: E501 + :type: int + """ + if items_in_folder is None: + raise ValueError("Invalid value for `items_in_folder`, must not be `None`") # noqa: E501 + + self._items_in_folder = items_in_folder + + @property + def name(self): + """Gets the name of this SharedFolderDetails. # noqa: E501 + + + :return: The name of this SharedFolderDetails. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SharedFolderDetails. + + + :param name: The name of this SharedFolderDetails. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def users_with_access(self): + """Gets the users_with_access of this SharedFolderDetails. # noqa: E501 + + + :return: The users_with_access of this SharedFolderDetails. # noqa: E501 + :rtype: int + """ + return self._users_with_access + + @users_with_access.setter + def users_with_access(self, users_with_access): + """Sets the users_with_access of this SharedFolderDetails. + + + :param users_with_access: The users_with_access of this SharedFolderDetails. # noqa: E501 + :type: int + """ + if users_with_access is None: + raise ValueError("Invalid value for `users_with_access`, must not be `None`") # noqa: E501 + + self._users_with_access = users_with_access + + @property + def uuid(self): + """Gets the uuid of this SharedFolderDetails. # noqa: E501 + + + :return: The uuid of this SharedFolderDetails. # noqa: E501 + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid): + """Sets the uuid of this SharedFolderDetails. + + + :param uuid: The uuid of this SharedFolderDetails. # noqa: E501 + :type: str + """ + if uuid is None: + raise ValueError("Invalid value for `uuid`, must not be `None`") # noqa: E501 + + self._uuid = uuid + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SharedFolderDetails, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SharedFolderDetails): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/shared_folder_users.py b/jcapiv2/jcapiv2/models/shared_folder_users.py new file mode 100644 index 0000000..b3352b5 --- /dev/null +++ b/jcapiv2/jcapiv2/models/shared_folder_users.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SharedFolderUsers(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[SharedFolderUsersResults]', + 'total_count': 'int' + } + + attribute_map = { + 'results': 'results', + 'total_count': 'totalCount' + } + + def __init__(self, results=None, total_count=None): # noqa: E501 + """SharedFolderUsers - a model defined in Swagger""" # noqa: E501 + self._results = None + self._total_count = None + self.discriminator = None + self.results = results + self.total_count = total_count + + @property + def results(self): + """Gets the results of this SharedFolderUsers. # noqa: E501 + + + :return: The results of this SharedFolderUsers. # noqa: E501 + :rtype: list[SharedFolderUsersResults] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this SharedFolderUsers. + + + :param results: The results of this SharedFolderUsers. # noqa: E501 + :type: list[SharedFolderUsersResults] + """ + if results is None: + raise ValueError("Invalid value for `results`, must not be `None`") # noqa: E501 + + self._results = results + + @property + def total_count(self): + """Gets the total_count of this SharedFolderUsers. # noqa: E501 + + + :return: The total_count of this SharedFolderUsers. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this SharedFolderUsers. + + + :param total_count: The total_count of this SharedFolderUsers. # noqa: E501 + :type: int + """ + if total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SharedFolderUsers, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SharedFolderUsers): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/shared_folder_users_results.py b/jcapiv2/jcapiv2/models/shared_folder_users_results.py new file mode 100644 index 0000000..da99bb7 --- /dev/null +++ b/jcapiv2/jcapiv2/models/shared_folder_users_results.py @@ -0,0 +1,246 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SharedFolderUsersResults(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'access_level_id': 'str', + 'access_level_name': 'str', + 'email': 'str', + 'id': 'str', + 'name': 'str', + 'status': 'str' + } + + attribute_map = { + 'access_level_id': 'accessLevelId', + 'access_level_name': 'accessLevelName', + 'email': 'email', + 'id': 'id', + 'name': 'name', + 'status': 'status' + } + + def __init__(self, access_level_id=None, access_level_name=None, email=None, id=None, name=None, status=None): # noqa: E501 + """SharedFolderUsersResults - a model defined in Swagger""" # noqa: E501 + self._access_level_id = None + self._access_level_name = None + self._email = None + self._id = None + self._name = None + self._status = None + self.discriminator = None + self.access_level_id = access_level_id + self.access_level_name = access_level_name + self.email = email + self.id = id + self.name = name + self.status = status + + @property + def access_level_id(self): + """Gets the access_level_id of this SharedFolderUsersResults. # noqa: E501 + + + :return: The access_level_id of this SharedFolderUsersResults. # noqa: E501 + :rtype: str + """ + return self._access_level_id + + @access_level_id.setter + def access_level_id(self, access_level_id): + """Sets the access_level_id of this SharedFolderUsersResults. + + + :param access_level_id: The access_level_id of this SharedFolderUsersResults. # noqa: E501 + :type: str + """ + if access_level_id is None: + raise ValueError("Invalid value for `access_level_id`, must not be `None`") # noqa: E501 + + self._access_level_id = access_level_id + + @property + def access_level_name(self): + """Gets the access_level_name of this SharedFolderUsersResults. # noqa: E501 + + + :return: The access_level_name of this SharedFolderUsersResults. # noqa: E501 + :rtype: str + """ + return self._access_level_name + + @access_level_name.setter + def access_level_name(self, access_level_name): + """Sets the access_level_name of this SharedFolderUsersResults. + + + :param access_level_name: The access_level_name of this SharedFolderUsersResults. # noqa: E501 + :type: str + """ + if access_level_name is None: + raise ValueError("Invalid value for `access_level_name`, must not be `None`") # noqa: E501 + + self._access_level_name = access_level_name + + @property + def email(self): + """Gets the email of this SharedFolderUsersResults. # noqa: E501 + + + :return: The email of this SharedFolderUsersResults. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this SharedFolderUsersResults. + + + :param email: The email of this SharedFolderUsersResults. # noqa: E501 + :type: str + """ + if email is None: + raise ValueError("Invalid value for `email`, must not be `None`") # noqa: E501 + + self._email = email + + @property + def id(self): + """Gets the id of this SharedFolderUsersResults. # noqa: E501 + + + :return: The id of this SharedFolderUsersResults. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SharedFolderUsersResults. + + + :param id: The id of this SharedFolderUsersResults. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this SharedFolderUsersResults. # noqa: E501 + + + :return: The name of this SharedFolderUsersResults. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SharedFolderUsersResults. + + + :param name: The name of this SharedFolderUsersResults. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def status(self): + """Gets the status of this SharedFolderUsersResults. # noqa: E501 + + + :return: The status of this SharedFolderUsersResults. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this SharedFolderUsersResults. + + + :param status: The status of this SharedFolderUsersResults. # noqa: E501 + :type: str + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SharedFolderUsersResults, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SharedFolderUsersResults): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/shared_folders_list.py b/jcapiv2/jcapiv2/models/shared_folders_list.py new file mode 100644 index 0000000..a904676 --- /dev/null +++ b/jcapiv2/jcapiv2/models/shared_folders_list.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SharedFoldersList(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'results': 'list[SharedFoldersListResults]', + 'total_count': 'int' + } + + attribute_map = { + 'results': 'results', + 'total_count': 'totalCount' + } + + def __init__(self, results=None, total_count=None): # noqa: E501 + """SharedFoldersList - a model defined in Swagger""" # noqa: E501 + self._results = None + self._total_count = None + self.discriminator = None + self.results = results + self.total_count = total_count + + @property + def results(self): + """Gets the results of this SharedFoldersList. # noqa: E501 + + + :return: The results of this SharedFoldersList. # noqa: E501 + :rtype: list[SharedFoldersListResults] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this SharedFoldersList. + + + :param results: The results of this SharedFoldersList. # noqa: E501 + :type: list[SharedFoldersListResults] + """ + if results is None: + raise ValueError("Invalid value for `results`, must not be `None`") # noqa: E501 + + self._results = results + + @property + def total_count(self): + """Gets the total_count of this SharedFoldersList. # noqa: E501 + + + :return: The total_count of this SharedFoldersList. # noqa: E501 + :rtype: int + """ + return self._total_count + + @total_count.setter + def total_count(self, total_count): + """Sets the total_count of this SharedFoldersList. + + + :param total_count: The total_count of this SharedFoldersList. # noqa: E501 + :type: int + """ + if total_count is None: + raise ValueError("Invalid value for `total_count`, must not be `None`") # noqa: E501 + + self._total_count = total_count + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SharedFoldersList, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SharedFoldersList): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/shared_folders_list_results.py b/jcapiv2/jcapiv2/models/shared_folders_list_results.py new file mode 100644 index 0000000..62a7a45 --- /dev/null +++ b/jcapiv2/jcapiv2/models/shared_folders_list_results.py @@ -0,0 +1,219 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SharedFoldersListResults(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'str', + 'items_in_folder': 'int', + 'name': 'str', + 'users_with_access': 'int', + 'uuid': 'str' + } + + attribute_map = { + 'created_at': 'createdAt', + 'items_in_folder': 'itemsInFolder', + 'name': 'name', + 'users_with_access': 'usersWithAccess', + 'uuid': 'uuid' + } + + def __init__(self, created_at=None, items_in_folder=None, name=None, users_with_access=None, uuid=None): # noqa: E501 + """SharedFoldersListResults - a model defined in Swagger""" # noqa: E501 + self._created_at = None + self._items_in_folder = None + self._name = None + self._users_with_access = None + self._uuid = None + self.discriminator = None + self.created_at = created_at + self.items_in_folder = items_in_folder + self.name = name + self.users_with_access = users_with_access + self.uuid = uuid + + @property + def created_at(self): + """Gets the created_at of this SharedFoldersListResults. # noqa: E501 + + + :return: The created_at of this SharedFoldersListResults. # noqa: E501 + :rtype: str + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this SharedFoldersListResults. + + + :param created_at: The created_at of this SharedFoldersListResults. # noqa: E501 + :type: str + """ + if created_at is None: + raise ValueError("Invalid value for `created_at`, must not be `None`") # noqa: E501 + + self._created_at = created_at + + @property + def items_in_folder(self): + """Gets the items_in_folder of this SharedFoldersListResults. # noqa: E501 + + + :return: The items_in_folder of this SharedFoldersListResults. # noqa: E501 + :rtype: int + """ + return self._items_in_folder + + @items_in_folder.setter + def items_in_folder(self, items_in_folder): + """Sets the items_in_folder of this SharedFoldersListResults. + + + :param items_in_folder: The items_in_folder of this SharedFoldersListResults. # noqa: E501 + :type: int + """ + if items_in_folder is None: + raise ValueError("Invalid value for `items_in_folder`, must not be `None`") # noqa: E501 + + self._items_in_folder = items_in_folder + + @property + def name(self): + """Gets the name of this SharedFoldersListResults. # noqa: E501 + + + :return: The name of this SharedFoldersListResults. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SharedFoldersListResults. + + + :param name: The name of this SharedFoldersListResults. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def users_with_access(self): + """Gets the users_with_access of this SharedFoldersListResults. # noqa: E501 + + + :return: The users_with_access of this SharedFoldersListResults. # noqa: E501 + :rtype: int + """ + return self._users_with_access + + @users_with_access.setter + def users_with_access(self, users_with_access): + """Sets the users_with_access of this SharedFoldersListResults. + + + :param users_with_access: The users_with_access of this SharedFoldersListResults. # noqa: E501 + :type: int + """ + if users_with_access is None: + raise ValueError("Invalid value for `users_with_access`, must not be `None`") # noqa: E501 + + self._users_with_access = users_with_access + + @property + def uuid(self): + """Gets the uuid of this SharedFoldersListResults. # noqa: E501 + + + :return: The uuid of this SharedFoldersListResults. # noqa: E501 + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid): + """Sets the uuid of this SharedFoldersListResults. + + + :param uuid: The uuid of this SharedFoldersListResults. # noqa: E501 + :type: str + """ + if uuid is None: + raise ValueError("Invalid value for `uuid`, must not be `None`") # noqa: E501 + + self._uuid = uuid + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SharedFoldersListResults, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SharedFoldersListResults): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/software_app.py b/jcapiv2/jcapiv2/models/software_app.py new file mode 100644 index 0000000..0013cf3 --- /dev/null +++ b/jcapiv2/jcapiv2/models/software_app.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SoftwareApp(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'display_name': 'str', + 'id': 'str', + 'settings': 'list[SoftwareAppSettings]' + } + + attribute_map = { + 'display_name': 'displayName', + 'id': 'id', + 'settings': 'settings' + } + + def __init__(self, display_name=None, id=None, settings=None): # noqa: E501 + """SoftwareApp - a model defined in Swagger""" # noqa: E501 + self._display_name = None + self._id = None + self._settings = None + self.discriminator = None + if display_name is not None: + self.display_name = display_name + if id is not None: + self.id = id + if settings is not None: + self.settings = settings + + @property + def display_name(self): + """Gets the display_name of this SoftwareApp. # noqa: E501 + + + :return: The display_name of this SoftwareApp. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this SoftwareApp. + + + :param display_name: The display_name of this SoftwareApp. # noqa: E501 + :type: str + """ + + self._display_name = display_name + + @property + def id(self): + """Gets the id of this SoftwareApp. # noqa: E501 + + + :return: The id of this SoftwareApp. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SoftwareApp. + + + :param id: The id of this SoftwareApp. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def settings(self): + """Gets the settings of this SoftwareApp. # noqa: E501 + + + :return: The settings of this SoftwareApp. # noqa: E501 + :rtype: list[SoftwareAppSettings] + """ + return self._settings + + @settings.setter + def settings(self, settings): + """Sets the settings of this SoftwareApp. + + + :param settings: The settings of this SoftwareApp. # noqa: E501 + :type: list[SoftwareAppSettings] + """ + + self._settings = settings + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SoftwareApp, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SoftwareApp): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/software_app_apple_vpp.py b/jcapiv2/jcapiv2/models/software_app_apple_vpp.py new file mode 100644 index 0000000..5395336 --- /dev/null +++ b/jcapiv2/jcapiv2/models/software_app_apple_vpp.py @@ -0,0 +1,281 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SoftwareAppAppleVpp(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'app_configuration': 'str', + 'assigned_licenses': 'int', + 'available_licenses': 'int', + 'details': 'object', + 'is_config_enabled': 'bool', + 'supported_device_families': 'list[str]', + 'total_licenses': 'int' + } + + attribute_map = { + 'app_configuration': 'appConfiguration', + 'assigned_licenses': 'assignedLicenses', + 'available_licenses': 'availableLicenses', + 'details': 'details', + 'is_config_enabled': 'isConfigEnabled', + 'supported_device_families': 'supportedDeviceFamilies', + 'total_licenses': 'totalLicenses' + } + + def __init__(self, app_configuration=None, assigned_licenses=None, available_licenses=None, details=None, is_config_enabled=None, supported_device_families=None, total_licenses=None): # noqa: E501 + """SoftwareAppAppleVpp - a model defined in Swagger""" # noqa: E501 + self._app_configuration = None + self._assigned_licenses = None + self._available_licenses = None + self._details = None + self._is_config_enabled = None + self._supported_device_families = None + self._total_licenses = None + self.discriminator = None + if app_configuration is not None: + self.app_configuration = app_configuration + if assigned_licenses is not None: + self.assigned_licenses = assigned_licenses + if available_licenses is not None: + self.available_licenses = available_licenses + if details is not None: + self.details = details + if is_config_enabled is not None: + self.is_config_enabled = is_config_enabled + if supported_device_families is not None: + self.supported_device_families = supported_device_families + if total_licenses is not None: + self.total_licenses = total_licenses + + @property + def app_configuration(self): + """Gets the app_configuration of this SoftwareAppAppleVpp. # noqa: E501 + + Text sent to configure the application, the text should be a valid plist. Returned only by 'GET /softwareapps/{id}'. # noqa: E501 + + :return: The app_configuration of this SoftwareAppAppleVpp. # noqa: E501 + :rtype: str + """ + return self._app_configuration + + @app_configuration.setter + def app_configuration(self, app_configuration): + """Sets the app_configuration of this SoftwareAppAppleVpp. + + Text sent to configure the application, the text should be a valid plist. Returned only by 'GET /softwareapps/{id}'. # noqa: E501 + + :param app_configuration: The app_configuration of this SoftwareAppAppleVpp. # noqa: E501 + :type: str + """ + + self._app_configuration = app_configuration + + @property + def assigned_licenses(self): + """Gets the assigned_licenses of this SoftwareAppAppleVpp. # noqa: E501 + + + :return: The assigned_licenses of this SoftwareAppAppleVpp. # noqa: E501 + :rtype: int + """ + return self._assigned_licenses + + @assigned_licenses.setter + def assigned_licenses(self, assigned_licenses): + """Sets the assigned_licenses of this SoftwareAppAppleVpp. + + + :param assigned_licenses: The assigned_licenses of this SoftwareAppAppleVpp. # noqa: E501 + :type: int + """ + + self._assigned_licenses = assigned_licenses + + @property + def available_licenses(self): + """Gets the available_licenses of this SoftwareAppAppleVpp. # noqa: E501 + + + :return: The available_licenses of this SoftwareAppAppleVpp. # noqa: E501 + :rtype: int + """ + return self._available_licenses + + @available_licenses.setter + def available_licenses(self, available_licenses): + """Sets the available_licenses of this SoftwareAppAppleVpp. + + + :param available_licenses: The available_licenses of this SoftwareAppAppleVpp. # noqa: E501 + :type: int + """ + + self._available_licenses = available_licenses + + @property + def details(self): + """Gets the details of this SoftwareAppAppleVpp. # noqa: E501 + + App details returned by iTunes API. See example. The properties in this field are out of our control and we cannot guarantee consistency, so it should be checked by the client and manage the details accordingly. # noqa: E501 + + :return: The details of this SoftwareAppAppleVpp. # noqa: E501 + :rtype: object + """ + return self._details + + @details.setter + def details(self, details): + """Sets the details of this SoftwareAppAppleVpp. + + App details returned by iTunes API. See example. The properties in this field are out of our control and we cannot guarantee consistency, so it should be checked by the client and manage the details accordingly. # noqa: E501 + + :param details: The details of this SoftwareAppAppleVpp. # noqa: E501 + :type: object + """ + + self._details = details + + @property + def is_config_enabled(self): + """Gets the is_config_enabled of this SoftwareAppAppleVpp. # noqa: E501 + + Denotes if configuration has been enabled for the application. Returned only by ''GET /softwareapps/{id}''. # noqa: E501 + + :return: The is_config_enabled of this SoftwareAppAppleVpp. # noqa: E501 + :rtype: bool + """ + return self._is_config_enabled + + @is_config_enabled.setter + def is_config_enabled(self, is_config_enabled): + """Sets the is_config_enabled of this SoftwareAppAppleVpp. + + Denotes if configuration has been enabled for the application. Returned only by ''GET /softwareapps/{id}''. # noqa: E501 + + :param is_config_enabled: The is_config_enabled of this SoftwareAppAppleVpp. # noqa: E501 + :type: bool + """ + + self._is_config_enabled = is_config_enabled + + @property + def supported_device_families(self): + """Gets the supported_device_families of this SoftwareAppAppleVpp. # noqa: E501 + + The supported device families for this VPP Application. # noqa: E501 + + :return: The supported_device_families of this SoftwareAppAppleVpp. # noqa: E501 + :rtype: list[str] + """ + return self._supported_device_families + + @supported_device_families.setter + def supported_device_families(self, supported_device_families): + """Sets the supported_device_families of this SoftwareAppAppleVpp. + + The supported device families for this VPP Application. # noqa: E501 + + :param supported_device_families: The supported_device_families of this SoftwareAppAppleVpp. # noqa: E501 + :type: list[str] + """ + allowed_values = ["IPAD", "IPHONE", "IPOD", "MAC"] # noqa: E501 + if not set(supported_device_families).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `supported_device_families` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(supported_device_families) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._supported_device_families = supported_device_families + + @property + def total_licenses(self): + """Gets the total_licenses of this SoftwareAppAppleVpp. # noqa: E501 + + + :return: The total_licenses of this SoftwareAppAppleVpp. # noqa: E501 + :rtype: int + """ + return self._total_licenses + + @total_licenses.setter + def total_licenses(self, total_licenses): + """Sets the total_licenses of this SoftwareAppAppleVpp. + + + :param total_licenses: The total_licenses of this SoftwareAppAppleVpp. # noqa: E501 + :type: int + """ + + self._total_licenses = total_licenses + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SoftwareAppAppleVpp, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SoftwareAppAppleVpp): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/software_app_reclaim_licenses.py b/jcapiv2/jcapiv2/models/software_app_reclaim_licenses.py new file mode 100644 index 0000000..0586482 --- /dev/null +++ b/jcapiv2/jcapiv2/models/software_app_reclaim_licenses.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SoftwareAppReclaimLicenses(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'assigned_licenses': 'int', + 'available_licenses': 'int', + 'reclaimed_licenses': 'int', + 'total_licenses': 'int' + } + + attribute_map = { + 'assigned_licenses': 'assignedLicenses', + 'available_licenses': 'availableLicenses', + 'reclaimed_licenses': 'reclaimedLicenses', + 'total_licenses': 'totalLicenses' + } + + def __init__(self, assigned_licenses=None, available_licenses=None, reclaimed_licenses=None, total_licenses=None): # noqa: E501 + """SoftwareAppReclaimLicenses - a model defined in Swagger""" # noqa: E501 + self._assigned_licenses = None + self._available_licenses = None + self._reclaimed_licenses = None + self._total_licenses = None + self.discriminator = None + if assigned_licenses is not None: + self.assigned_licenses = assigned_licenses + if available_licenses is not None: + self.available_licenses = available_licenses + if reclaimed_licenses is not None: + self.reclaimed_licenses = reclaimed_licenses + if total_licenses is not None: + self.total_licenses = total_licenses + + @property + def assigned_licenses(self): + """Gets the assigned_licenses of this SoftwareAppReclaimLicenses. # noqa: E501 + + + :return: The assigned_licenses of this SoftwareAppReclaimLicenses. # noqa: E501 + :rtype: int + """ + return self._assigned_licenses + + @assigned_licenses.setter + def assigned_licenses(self, assigned_licenses): + """Sets the assigned_licenses of this SoftwareAppReclaimLicenses. + + + :param assigned_licenses: The assigned_licenses of this SoftwareAppReclaimLicenses. # noqa: E501 + :type: int + """ + + self._assigned_licenses = assigned_licenses + + @property + def available_licenses(self): + """Gets the available_licenses of this SoftwareAppReclaimLicenses. # noqa: E501 + + + :return: The available_licenses of this SoftwareAppReclaimLicenses. # noqa: E501 + :rtype: int + """ + return self._available_licenses + + @available_licenses.setter + def available_licenses(self, available_licenses): + """Sets the available_licenses of this SoftwareAppReclaimLicenses. + + + :param available_licenses: The available_licenses of this SoftwareAppReclaimLicenses. # noqa: E501 + :type: int + """ + + self._available_licenses = available_licenses + + @property + def reclaimed_licenses(self): + """Gets the reclaimed_licenses of this SoftwareAppReclaimLicenses. # noqa: E501 + + + :return: The reclaimed_licenses of this SoftwareAppReclaimLicenses. # noqa: E501 + :rtype: int + """ + return self._reclaimed_licenses + + @reclaimed_licenses.setter + def reclaimed_licenses(self, reclaimed_licenses): + """Sets the reclaimed_licenses of this SoftwareAppReclaimLicenses. + + + :param reclaimed_licenses: The reclaimed_licenses of this SoftwareAppReclaimLicenses. # noqa: E501 + :type: int + """ + + self._reclaimed_licenses = reclaimed_licenses + + @property + def total_licenses(self): + """Gets the total_licenses of this SoftwareAppReclaimLicenses. # noqa: E501 + + + :return: The total_licenses of this SoftwareAppReclaimLicenses. # noqa: E501 + :rtype: int + """ + return self._total_licenses + + @total_licenses.setter + def total_licenses(self, total_licenses): + """Sets the total_licenses of this SoftwareAppReclaimLicenses. + + + :param total_licenses: The total_licenses of this SoftwareAppReclaimLicenses. # noqa: E501 + :type: int + """ + + self._total_licenses = total_licenses + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SoftwareAppReclaimLicenses, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SoftwareAppReclaimLicenses): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/software_app_settings.py b/jcapiv2/jcapiv2/models/software_app_settings.py new file mode 100644 index 0000000..21ba4a2 --- /dev/null +++ b/jcapiv2/jcapiv2/models/software_app_settings.py @@ -0,0 +1,496 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SoftwareAppSettings(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'allow_update_delay': 'bool', + 'apple_vpp': 'SoftwareAppAppleVpp', + 'asset_kind': 'str', + 'asset_sha256_size': 'int', + 'asset_sha256_strings': 'list[str]', + 'auto_update': 'bool', + 'description': 'str', + 'desired_state': 'str', + 'location': 'str', + 'location_object_id': 'str', + 'package_id': 'str', + 'package_kind': 'str', + 'package_manager': 'str', + 'package_subtitle': 'str', + 'package_version': 'str' + } + + attribute_map = { + 'allow_update_delay': 'allowUpdateDelay', + 'apple_vpp': 'appleVpp', + 'asset_kind': 'assetKind', + 'asset_sha256_size': 'assetSha256Size', + 'asset_sha256_strings': 'assetSha256Strings', + 'auto_update': 'autoUpdate', + 'description': 'description', + 'desired_state': 'desiredState', + 'location': 'location', + 'location_object_id': 'locationObjectId', + 'package_id': 'packageId', + 'package_kind': 'packageKind', + 'package_manager': 'packageManager', + 'package_subtitle': 'packageSubtitle', + 'package_version': 'packageVersion' + } + + def __init__(self, allow_update_delay=False, apple_vpp=None, asset_kind=None, asset_sha256_size=None, asset_sha256_strings=None, auto_update=False, description=None, desired_state=None, location=None, location_object_id=None, package_id=None, package_kind=None, package_manager=None, package_subtitle=None, package_version=None): # noqa: E501 + """SoftwareAppSettings - a model defined in Swagger""" # noqa: E501 + self._allow_update_delay = None + self._apple_vpp = None + self._asset_kind = None + self._asset_sha256_size = None + self._asset_sha256_strings = None + self._auto_update = None + self._description = None + self._desired_state = None + self._location = None + self._location_object_id = None + self._package_id = None + self._package_kind = None + self._package_manager = None + self._package_subtitle = None + self._package_version = None + self.discriminator = None + if allow_update_delay is not None: + self.allow_update_delay = allow_update_delay + if apple_vpp is not None: + self.apple_vpp = apple_vpp + if asset_kind is not None: + self.asset_kind = asset_kind + if asset_sha256_size is not None: + self.asset_sha256_size = asset_sha256_size + if asset_sha256_strings is not None: + self.asset_sha256_strings = asset_sha256_strings + if auto_update is not None: + self.auto_update = auto_update + if description is not None: + self.description = description + if desired_state is not None: + self.desired_state = desired_state + if location is not None: + self.location = location + if location_object_id is not None: + self.location_object_id = location_object_id + if package_id is not None: + self.package_id = package_id + if package_kind is not None: + self.package_kind = package_kind + if package_manager is not None: + self.package_manager = package_manager + if package_subtitle is not None: + self.package_subtitle = package_subtitle + if package_version is not None: + self.package_version = package_version + + @property + def allow_update_delay(self): + """Gets the allow_update_delay of this SoftwareAppSettings. # noqa: E501 + + + :return: The allow_update_delay of this SoftwareAppSettings. # noqa: E501 + :rtype: bool + """ + return self._allow_update_delay + + @allow_update_delay.setter + def allow_update_delay(self, allow_update_delay): + """Sets the allow_update_delay of this SoftwareAppSettings. + + + :param allow_update_delay: The allow_update_delay of this SoftwareAppSettings. # noqa: E501 + :type: bool + """ + + self._allow_update_delay = allow_update_delay + + @property + def apple_vpp(self): + """Gets the apple_vpp of this SoftwareAppSettings. # noqa: E501 + + + :return: The apple_vpp of this SoftwareAppSettings. # noqa: E501 + :rtype: SoftwareAppAppleVpp + """ + return self._apple_vpp + + @apple_vpp.setter + def apple_vpp(self, apple_vpp): + """Sets the apple_vpp of this SoftwareAppSettings. + + + :param apple_vpp: The apple_vpp of this SoftwareAppSettings. # noqa: E501 + :type: SoftwareAppAppleVpp + """ + + self._apple_vpp = apple_vpp + + @property + def asset_kind(self): + """Gets the asset_kind of this SoftwareAppSettings. # noqa: E501 + + The manifest asset kind (ex: software). # noqa: E501 + + :return: The asset_kind of this SoftwareAppSettings. # noqa: E501 + :rtype: str + """ + return self._asset_kind + + @asset_kind.setter + def asset_kind(self, asset_kind): + """Sets the asset_kind of this SoftwareAppSettings. + + The manifest asset kind (ex: software). # noqa: E501 + + :param asset_kind: The asset_kind of this SoftwareAppSettings. # noqa: E501 + :type: str + """ + + self._asset_kind = asset_kind + + @property + def asset_sha256_size(self): + """Gets the asset_sha256_size of this SoftwareAppSettings. # noqa: E501 + + The incremental size to use for summing the package as it is downloaded. # noqa: E501 + + :return: The asset_sha256_size of this SoftwareAppSettings. # noqa: E501 + :rtype: int + """ + return self._asset_sha256_size + + @asset_sha256_size.setter + def asset_sha256_size(self, asset_sha256_size): + """Sets the asset_sha256_size of this SoftwareAppSettings. + + The incremental size to use for summing the package as it is downloaded. # noqa: E501 + + :param asset_sha256_size: The asset_sha256_size of this SoftwareAppSettings. # noqa: E501 + :type: int + """ + + self._asset_sha256_size = asset_sha256_size + + @property + def asset_sha256_strings(self): + """Gets the asset_sha256_strings of this SoftwareAppSettings. # noqa: E501 + + The array of checksums, one each for the hash size up to the total size of the package. # noqa: E501 + + :return: The asset_sha256_strings of this SoftwareAppSettings. # noqa: E501 + :rtype: list[str] + """ + return self._asset_sha256_strings + + @asset_sha256_strings.setter + def asset_sha256_strings(self, asset_sha256_strings): + """Sets the asset_sha256_strings of this SoftwareAppSettings. + + The array of checksums, one each for the hash size up to the total size of the package. # noqa: E501 + + :param asset_sha256_strings: The asset_sha256_strings of this SoftwareAppSettings. # noqa: E501 + :type: list[str] + """ + + self._asset_sha256_strings = asset_sha256_strings + + @property + def auto_update(self): + """Gets the auto_update of this SoftwareAppSettings. # noqa: E501 + + + :return: The auto_update of this SoftwareAppSettings. # noqa: E501 + :rtype: bool + """ + return self._auto_update + + @auto_update.setter + def auto_update(self, auto_update): + """Sets the auto_update of this SoftwareAppSettings. + + + :param auto_update: The auto_update of this SoftwareAppSettings. # noqa: E501 + :type: bool + """ + + self._auto_update = auto_update + + @property + def description(self): + """Gets the description of this SoftwareAppSettings. # noqa: E501 + + The software app description. # noqa: E501 + + :return: The description of this SoftwareAppSettings. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this SoftwareAppSettings. + + The software app description. # noqa: E501 + + :param description: The description of this SoftwareAppSettings. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def desired_state(self): + """Gets the desired_state of this SoftwareAppSettings. # noqa: E501 + + State of Install or Uninstall # noqa: E501 + + :return: The desired_state of this SoftwareAppSettings. # noqa: E501 + :rtype: str + """ + return self._desired_state + + @desired_state.setter + def desired_state(self, desired_state): + """Sets the desired_state of this SoftwareAppSettings. + + State of Install or Uninstall # noqa: E501 + + :param desired_state: The desired_state of this SoftwareAppSettings. # noqa: E501 + :type: str + """ + + self._desired_state = desired_state + + @property + def location(self): + """Gets the location of this SoftwareAppSettings. # noqa: E501 + + Repository where the app is located within the package manager # noqa: E501 + + :return: The location of this SoftwareAppSettings. # noqa: E501 + :rtype: str + """ + return self._location + + @location.setter + def location(self, location): + """Sets the location of this SoftwareAppSettings. + + Repository where the app is located within the package manager # noqa: E501 + + :param location: The location of this SoftwareAppSettings. # noqa: E501 + :type: str + """ + + self._location = location + + @property + def location_object_id(self): + """Gets the location_object_id of this SoftwareAppSettings. # noqa: E501 + + ID of the repository where the app is located within the package manager # noqa: E501 + + :return: The location_object_id of this SoftwareAppSettings. # noqa: E501 + :rtype: str + """ + return self._location_object_id + + @location_object_id.setter + def location_object_id(self, location_object_id): + """Sets the location_object_id of this SoftwareAppSettings. + + ID of the repository where the app is located within the package manager # noqa: E501 + + :param location_object_id: The location_object_id of this SoftwareAppSettings. # noqa: E501 + :type: str + """ + + self._location_object_id = location_object_id + + @property + def package_id(self): + """Gets the package_id of this SoftwareAppSettings. # noqa: E501 + + + :return: The package_id of this SoftwareAppSettings. # noqa: E501 + :rtype: str + """ + return self._package_id + + @package_id.setter + def package_id(self, package_id): + """Sets the package_id of this SoftwareAppSettings. + + + :param package_id: The package_id of this SoftwareAppSettings. # noqa: E501 + :type: str + """ + + self._package_id = package_id + + @property + def package_kind(self): + """Gets the package_kind of this SoftwareAppSettings. # noqa: E501 + + The package manifest kind (ex: software-package). # noqa: E501 + + :return: The package_kind of this SoftwareAppSettings. # noqa: E501 + :rtype: str + """ + return self._package_kind + + @package_kind.setter + def package_kind(self, package_kind): + """Sets the package_kind of this SoftwareAppSettings. + + The package manifest kind (ex: software-package). # noqa: E501 + + :param package_kind: The package_kind of this SoftwareAppSettings. # noqa: E501 + :type: str + """ + + self._package_kind = package_kind + + @property + def package_manager(self): + """Gets the package_manager of this SoftwareAppSettings. # noqa: E501 + + App store serving the app: APPLE_VPP, CHOCOLATEY, etc. # noqa: E501 + + :return: The package_manager of this SoftwareAppSettings. # noqa: E501 + :rtype: str + """ + return self._package_manager + + @package_manager.setter + def package_manager(self, package_manager): + """Sets the package_manager of this SoftwareAppSettings. + + App store serving the app: APPLE_VPP, CHOCOLATEY, etc. # noqa: E501 + + :param package_manager: The package_manager of this SoftwareAppSettings. # noqa: E501 + :type: str + """ + + self._package_manager = package_manager + + @property + def package_subtitle(self): + """Gets the package_subtitle of this SoftwareAppSettings. # noqa: E501 + + The package manifest subtitle. # noqa: E501 + + :return: The package_subtitle of this SoftwareAppSettings. # noqa: E501 + :rtype: str + """ + return self._package_subtitle + + @package_subtitle.setter + def package_subtitle(self, package_subtitle): + """Sets the package_subtitle of this SoftwareAppSettings. + + The package manifest subtitle. # noqa: E501 + + :param package_subtitle: The package_subtitle of this SoftwareAppSettings. # noqa: E501 + :type: str + """ + + self._package_subtitle = package_subtitle + + @property + def package_version(self): + """Gets the package_version of this SoftwareAppSettings. # noqa: E501 + + The package manifest version. # noqa: E501 + + :return: The package_version of this SoftwareAppSettings. # noqa: E501 + :rtype: str + """ + return self._package_version + + @package_version.setter + def package_version(self, package_version): + """Sets the package_version of this SoftwareAppSettings. + + The package manifest version. # noqa: E501 + + :param package_version: The package_version of this SoftwareAppSettings. # noqa: E501 + :type: str + """ + + self._package_version = package_version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SoftwareAppSettings, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SoftwareAppSettings): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/software_app_status.py b/jcapiv2/jcapiv2/models/software_app_status.py new file mode 100644 index 0000000..6f820e1 --- /dev/null +++ b/jcapiv2/jcapiv2/models/software_app_status.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SoftwareAppStatus(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'code': 'int', + 'details': 'str', + 'id': 'str', + 'software_app_id': 'str', + 'state': 'str', + 'system_id': 'str', + 'timestamp': 'str', + 'version': 'str' + } + + attribute_map = { + 'code': 'code', + 'details': 'details', + 'id': 'id', + 'software_app_id': 'softwareAppId', + 'state': 'state', + 'system_id': 'systemId', + 'timestamp': 'timestamp', + 'version': 'version' + } + + def __init__(self, code=None, details=None, id=None, software_app_id=None, state=None, system_id=None, timestamp=None, version=None): # noqa: E501 + """SoftwareAppStatus - a model defined in Swagger""" # noqa: E501 + self._code = None + self._details = None + self._id = None + self._software_app_id = None + self._state = None + self._system_id = None + self._timestamp = None + self._version = None + self.discriminator = None + if code is not None: + self.code = code + if details is not None: + self.details = details + if id is not None: + self.id = id + if software_app_id is not None: + self.software_app_id = software_app_id + if state is not None: + self.state = state + if system_id is not None: + self.system_id = system_id + if timestamp is not None: + self.timestamp = timestamp + if version is not None: + self.version = version + + @property + def code(self): + """Gets the code of this SoftwareAppStatus. # noqa: E501 + + + :return: The code of this SoftwareAppStatus. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this SoftwareAppStatus. + + + :param code: The code of this SoftwareAppStatus. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def details(self): + """Gets the details of this SoftwareAppStatus. # noqa: E501 + + + :return: The details of this SoftwareAppStatus. # noqa: E501 + :rtype: str + """ + return self._details + + @details.setter + def details(self, details): + """Sets the details of this SoftwareAppStatus. + + + :param details: The details of this SoftwareAppStatus. # noqa: E501 + :type: str + """ + + self._details = details + + @property + def id(self): + """Gets the id of this SoftwareAppStatus. # noqa: E501 + + + :return: The id of this SoftwareAppStatus. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SoftwareAppStatus. + + + :param id: The id of this SoftwareAppStatus. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def software_app_id(self): + """Gets the software_app_id of this SoftwareAppStatus. # noqa: E501 + + + :return: The software_app_id of this SoftwareAppStatus. # noqa: E501 + :rtype: str + """ + return self._software_app_id + + @software_app_id.setter + def software_app_id(self, software_app_id): + """Sets the software_app_id of this SoftwareAppStatus. + + + :param software_app_id: The software_app_id of this SoftwareAppStatus. # noqa: E501 + :type: str + """ + + self._software_app_id = software_app_id + + @property + def state(self): + """Gets the state of this SoftwareAppStatus. # noqa: E501 + + + :return: The state of this SoftwareAppStatus. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this SoftwareAppStatus. + + + :param state: The state of this SoftwareAppStatus. # noqa: E501 + :type: str + """ + + self._state = state + + @property + def system_id(self): + """Gets the system_id of this SoftwareAppStatus. # noqa: E501 + + + :return: The system_id of this SoftwareAppStatus. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SoftwareAppStatus. + + + :param system_id: The system_id of this SoftwareAppStatus. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def timestamp(self): + """Gets the timestamp of this SoftwareAppStatus. # noqa: E501 + + + :return: The timestamp of this SoftwareAppStatus. # noqa: E501 + :rtype: str + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this SoftwareAppStatus. + + + :param timestamp: The timestamp of this SoftwareAppStatus. # noqa: E501 + :type: str + """ + + self._timestamp = timestamp + + @property + def version(self): + """Gets the version of this SoftwareAppStatus. # noqa: E501 + + + :return: The version of this SoftwareAppStatus. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this SoftwareAppStatus. + + + :param version: The version of this SoftwareAppStatus. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SoftwareAppStatus, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SoftwareAppStatus): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/software_app_with_status.py b/jcapiv2/jcapiv2/models/software_app_with_status.py new file mode 100644 index 0000000..32b1a84 --- /dev/null +++ b/jcapiv2/jcapiv2/models/software_app_with_status.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SoftwareAppWithStatus(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'app': 'SoftwareApp', + 'status': 'SoftwareAppStatus' + } + + attribute_map = { + 'app': 'app', + 'status': 'status' + } + + def __init__(self, app=None, status=None): # noqa: E501 + """SoftwareAppWithStatus - a model defined in Swagger""" # noqa: E501 + self._app = None + self._status = None + self.discriminator = None + if app is not None: + self.app = app + if status is not None: + self.status = status + + @property + def app(self): + """Gets the app of this SoftwareAppWithStatus. # noqa: E501 + + + :return: The app of this SoftwareAppWithStatus. # noqa: E501 + :rtype: SoftwareApp + """ + return self._app + + @app.setter + def app(self, app): + """Sets the app of this SoftwareAppWithStatus. + + + :param app: The app of this SoftwareAppWithStatus. # noqa: E501 + :type: SoftwareApp + """ + + self._app = app + + @property + def status(self): + """Gets the status of this SoftwareAppWithStatus. # noqa: E501 + + + :return: The status of this SoftwareAppWithStatus. # noqa: E501 + :rtype: SoftwareAppStatus + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this SoftwareAppWithStatus. + + + :param status: The status of this SoftwareAppWithStatus. # noqa: E501 + :type: SoftwareAppStatus + """ + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SoftwareAppWithStatus, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SoftwareAppWithStatus): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/software_apps_retry_installation_request.py b/jcapiv2/jcapiv2/models/software_apps_retry_installation_request.py new file mode 100644 index 0000000..fe33483 --- /dev/null +++ b/jcapiv2/jcapiv2/models/software_apps_retry_installation_request.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SoftwareAppsRetryInstallationRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'system_ids': 'list[str]' + } + + attribute_map = { + 'system_ids': 'system_ids' + } + + def __init__(self, system_ids=None): # noqa: E501 + """SoftwareAppsRetryInstallationRequest - a model defined in Swagger""" # noqa: E501 + self._system_ids = None + self.discriminator = None + if system_ids is not None: + self.system_ids = system_ids + + @property + def system_ids(self): + """Gets the system_ids of this SoftwareAppsRetryInstallationRequest. # noqa: E501 + + An array of system IDs to retry the software application installation. # noqa: E501 + + :return: The system_ids of this SoftwareAppsRetryInstallationRequest. # noqa: E501 + :rtype: list[str] + """ + return self._system_ids + + @system_ids.setter + def system_ids(self, system_ids): + """Sets the system_ids of this SoftwareAppsRetryInstallationRequest. + + An array of system IDs to retry the software application installation. # noqa: E501 + + :param system_ids: The system_ids of this SoftwareAppsRetryInstallationRequest. # noqa: E501 + :type: list[str] + """ + + self._system_ids = system_ids + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SoftwareAppsRetryInstallationRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SoftwareAppsRetryInstallationRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/sshkeylist.py b/jcapiv2/jcapiv2/models/sshkeylist.py deleted file mode 100644 index ef424c3..0000000 --- a/jcapiv2/jcapiv2/models/sshkeylist.py +++ /dev/null @@ -1,201 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Sshkeylist(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'str', - 'create_date': 'str', - 'name': 'str', - 'public_key': 'str' - } - - attribute_map = { - 'id': '_id', - 'create_date': 'create_date', - 'name': 'name', - 'public_key': 'public_key' - } - - def __init__(self, id=None, create_date=None, name=None, public_key=None): # noqa: E501 - """Sshkeylist - a model defined in Swagger""" # noqa: E501 - - self._id = None - self._create_date = None - self._name = None - self._public_key = None - self.discriminator = None - - if id is not None: - self.id = id - if create_date is not None: - self.create_date = create_date - if name is not None: - self.name = name - if public_key is not None: - self.public_key = public_key - - @property - def id(self): - """Gets the id of this Sshkeylist. # noqa: E501 - - The ID of the SSH key. # noqa: E501 - - :return: The id of this Sshkeylist. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Sshkeylist. - - The ID of the SSH key. # noqa: E501 - - :param id: The id of this Sshkeylist. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def create_date(self): - """Gets the create_date of this Sshkeylist. # noqa: E501 - - The date the SSH key was created. # noqa: E501 - - :return: The create_date of this Sshkeylist. # noqa: E501 - :rtype: str - """ - return self._create_date - - @create_date.setter - def create_date(self, create_date): - """Sets the create_date of this Sshkeylist. - - The date the SSH key was created. # noqa: E501 - - :param create_date: The create_date of this Sshkeylist. # noqa: E501 - :type: str - """ - - self._create_date = create_date - - @property - def name(self): - """Gets the name of this Sshkeylist. # noqa: E501 - - The name of the SSH key. # noqa: E501 - - :return: The name of this Sshkeylist. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Sshkeylist. - - The name of the SSH key. # noqa: E501 - - :param name: The name of this Sshkeylist. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def public_key(self): - """Gets the public_key of this Sshkeylist. # noqa: E501 - - The Public SSH key. # noqa: E501 - - :return: The public_key of this Sshkeylist. # noqa: E501 - :rtype: str - """ - return self._public_key - - @public_key.setter - def public_key(self, public_key): - """Sets the public_key of this Sshkeylist. - - The Public SSH key. # noqa: E501 - - :param public_key: The public_key of this Sshkeylist. # noqa: E501 - :type: str - """ - - self._public_key = public_key - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Sshkeylist, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Sshkeylist): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/subscription.py b/jcapiv2/jcapiv2/models/subscription.py new file mode 100644 index 0000000..d715ea8 --- /dev/null +++ b/jcapiv2/jcapiv2/models/subscription.py @@ -0,0 +1,229 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Subscription(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'annual_price': 'float', + 'display_name': 'str', + 'features': 'list[Feature]', + 'list_price': 'float', + 'product_code': 'str' + } + + attribute_map = { + 'annual_price': 'annualPrice', + 'display_name': 'displayName', + 'features': 'features', + 'list_price': 'listPrice', + 'product_code': 'productCode' + } + + def __init__(self, annual_price=None, display_name=None, features=None, list_price=None, product_code=None): # noqa: E501 + """Subscription - a model defined in Swagger""" # noqa: E501 + self._annual_price = None + self._display_name = None + self._features = None + self._list_price = None + self._product_code = None + self.discriminator = None + self.annual_price = annual_price + self.display_name = display_name + self.features = features + self.list_price = list_price + self.product_code = product_code + + @property + def annual_price(self): + """Gets the annual_price of this Subscription. # noqa: E501 + + The annual (discounted) price of this subscription. # noqa: E501 + + :return: The annual_price of this Subscription. # noqa: E501 + :rtype: float + """ + return self._annual_price + + @annual_price.setter + def annual_price(self, annual_price): + """Sets the annual_price of this Subscription. + + The annual (discounted) price of this subscription. # noqa: E501 + + :param annual_price: The annual_price of this Subscription. # noqa: E501 + :type: float + """ + if annual_price is None: + raise ValueError("Invalid value for `annual_price`, must not be `None`") # noqa: E501 + + self._annual_price = annual_price + + @property + def display_name(self): + """Gets the display_name of this Subscription. # noqa: E501 + + The display name of this subscription. # noqa: E501 + + :return: The display_name of this Subscription. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this Subscription. + + The display name of this subscription. # noqa: E501 + + :param display_name: The display_name of this Subscription. # noqa: E501 + :type: str + """ + if display_name is None: + raise ValueError("Invalid value for `display_name`, must not be `None`") # noqa: E501 + + self._display_name = display_name + + @property + def features(self): + """Gets the features of this Subscription. # noqa: E501 + + Array of the features included in the subscription. # noqa: E501 + + :return: The features of this Subscription. # noqa: E501 + :rtype: list[Feature] + """ + return self._features + + @features.setter + def features(self, features): + """Sets the features of this Subscription. + + Array of the features included in the subscription. # noqa: E501 + + :param features: The features of this Subscription. # noqa: E501 + :type: list[Feature] + """ + if features is None: + raise ValueError("Invalid value for `features`, must not be `None`") # noqa: E501 + + self._features = features + + @property + def list_price(self): + """Gets the list_price of this Subscription. # noqa: E501 + + The list price of this subscription. # noqa: E501 + + :return: The list_price of this Subscription. # noqa: E501 + :rtype: float + """ + return self._list_price + + @list_price.setter + def list_price(self, list_price): + """Sets the list_price of this Subscription. + + The list price of this subscription. # noqa: E501 + + :param list_price: The list_price of this Subscription. # noqa: E501 + :type: float + """ + if list_price is None: + raise ValueError("Invalid value for `list_price`, must not be `None`") # noqa: E501 + + self._list_price = list_price + + @property + def product_code(self): + """Gets the product_code of this Subscription. # noqa: E501 + + Unique identifier corresponding to this subscription. # noqa: E501 + + :return: The product_code of this Subscription. # noqa: E501 + :rtype: str + """ + return self._product_code + + @product_code.setter + def product_code(self, product_code): + """Sets the product_code of this Subscription. + + Unique identifier corresponding to this subscription. # noqa: E501 + + :param product_code: The product_code of this Subscription. # noqa: E501 + :type: str + """ + if product_code is None: + raise ValueError("Invalid value for `product_code`, must not be `None`") # noqa: E501 + + self._product_code = product_code + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Subscription, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Subscription): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/suggestion_counts.py b/jcapiv2/jcapiv2/models/suggestion_counts.py new file mode 100644 index 0000000..07142a4 --- /dev/null +++ b/jcapiv2/jcapiv2/models/suggestion_counts.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SuggestionCounts(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'add': 'int', + 'remove': 'int', + 'total': 'int' + } + + attribute_map = { + 'add': 'add', + 'remove': 'remove', + 'total': 'total' + } + + def __init__(self, add=None, remove=None, total=None): # noqa: E501 + """SuggestionCounts - a model defined in Swagger""" # noqa: E501 + self._add = None + self._remove = None + self._total = None + self.discriminator = None + if add is not None: + self.add = add + if remove is not None: + self.remove = remove + if total is not None: + self.total = total + + @property + def add(self): + """Gets the add of this SuggestionCounts. # noqa: E501 + + + :return: The add of this SuggestionCounts. # noqa: E501 + :rtype: int + """ + return self._add + + @add.setter + def add(self, add): + """Sets the add of this SuggestionCounts. + + + :param add: The add of this SuggestionCounts. # noqa: E501 + :type: int + """ + + self._add = add + + @property + def remove(self): + """Gets the remove of this SuggestionCounts. # noqa: E501 + + + :return: The remove of this SuggestionCounts. # noqa: E501 + :rtype: int + """ + return self._remove + + @remove.setter + def remove(self, remove): + """Sets the remove of this SuggestionCounts. + + + :param remove: The remove of this SuggestionCounts. # noqa: E501 + :type: int + """ + + self._remove = remove + + @property + def total(self): + """Gets the total of this SuggestionCounts. # noqa: E501 + + + :return: The total of this SuggestionCounts. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this SuggestionCounts. + + + :param total: The total of this SuggestionCounts. # noqa: E501 + :type: int + """ + + self._total = total + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SuggestionCounts, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SuggestionCounts): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_graph_management_req.py b/jcapiv2/jcapiv2/models/system_graph_management_req.py deleted file mode 100644 index e0241dc..0000000 --- a/jcapiv2/jcapiv2/models/system_graph_management_req.py +++ /dev/null @@ -1,214 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - -from jcapiv2.models.system_graph_management_req_attributes import SystemGraphManagementReqAttributes # noqa: F401,E501 - - -class SystemGraphManagementReq(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'attributes': 'SystemGraphManagementReqAttributes', - 'id': 'str', - 'op': 'str', - 'type': 'str' - } - - attribute_map = { - 'attributes': 'attributes', - 'id': 'id', - 'op': 'op', - 'type': 'type' - } - - def __init__(self, attributes=None, id=None, op=None, type=None): # noqa: E501 - """SystemGraphManagementReq - a model defined in Swagger""" # noqa: E501 - - self._attributes = None - self._id = None - self._op = None - self._type = None - self.discriminator = None - - if attributes is not None: - self.attributes = attributes - self.id = id - self.op = op - self.type = type - - @property - def attributes(self): - """Gets the attributes of this SystemGraphManagementReq. # noqa: E501 - - - :return: The attributes of this SystemGraphManagementReq. # noqa: E501 - :rtype: SystemGraphManagementReqAttributes - """ - return self._attributes - - @attributes.setter - def attributes(self, attributes): - """Sets the attributes of this SystemGraphManagementReq. - - - :param attributes: The attributes of this SystemGraphManagementReq. # noqa: E501 - :type: SystemGraphManagementReqAttributes - """ - - self._attributes = attributes - - @property - def id(self): - """Gets the id of this SystemGraphManagementReq. # noqa: E501 - - The ObjectID of graph object being added or removed as an association. # noqa: E501 - - :return: The id of this SystemGraphManagementReq. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this SystemGraphManagementReq. - - The ObjectID of graph object being added or removed as an association. # noqa: E501 - - :param id: The id of this SystemGraphManagementReq. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def op(self): - """Gets the op of this SystemGraphManagementReq. # noqa: E501 - - How to modify the graph connection. # noqa: E501 - - :return: The op of this SystemGraphManagementReq. # noqa: E501 - :rtype: str - """ - return self._op - - @op.setter - def op(self, op): - """Sets the op of this SystemGraphManagementReq. - - How to modify the graph connection. # noqa: E501 - - :param op: The op of this SystemGraphManagementReq. # noqa: E501 - :type: str - """ - if op is None: - raise ValueError("Invalid value for `op`, must not be `None`") # noqa: E501 - allowed_values = ["add", "remove", "update"] # noqa: E501 - if op not in allowed_values: - raise ValueError( - "Invalid value for `op` ({0}), must be one of {1}" # noqa: E501 - .format(op, allowed_values) - ) - - self._op = op - - @property - def type(self): - """Gets the type of this SystemGraphManagementReq. # noqa: E501 - - - :return: The type of this SystemGraphManagementReq. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this SystemGraphManagementReq. - - - :param type: The type of this SystemGraphManagementReq. # noqa: E501 - :type: str - """ - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["active_directory", "application", "command", "g_suite", "ldap_server", "office_365", "policy", "radius_server", "user", "user_group"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SystemGraphManagementReq, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SystemGraphManagementReq): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/system_graph_management_req_attributes.py b/jcapiv2/jcapiv2/models/system_graph_management_req_attributes.py deleted file mode 100644 index 2541bd1..0000000 --- a/jcapiv2/jcapiv2/models/system_graph_management_req_attributes.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - -from jcapiv2.models.system_graph_management_req_attributes_sudo import SystemGraphManagementReqAttributesSudo # noqa: F401,E501 - - -class SystemGraphManagementReqAttributes(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'sudo': 'SystemGraphManagementReqAttributesSudo' - } - - attribute_map = { - 'sudo': 'sudo' - } - - def __init__(self, sudo=None): # noqa: E501 - """SystemGraphManagementReqAttributes - a model defined in Swagger""" # noqa: E501 - - self._sudo = None - self.discriminator = None - - if sudo is not None: - self.sudo = sudo - - @property - def sudo(self): - """Gets the sudo of this SystemGraphManagementReqAttributes. # noqa: E501 - - - :return: The sudo of this SystemGraphManagementReqAttributes. # noqa: E501 - :rtype: SystemGraphManagementReqAttributesSudo - """ - return self._sudo - - @sudo.setter - def sudo(self, sudo): - """Sets the sudo of this SystemGraphManagementReqAttributes. - - - :param sudo: The sudo of this SystemGraphManagementReqAttributes. # noqa: E501 - :type: SystemGraphManagementReqAttributesSudo - """ - - self._sudo = sudo - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SystemGraphManagementReqAttributes, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SystemGraphManagementReqAttributes): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/system_graph_management_req_attributes_sudo.py b/jcapiv2/jcapiv2/models/system_graph_management_req_attributes_sudo.py deleted file mode 100644 index f8029cd..0000000 --- a/jcapiv2/jcapiv2/models/system_graph_management_req_attributes_sudo.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class SystemGraphManagementReqAttributesSudo(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'enabled': 'bool', - 'without_password': 'bool' - } - - attribute_map = { - 'enabled': 'enabled', - 'without_password': 'withoutPassword' - } - - def __init__(self, enabled=None, without_password=None): # noqa: E501 - """SystemGraphManagementReqAttributesSudo - a model defined in Swagger""" # noqa: E501 - - self._enabled = None - self._without_password = None - self.discriminator = None - - if enabled is not None: - self.enabled = enabled - if without_password is not None: - self.without_password = without_password - - @property - def enabled(self): - """Gets the enabled of this SystemGraphManagementReqAttributesSudo. # noqa: E501 - - - :return: The enabled of this SystemGraphManagementReqAttributesSudo. # noqa: E501 - :rtype: bool - """ - return self._enabled - - @enabled.setter - def enabled(self, enabled): - """Sets the enabled of this SystemGraphManagementReqAttributesSudo. - - - :param enabled: The enabled of this SystemGraphManagementReqAttributesSudo. # noqa: E501 - :type: bool - """ - - self._enabled = enabled - - @property - def without_password(self): - """Gets the without_password of this SystemGraphManagementReqAttributesSudo. # noqa: E501 - - - :return: The without_password of this SystemGraphManagementReqAttributesSudo. # noqa: E501 - :rtype: bool - """ - return self._without_password - - @without_password.setter - def without_password(self, without_password): - """Sets the without_password of this SystemGraphManagementReqAttributesSudo. - - - :param without_password: The without_password of this SystemGraphManagementReqAttributesSudo. # noqa: E501 - :type: bool - """ - - self._without_password = without_password - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SystemGraphManagementReqAttributesSudo, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SystemGraphManagementReqAttributesSudo): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/system_group.py b/jcapiv2/jcapiv2/models/system_group.py index 67fc24f..baeafda 100644 --- a/jcapiv2/jcapiv2/models/system_group.py +++ b/jcapiv2/jcapiv2/models/system_group.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemGroup(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,25 +28,38 @@ class SystemGroup(object): and the value is json key in definition. """ swagger_types = { + 'attributes': 'GraphAttributes', + 'description': 'str', + 'email': 'str', 'id': 'str', 'name': 'str', 'type': 'str' } attribute_map = { + 'attributes': 'attributes', + 'description': 'description', + 'email': 'email', 'id': 'id', 'name': 'name', 'type': 'type' } - def __init__(self, id=None, name=None, type=None): # noqa: E501 + def __init__(self, attributes=None, description=None, email=None, id=None, name=None, type=None): # noqa: E501 """SystemGroup - a model defined in Swagger""" # noqa: E501 - + self._attributes = None + self._description = None + self._email = None self._id = None self._name = None self._type = None self.discriminator = None - + if attributes is not None: + self.attributes = attributes + if description is not None: + self.description = description + if email is not None: + self.email = email if id is not None: self.id = id if name is not None: @@ -57,6 +67,73 @@ def __init__(self, id=None, name=None, type=None): # noqa: E501 if type is not None: self.type = type + @property + def attributes(self): + """Gets the attributes of this SystemGroup. # noqa: E501 + + + :return: The attributes of this SystemGroup. # noqa: E501 + :rtype: GraphAttributes + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this SystemGroup. + + + :param attributes: The attributes of this SystemGroup. # noqa: E501 + :type: GraphAttributes + """ + + self._attributes = attributes + + @property + def description(self): + """Gets the description of this SystemGroup. # noqa: E501 + + Description of a System Group # noqa: E501 + + :return: The description of this SystemGroup. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this SystemGroup. + + Description of a System Group # noqa: E501 + + :param description: The description of this SystemGroup. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def email(self): + """Gets the email of this SystemGroup. # noqa: E501 + + E-mail address associated with a System Group # noqa: E501 + + :return: The email of this SystemGroup. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this SystemGroup. + + E-mail address associated with a System Group # noqa: E501 + + :param email: The email of this SystemGroup. # noqa: E501 + :type: str + """ + + self._email = email + @property def id(self): """Gets the id of this SystemGroup. # noqa: E501 diff --git a/jcapiv2/jcapiv2/models/system_group_data.py b/jcapiv2/jcapiv2/models/system_group_data.py index fb9d365..f91dd3b 100644 --- a/jcapiv2/jcapiv2/models/system_group_data.py +++ b/jcapiv2/jcapiv2/models/system_group_data.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemGroupData(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,10 +37,8 @@ class SystemGroupData(object): def __init__(self, name=None): # noqa: E501 """SystemGroupData - a model defined in Swagger""" # noqa: E501 - self._name = None self.discriminator = None - self.name = name @property diff --git a/jcapiv2/jcapiv2/models/system_group_graph_management_req.py b/jcapiv2/jcapiv2/models/system_group_graph_management_req.py deleted file mode 100644 index 6f60b6f..0000000 --- a/jcapiv2/jcapiv2/models/system_group_graph_management_req.py +++ /dev/null @@ -1,186 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class SystemGroupGraphManagementReq(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'str', - 'op': 'str', - 'type': 'str' - } - - attribute_map = { - 'id': 'id', - 'op': 'op', - 'type': 'type' - } - - def __init__(self, id=None, op=None, type=None): # noqa: E501 - """SystemGroupGraphManagementReq - a model defined in Swagger""" # noqa: E501 - - self._id = None - self._op = None - self._type = None - self.discriminator = None - - self.id = id - self.op = op - self.type = type - - @property - def id(self): - """Gets the id of this SystemGroupGraphManagementReq. # noqa: E501 - - The ObjectID of graph object being added or removed as an association. # noqa: E501 - - :return: The id of this SystemGroupGraphManagementReq. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this SystemGroupGraphManagementReq. - - The ObjectID of graph object being added or removed as an association. # noqa: E501 - - :param id: The id of this SystemGroupGraphManagementReq. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def op(self): - """Gets the op of this SystemGroupGraphManagementReq. # noqa: E501 - - How to modify the graph connection. # noqa: E501 - - :return: The op of this SystemGroupGraphManagementReq. # noqa: E501 - :rtype: str - """ - return self._op - - @op.setter - def op(self, op): - """Sets the op of this SystemGroupGraphManagementReq. - - How to modify the graph connection. # noqa: E501 - - :param op: The op of this SystemGroupGraphManagementReq. # noqa: E501 - :type: str - """ - if op is None: - raise ValueError("Invalid value for `op`, must not be `None`") # noqa: E501 - allowed_values = ["add", "remove", "update"] # noqa: E501 - if op not in allowed_values: - raise ValueError( - "Invalid value for `op` ({0}), must be one of {1}" # noqa: E501 - .format(op, allowed_values) - ) - - self._op = op - - @property - def type(self): - """Gets the type of this SystemGroupGraphManagementReq. # noqa: E501 - - - :return: The type of this SystemGroupGraphManagementReq. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this SystemGroupGraphManagementReq. - - - :param type: The type of this SystemGroupGraphManagementReq. # noqa: E501 - :type: str - """ - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["active_directory", "application", "command", "g_suite", "ldap_server", "office_365", "policy", "radius_server", "user", "user_group"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SystemGroupGraphManagementReq, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SystemGroupGraphManagementReq): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/system_group_members_req.py b/jcapiv2/jcapiv2/models/system_group_members_req.py deleted file mode 100644 index 02f1b47..0000000 --- a/jcapiv2/jcapiv2/models/system_group_members_req.py +++ /dev/null @@ -1,188 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class SystemGroupMembersReq(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'str', - 'op': 'str', - 'type': 'str' - } - - attribute_map = { - 'id': 'id', - 'op': 'op', - 'type': 'type' - } - - def __init__(self, id=None, op=None, type=None): # noqa: E501 - """SystemGroupMembersReq - a model defined in Swagger""" # noqa: E501 - - self._id = None - self._op = None - self._type = None - self.discriminator = None - - self.id = id - self.op = op - self.type = type - - @property - def id(self): - """Gets the id of this SystemGroupMembersReq. # noqa: E501 - - The ObjectID of member being added or removed. # noqa: E501 - - :return: The id of this SystemGroupMembersReq. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this SystemGroupMembersReq. - - The ObjectID of member being added or removed. # noqa: E501 - - :param id: The id of this SystemGroupMembersReq. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def op(self): - """Gets the op of this SystemGroupMembersReq. # noqa: E501 - - How to modify the membership connection. # noqa: E501 - - :return: The op of this SystemGroupMembersReq. # noqa: E501 - :rtype: str - """ - return self._op - - @op.setter - def op(self, op): - """Sets the op of this SystemGroupMembersReq. - - How to modify the membership connection. # noqa: E501 - - :param op: The op of this SystemGroupMembersReq. # noqa: E501 - :type: str - """ - if op is None: - raise ValueError("Invalid value for `op`, must not be `None`") # noqa: E501 - allowed_values = ["add", "remove"] # noqa: E501 - if op not in allowed_values: - raise ValueError( - "Invalid value for `op` ({0}), must be one of {1}" # noqa: E501 - .format(op, allowed_values) - ) - - self._op = op - - @property - def type(self): - """Gets the type of this SystemGroupMembersReq. # noqa: E501 - - The member type. # noqa: E501 - - :return: The type of this SystemGroupMembersReq. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this SystemGroupMembersReq. - - The member type. # noqa: E501 - - :param type: The type of this SystemGroupMembersReq. # noqa: E501 - :type: str - """ - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["system"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SystemGroupMembersReq, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SystemGroupMembersReq): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_alf.py b/jcapiv2/jcapiv2/models/system_insights_alf.py new file mode 100644 index 0000000..1e4be78 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_alf.py @@ -0,0 +1,318 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsAlf(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'allow_signed_enabled': 'int', + 'collection_time': 'str', + 'firewall_unload': 'int', + 'global_state': 'int', + 'logging_enabled': 'int', + 'logging_option': 'int', + 'stealth_enabled': 'int', + 'system_id': 'str', + 'version': 'str' + } + + attribute_map = { + 'allow_signed_enabled': 'allow_signed_enabled', + 'collection_time': 'collection_time', + 'firewall_unload': 'firewall_unload', + 'global_state': 'global_state', + 'logging_enabled': 'logging_enabled', + 'logging_option': 'logging_option', + 'stealth_enabled': 'stealth_enabled', + 'system_id': 'system_id', + 'version': 'version' + } + + def __init__(self, allow_signed_enabled=None, collection_time=None, firewall_unload=None, global_state=None, logging_enabled=None, logging_option=None, stealth_enabled=None, system_id=None, version=None): # noqa: E501 + """SystemInsightsAlf - a model defined in Swagger""" # noqa: E501 + self._allow_signed_enabled = None + self._collection_time = None + self._firewall_unload = None + self._global_state = None + self._logging_enabled = None + self._logging_option = None + self._stealth_enabled = None + self._system_id = None + self._version = None + self.discriminator = None + if allow_signed_enabled is not None: + self.allow_signed_enabled = allow_signed_enabled + if collection_time is not None: + self.collection_time = collection_time + if firewall_unload is not None: + self.firewall_unload = firewall_unload + if global_state is not None: + self.global_state = global_state + if logging_enabled is not None: + self.logging_enabled = logging_enabled + if logging_option is not None: + self.logging_option = logging_option + if stealth_enabled is not None: + self.stealth_enabled = stealth_enabled + if system_id is not None: + self.system_id = system_id + if version is not None: + self.version = version + + @property + def allow_signed_enabled(self): + """Gets the allow_signed_enabled of this SystemInsightsAlf. # noqa: E501 + + + :return: The allow_signed_enabled of this SystemInsightsAlf. # noqa: E501 + :rtype: int + """ + return self._allow_signed_enabled + + @allow_signed_enabled.setter + def allow_signed_enabled(self, allow_signed_enabled): + """Sets the allow_signed_enabled of this SystemInsightsAlf. + + + :param allow_signed_enabled: The allow_signed_enabled of this SystemInsightsAlf. # noqa: E501 + :type: int + """ + + self._allow_signed_enabled = allow_signed_enabled + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsAlf. # noqa: E501 + + + :return: The collection_time of this SystemInsightsAlf. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsAlf. + + + :param collection_time: The collection_time of this SystemInsightsAlf. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def firewall_unload(self): + """Gets the firewall_unload of this SystemInsightsAlf. # noqa: E501 + + + :return: The firewall_unload of this SystemInsightsAlf. # noqa: E501 + :rtype: int + """ + return self._firewall_unload + + @firewall_unload.setter + def firewall_unload(self, firewall_unload): + """Sets the firewall_unload of this SystemInsightsAlf. + + + :param firewall_unload: The firewall_unload of this SystemInsightsAlf. # noqa: E501 + :type: int + """ + + self._firewall_unload = firewall_unload + + @property + def global_state(self): + """Gets the global_state of this SystemInsightsAlf. # noqa: E501 + + + :return: The global_state of this SystemInsightsAlf. # noqa: E501 + :rtype: int + """ + return self._global_state + + @global_state.setter + def global_state(self, global_state): + """Sets the global_state of this SystemInsightsAlf. + + + :param global_state: The global_state of this SystemInsightsAlf. # noqa: E501 + :type: int + """ + + self._global_state = global_state + + @property + def logging_enabled(self): + """Gets the logging_enabled of this SystemInsightsAlf. # noqa: E501 + + + :return: The logging_enabled of this SystemInsightsAlf. # noqa: E501 + :rtype: int + """ + return self._logging_enabled + + @logging_enabled.setter + def logging_enabled(self, logging_enabled): + """Sets the logging_enabled of this SystemInsightsAlf. + + + :param logging_enabled: The logging_enabled of this SystemInsightsAlf. # noqa: E501 + :type: int + """ + + self._logging_enabled = logging_enabled + + @property + def logging_option(self): + """Gets the logging_option of this SystemInsightsAlf. # noqa: E501 + + + :return: The logging_option of this SystemInsightsAlf. # noqa: E501 + :rtype: int + """ + return self._logging_option + + @logging_option.setter + def logging_option(self, logging_option): + """Sets the logging_option of this SystemInsightsAlf. + + + :param logging_option: The logging_option of this SystemInsightsAlf. # noqa: E501 + :type: int + """ + + self._logging_option = logging_option + + @property + def stealth_enabled(self): + """Gets the stealth_enabled of this SystemInsightsAlf. # noqa: E501 + + + :return: The stealth_enabled of this SystemInsightsAlf. # noqa: E501 + :rtype: int + """ + return self._stealth_enabled + + @stealth_enabled.setter + def stealth_enabled(self, stealth_enabled): + """Sets the stealth_enabled of this SystemInsightsAlf. + + + :param stealth_enabled: The stealth_enabled of this SystemInsightsAlf. # noqa: E501 + :type: int + """ + + self._stealth_enabled = stealth_enabled + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsAlf. # noqa: E501 + + + :return: The system_id of this SystemInsightsAlf. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsAlf. + + + :param system_id: The system_id of this SystemInsightsAlf. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def version(self): + """Gets the version of this SystemInsightsAlf. # noqa: E501 + + + :return: The version of this SystemInsightsAlf. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this SystemInsightsAlf. + + + :param version: The version of this SystemInsightsAlf. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsAlf, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsAlf): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_alf_exceptions.py b/jcapiv2/jcapiv2/models/system_insights_alf_exceptions.py new file mode 100644 index 0000000..d4b8ed0 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_alf_exceptions.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsAlfExceptions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'collection_time': 'str', + 'path': 'str', + 'state': 'float', + 'system_id': 'str' + } + + attribute_map = { + 'collection_time': 'collection_time', + 'path': 'path', + 'state': 'state', + 'system_id': 'system_id' + } + + def __init__(self, collection_time=None, path=None, state=None, system_id=None): # noqa: E501 + """SystemInsightsAlfExceptions - a model defined in Swagger""" # noqa: E501 + self._collection_time = None + self._path = None + self._state = None + self._system_id = None + self.discriminator = None + if collection_time is not None: + self.collection_time = collection_time + if path is not None: + self.path = path + if state is not None: + self.state = state + if system_id is not None: + self.system_id = system_id + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsAlfExceptions. # noqa: E501 + + + :return: The collection_time of this SystemInsightsAlfExceptions. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsAlfExceptions. + + + :param collection_time: The collection_time of this SystemInsightsAlfExceptions. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def path(self): + """Gets the path of this SystemInsightsAlfExceptions. # noqa: E501 + + + :return: The path of this SystemInsightsAlfExceptions. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this SystemInsightsAlfExceptions. + + + :param path: The path of this SystemInsightsAlfExceptions. # noqa: E501 + :type: str + """ + + self._path = path + + @property + def state(self): + """Gets the state of this SystemInsightsAlfExceptions. # noqa: E501 + + + :return: The state of this SystemInsightsAlfExceptions. # noqa: E501 + :rtype: float + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this SystemInsightsAlfExceptions. + + + :param state: The state of this SystemInsightsAlfExceptions. # noqa: E501 + :type: float + """ + + self._state = state + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsAlfExceptions. # noqa: E501 + + + :return: The system_id of this SystemInsightsAlfExceptions. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsAlfExceptions. + + + :param system_id: The system_id of this SystemInsightsAlfExceptions. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsAlfExceptions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsAlfExceptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_alf_explicit_auths.py b/jcapiv2/jcapiv2/models/system_insights_alf_explicit_auths.py new file mode 100644 index 0000000..b5cf9bb --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_alf_explicit_auths.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsAlfExplicitAuths(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'collection_time': 'str', + 'process': 'str', + 'system_id': 'str' + } + + attribute_map = { + 'collection_time': 'collection_time', + 'process': 'process', + 'system_id': 'system_id' + } + + def __init__(self, collection_time=None, process=None, system_id=None): # noqa: E501 + """SystemInsightsAlfExplicitAuths - a model defined in Swagger""" # noqa: E501 + self._collection_time = None + self._process = None + self._system_id = None + self.discriminator = None + if collection_time is not None: + self.collection_time = collection_time + if process is not None: + self.process = process + if system_id is not None: + self.system_id = system_id + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsAlfExplicitAuths. # noqa: E501 + + + :return: The collection_time of this SystemInsightsAlfExplicitAuths. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsAlfExplicitAuths. + + + :param collection_time: The collection_time of this SystemInsightsAlfExplicitAuths. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def process(self): + """Gets the process of this SystemInsightsAlfExplicitAuths. # noqa: E501 + + + :return: The process of this SystemInsightsAlfExplicitAuths. # noqa: E501 + :rtype: str + """ + return self._process + + @process.setter + def process(self, process): + """Sets the process of this SystemInsightsAlfExplicitAuths. + + + :param process: The process of this SystemInsightsAlfExplicitAuths. # noqa: E501 + :type: str + """ + + self._process = process + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsAlfExplicitAuths. # noqa: E501 + + + :return: The system_id of this SystemInsightsAlfExplicitAuths. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsAlfExplicitAuths. + + + :param system_id: The system_id of this SystemInsightsAlfExplicitAuths. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsAlfExplicitAuths, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsAlfExplicitAuths): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_appcompat_shims.py b/jcapiv2/jcapiv2/models/system_insights_appcompat_shims.py new file mode 100644 index 0000000..a383d6f --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_appcompat_shims.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsAppcompatShims(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'collection_time': 'str', + 'description': 'str', + 'executable': 'str', + 'install_time': 'float', + 'path': 'str', + 'sdb_id': 'str', + 'system_id': 'str', + 'type': 'str' + } + + attribute_map = { + 'collection_time': 'collection_time', + 'description': 'description', + 'executable': 'executable', + 'install_time': 'install_time', + 'path': 'path', + 'sdb_id': 'sdb_id', + 'system_id': 'system_id', + 'type': 'type' + } + + def __init__(self, collection_time=None, description=None, executable=None, install_time=None, path=None, sdb_id=None, system_id=None, type=None): # noqa: E501 + """SystemInsightsAppcompatShims - a model defined in Swagger""" # noqa: E501 + self._collection_time = None + self._description = None + self._executable = None + self._install_time = None + self._path = None + self._sdb_id = None + self._system_id = None + self._type = None + self.discriminator = None + if collection_time is not None: + self.collection_time = collection_time + if description is not None: + self.description = description + if executable is not None: + self.executable = executable + if install_time is not None: + self.install_time = install_time + if path is not None: + self.path = path + if sdb_id is not None: + self.sdb_id = sdb_id + if system_id is not None: + self.system_id = system_id + if type is not None: + self.type = type + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsAppcompatShims. # noqa: E501 + + + :return: The collection_time of this SystemInsightsAppcompatShims. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsAppcompatShims. + + + :param collection_time: The collection_time of this SystemInsightsAppcompatShims. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def description(self): + """Gets the description of this SystemInsightsAppcompatShims. # noqa: E501 + + + :return: The description of this SystemInsightsAppcompatShims. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this SystemInsightsAppcompatShims. + + + :param description: The description of this SystemInsightsAppcompatShims. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def executable(self): + """Gets the executable of this SystemInsightsAppcompatShims. # noqa: E501 + + + :return: The executable of this SystemInsightsAppcompatShims. # noqa: E501 + :rtype: str + """ + return self._executable + + @executable.setter + def executable(self, executable): + """Sets the executable of this SystemInsightsAppcompatShims. + + + :param executable: The executable of this SystemInsightsAppcompatShims. # noqa: E501 + :type: str + """ + + self._executable = executable + + @property + def install_time(self): + """Gets the install_time of this SystemInsightsAppcompatShims. # noqa: E501 + + + :return: The install_time of this SystemInsightsAppcompatShims. # noqa: E501 + :rtype: float + """ + return self._install_time + + @install_time.setter + def install_time(self, install_time): + """Sets the install_time of this SystemInsightsAppcompatShims. + + + :param install_time: The install_time of this SystemInsightsAppcompatShims. # noqa: E501 + :type: float + """ + + self._install_time = install_time + + @property + def path(self): + """Gets the path of this SystemInsightsAppcompatShims. # noqa: E501 + + + :return: The path of this SystemInsightsAppcompatShims. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this SystemInsightsAppcompatShims. + + + :param path: The path of this SystemInsightsAppcompatShims. # noqa: E501 + :type: str + """ + + self._path = path + + @property + def sdb_id(self): + """Gets the sdb_id of this SystemInsightsAppcompatShims. # noqa: E501 + + + :return: The sdb_id of this SystemInsightsAppcompatShims. # noqa: E501 + :rtype: str + """ + return self._sdb_id + + @sdb_id.setter + def sdb_id(self, sdb_id): + """Sets the sdb_id of this SystemInsightsAppcompatShims. + + + :param sdb_id: The sdb_id of this SystemInsightsAppcompatShims. # noqa: E501 + :type: str + """ + + self._sdb_id = sdb_id + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsAppcompatShims. # noqa: E501 + + + :return: The system_id of this SystemInsightsAppcompatShims. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsAppcompatShims. + + + :param system_id: The system_id of this SystemInsightsAppcompatShims. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def type(self): + """Gets the type of this SystemInsightsAppcompatShims. # noqa: E501 + + + :return: The type of this SystemInsightsAppcompatShims. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SystemInsightsAppcompatShims. + + + :param type: The type of this SystemInsightsAppcompatShims. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsAppcompatShims, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsAppcompatShims): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_apps.py b/jcapiv2/jcapiv2/models/system_insights_apps.py index acc92d7..276804e 100644 --- a/jcapiv2/jcapiv2/models/system_insights_apps.py +++ b/jcapiv2/jcapiv2/models/system_insights_apps.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsApps(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -80,7 +77,6 @@ class SystemInsightsApps(object): def __init__(self, applescript_enabled=None, bundle_executable=None, bundle_identifier=None, bundle_name=None, bundle_package_type=None, bundle_short_version=None, bundle_version=None, category=None, collection_time=None, compiler=None, copyright=None, development_region=None, display_name=None, element=None, environment=None, info_string=None, last_opened_time=None, minimum_system_version=None, name=None, path=None, system_id=None): # noqa: E501 """SystemInsightsApps - a model defined in Swagger""" # noqa: E501 - self._applescript_enabled = None self._bundle_executable = None self._bundle_identifier = None @@ -103,7 +99,6 @@ def __init__(self, applescript_enabled=None, bundle_executable=None, bundle_iden self._path = None self._system_id = None self.discriminator = None - if applescript_enabled is not None: self.applescript_enabled = applescript_enabled if bundle_executable is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_authorized_keys.py b/jcapiv2/jcapiv2/models/system_insights_authorized_keys.py new file mode 100644 index 0000000..ccddf10 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_authorized_keys.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsAuthorizedKeys(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'algorithm': 'str', + 'collection_time': 'str', + 'key': 'str', + 'key_file': 'str', + 'system_id': 'str', + 'uid': 'str' + } + + attribute_map = { + 'algorithm': 'algorithm', + 'collection_time': 'collection_time', + 'key': 'key', + 'key_file': 'key_file', + 'system_id': 'system_id', + 'uid': 'uid' + } + + def __init__(self, algorithm=None, collection_time=None, key=None, key_file=None, system_id=None, uid=None): # noqa: E501 + """SystemInsightsAuthorizedKeys - a model defined in Swagger""" # noqa: E501 + self._algorithm = None + self._collection_time = None + self._key = None + self._key_file = None + self._system_id = None + self._uid = None + self.discriminator = None + if algorithm is not None: + self.algorithm = algorithm + if collection_time is not None: + self.collection_time = collection_time + if key is not None: + self.key = key + if key_file is not None: + self.key_file = key_file + if system_id is not None: + self.system_id = system_id + if uid is not None: + self.uid = uid + + @property + def algorithm(self): + """Gets the algorithm of this SystemInsightsAuthorizedKeys. # noqa: E501 + + + :return: The algorithm of this SystemInsightsAuthorizedKeys. # noqa: E501 + :rtype: str + """ + return self._algorithm + + @algorithm.setter + def algorithm(self, algorithm): + """Sets the algorithm of this SystemInsightsAuthorizedKeys. + + + :param algorithm: The algorithm of this SystemInsightsAuthorizedKeys. # noqa: E501 + :type: str + """ + + self._algorithm = algorithm + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsAuthorizedKeys. # noqa: E501 + + + :return: The collection_time of this SystemInsightsAuthorizedKeys. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsAuthorizedKeys. + + + :param collection_time: The collection_time of this SystemInsightsAuthorizedKeys. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def key(self): + """Gets the key of this SystemInsightsAuthorizedKeys. # noqa: E501 + + + :return: The key of this SystemInsightsAuthorizedKeys. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this SystemInsightsAuthorizedKeys. + + + :param key: The key of this SystemInsightsAuthorizedKeys. # noqa: E501 + :type: str + """ + + self._key = key + + @property + def key_file(self): + """Gets the key_file of this SystemInsightsAuthorizedKeys. # noqa: E501 + + + :return: The key_file of this SystemInsightsAuthorizedKeys. # noqa: E501 + :rtype: str + """ + return self._key_file + + @key_file.setter + def key_file(self, key_file): + """Sets the key_file of this SystemInsightsAuthorizedKeys. + + + :param key_file: The key_file of this SystemInsightsAuthorizedKeys. # noqa: E501 + :type: str + """ + + self._key_file = key_file + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsAuthorizedKeys. # noqa: E501 + + + :return: The system_id of this SystemInsightsAuthorizedKeys. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsAuthorizedKeys. + + + :param system_id: The system_id of this SystemInsightsAuthorizedKeys. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def uid(self): + """Gets the uid of this SystemInsightsAuthorizedKeys. # noqa: E501 + + + :return: The uid of this SystemInsightsAuthorizedKeys. # noqa: E501 + :rtype: str + """ + return self._uid + + @uid.setter + def uid(self, uid): + """Sets the uid of this SystemInsightsAuthorizedKeys. + + + :param uid: The uid of this SystemInsightsAuthorizedKeys. # noqa: E501 + :type: str + """ + + self._uid = uid + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsAuthorizedKeys, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsAuthorizedKeys): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_azure_instance_metadata.py b/jcapiv2/jcapiv2/models/system_insights_azure_instance_metadata.py new file mode 100644 index 0000000..3240104 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_azure_instance_metadata.py @@ -0,0 +1,552 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsAzureInstanceMetadata(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'collection_time': 'str', + 'location': 'str', + 'name': 'str', + 'offer': 'str', + 'os_type': 'str', + 'placement_group_id': 'str', + 'platform_fault_domain': 'str', + 'platform_update_domain': 'str', + 'publisher': 'str', + 'resource_group_name': 'str', + 'sku': 'str', + 'subscription_id': 'str', + 'system_id': 'str', + 'version': 'str', + 'vm_id': 'str', + 'vm_scale_set_name': 'str', + 'vm_size': 'str', + 'zone': 'str' + } + + attribute_map = { + 'collection_time': 'collection_time', + 'location': 'location', + 'name': 'name', + 'offer': 'offer', + 'os_type': 'os_type', + 'placement_group_id': 'placement_group_id', + 'platform_fault_domain': 'platform_fault_domain', + 'platform_update_domain': 'platform_update_domain', + 'publisher': 'publisher', + 'resource_group_name': 'resource_group_name', + 'sku': 'sku', + 'subscription_id': 'subscription_id', + 'system_id': 'system_id', + 'version': 'version', + 'vm_id': 'vm_id', + 'vm_scale_set_name': 'vm_scale_set_name', + 'vm_size': 'vm_size', + 'zone': 'zone' + } + + def __init__(self, collection_time=None, location=None, name=None, offer=None, os_type=None, placement_group_id=None, platform_fault_domain=None, platform_update_domain=None, publisher=None, resource_group_name=None, sku=None, subscription_id=None, system_id=None, version=None, vm_id=None, vm_scale_set_name=None, vm_size=None, zone=None): # noqa: E501 + """SystemInsightsAzureInstanceMetadata - a model defined in Swagger""" # noqa: E501 + self._collection_time = None + self._location = None + self._name = None + self._offer = None + self._os_type = None + self._placement_group_id = None + self._platform_fault_domain = None + self._platform_update_domain = None + self._publisher = None + self._resource_group_name = None + self._sku = None + self._subscription_id = None + self._system_id = None + self._version = None + self._vm_id = None + self._vm_scale_set_name = None + self._vm_size = None + self._zone = None + self.discriminator = None + if collection_time is not None: + self.collection_time = collection_time + if location is not None: + self.location = location + if name is not None: + self.name = name + if offer is not None: + self.offer = offer + if os_type is not None: + self.os_type = os_type + if placement_group_id is not None: + self.placement_group_id = placement_group_id + if platform_fault_domain is not None: + self.platform_fault_domain = platform_fault_domain + if platform_update_domain is not None: + self.platform_update_domain = platform_update_domain + if publisher is not None: + self.publisher = publisher + if resource_group_name is not None: + self.resource_group_name = resource_group_name + if sku is not None: + self.sku = sku + if subscription_id is not None: + self.subscription_id = subscription_id + if system_id is not None: + self.system_id = system_id + if version is not None: + self.version = version + if vm_id is not None: + self.vm_id = vm_id + if vm_scale_set_name is not None: + self.vm_scale_set_name = vm_scale_set_name + if vm_size is not None: + self.vm_size = vm_size + if zone is not None: + self.zone = zone + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The collection_time of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsAzureInstanceMetadata. + + + :param collection_time: The collection_time of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def location(self): + """Gets the location of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The location of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._location + + @location.setter + def location(self, location): + """Sets the location of this SystemInsightsAzureInstanceMetadata. + + + :param location: The location of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._location = location + + @property + def name(self): + """Gets the name of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The name of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SystemInsightsAzureInstanceMetadata. + + + :param name: The name of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def offer(self): + """Gets the offer of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The offer of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._offer + + @offer.setter + def offer(self, offer): + """Sets the offer of this SystemInsightsAzureInstanceMetadata. + + + :param offer: The offer of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._offer = offer + + @property + def os_type(self): + """Gets the os_type of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The os_type of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._os_type + + @os_type.setter + def os_type(self, os_type): + """Sets the os_type of this SystemInsightsAzureInstanceMetadata. + + + :param os_type: The os_type of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._os_type = os_type + + @property + def placement_group_id(self): + """Gets the placement_group_id of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The placement_group_id of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._placement_group_id + + @placement_group_id.setter + def placement_group_id(self, placement_group_id): + """Sets the placement_group_id of this SystemInsightsAzureInstanceMetadata. + + + :param placement_group_id: The placement_group_id of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._placement_group_id = placement_group_id + + @property + def platform_fault_domain(self): + """Gets the platform_fault_domain of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The platform_fault_domain of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._platform_fault_domain + + @platform_fault_domain.setter + def platform_fault_domain(self, platform_fault_domain): + """Sets the platform_fault_domain of this SystemInsightsAzureInstanceMetadata. + + + :param platform_fault_domain: The platform_fault_domain of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._platform_fault_domain = platform_fault_domain + + @property + def platform_update_domain(self): + """Gets the platform_update_domain of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The platform_update_domain of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._platform_update_domain + + @platform_update_domain.setter + def platform_update_domain(self, platform_update_domain): + """Sets the platform_update_domain of this SystemInsightsAzureInstanceMetadata. + + + :param platform_update_domain: The platform_update_domain of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._platform_update_domain = platform_update_domain + + @property + def publisher(self): + """Gets the publisher of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The publisher of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._publisher + + @publisher.setter + def publisher(self, publisher): + """Sets the publisher of this SystemInsightsAzureInstanceMetadata. + + + :param publisher: The publisher of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._publisher = publisher + + @property + def resource_group_name(self): + """Gets the resource_group_name of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The resource_group_name of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._resource_group_name + + @resource_group_name.setter + def resource_group_name(self, resource_group_name): + """Sets the resource_group_name of this SystemInsightsAzureInstanceMetadata. + + + :param resource_group_name: The resource_group_name of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._resource_group_name = resource_group_name + + @property + def sku(self): + """Gets the sku of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The sku of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._sku + + @sku.setter + def sku(self, sku): + """Sets the sku of this SystemInsightsAzureInstanceMetadata. + + + :param sku: The sku of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._sku = sku + + @property + def subscription_id(self): + """Gets the subscription_id of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The subscription_id of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._subscription_id + + @subscription_id.setter + def subscription_id(self, subscription_id): + """Sets the subscription_id of this SystemInsightsAzureInstanceMetadata. + + + :param subscription_id: The subscription_id of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._subscription_id = subscription_id + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The system_id of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsAzureInstanceMetadata. + + + :param system_id: The system_id of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def version(self): + """Gets the version of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The version of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this SystemInsightsAzureInstanceMetadata. + + + :param version: The version of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._version = version + + @property + def vm_id(self): + """Gets the vm_id of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The vm_id of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._vm_id + + @vm_id.setter + def vm_id(self, vm_id): + """Sets the vm_id of this SystemInsightsAzureInstanceMetadata. + + + :param vm_id: The vm_id of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._vm_id = vm_id + + @property + def vm_scale_set_name(self): + """Gets the vm_scale_set_name of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The vm_scale_set_name of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._vm_scale_set_name + + @vm_scale_set_name.setter + def vm_scale_set_name(self, vm_scale_set_name): + """Sets the vm_scale_set_name of this SystemInsightsAzureInstanceMetadata. + + + :param vm_scale_set_name: The vm_scale_set_name of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._vm_scale_set_name = vm_scale_set_name + + @property + def vm_size(self): + """Gets the vm_size of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The vm_size of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._vm_size + + @vm_size.setter + def vm_size(self, vm_size): + """Sets the vm_size of this SystemInsightsAzureInstanceMetadata. + + + :param vm_size: The vm_size of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._vm_size = vm_size + + @property + def zone(self): + """Gets the zone of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + + + :return: The zone of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :rtype: str + """ + return self._zone + + @zone.setter + def zone(self, zone): + """Sets the zone of this SystemInsightsAzureInstanceMetadata. + + + :param zone: The zone of this SystemInsightsAzureInstanceMetadata. # noqa: E501 + :type: str + """ + + self._zone = zone + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsAzureInstanceMetadata, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsAzureInstanceMetadata): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_azure_instance_tags.py b/jcapiv2/jcapiv2/models/system_insights_azure_instance_tags.py new file mode 100644 index 0000000..0e968fc --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_azure_instance_tags.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsAzureInstanceTags(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'collection_time': 'str', + 'key': 'str', + 'system_id': 'str', + 'value': 'str', + 'vm_id': 'str' + } + + attribute_map = { + 'collection_time': 'collection_time', + 'key': 'key', + 'system_id': 'system_id', + 'value': 'value', + 'vm_id': 'vm_id' + } + + def __init__(self, collection_time=None, key=None, system_id=None, value=None, vm_id=None): # noqa: E501 + """SystemInsightsAzureInstanceTags - a model defined in Swagger""" # noqa: E501 + self._collection_time = None + self._key = None + self._system_id = None + self._value = None + self._vm_id = None + self.discriminator = None + if collection_time is not None: + self.collection_time = collection_time + if key is not None: + self.key = key + if system_id is not None: + self.system_id = system_id + if value is not None: + self.value = value + if vm_id is not None: + self.vm_id = vm_id + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsAzureInstanceTags. # noqa: E501 + + + :return: The collection_time of this SystemInsightsAzureInstanceTags. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsAzureInstanceTags. + + + :param collection_time: The collection_time of this SystemInsightsAzureInstanceTags. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def key(self): + """Gets the key of this SystemInsightsAzureInstanceTags. # noqa: E501 + + + :return: The key of this SystemInsightsAzureInstanceTags. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this SystemInsightsAzureInstanceTags. + + + :param key: The key of this SystemInsightsAzureInstanceTags. # noqa: E501 + :type: str + """ + + self._key = key + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsAzureInstanceTags. # noqa: E501 + + + :return: The system_id of this SystemInsightsAzureInstanceTags. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsAzureInstanceTags. + + + :param system_id: The system_id of this SystemInsightsAzureInstanceTags. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def value(self): + """Gets the value of this SystemInsightsAzureInstanceTags. # noqa: E501 + + + :return: The value of this SystemInsightsAzureInstanceTags. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this SystemInsightsAzureInstanceTags. + + + :param value: The value of this SystemInsightsAzureInstanceTags. # noqa: E501 + :type: str + """ + + self._value = value + + @property + def vm_id(self): + """Gets the vm_id of this SystemInsightsAzureInstanceTags. # noqa: E501 + + + :return: The vm_id of this SystemInsightsAzureInstanceTags. # noqa: E501 + :rtype: str + """ + return self._vm_id + + @vm_id.setter + def vm_id(self, vm_id): + """Sets the vm_id of this SystemInsightsAzureInstanceTags. + + + :param vm_id: The vm_id of this SystemInsightsAzureInstanceTags. # noqa: E501 + :type: str + """ + + self._vm_id = vm_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsAzureInstanceTags, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsAzureInstanceTags): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_battery.py b/jcapiv2/jcapiv2/models/system_insights_battery.py index a2ff545..22c8122 100644 --- a/jcapiv2/jcapiv2/models/system_insights_battery.py +++ b/jcapiv2/jcapiv2/models/system_insights_battery.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsBattery(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,7 +28,7 @@ class SystemInsightsBattery(object): and the value is json key in definition. """ swagger_types = { - 'amgerage': 'int', + 'amperage': 'int', 'charged': 'int', 'charging': 'int', 'collection_time': 'str', @@ -54,7 +51,7 @@ class SystemInsightsBattery(object): } attribute_map = { - 'amgerage': 'amgerage', + 'amperage': 'amperage', 'charged': 'charged', 'charging': 'charging', 'collection_time': 'collection_time', @@ -76,10 +73,9 @@ class SystemInsightsBattery(object): 'voltage': 'voltage' } - def __init__(self, amgerage=None, charged=None, charging=None, collection_time=None, condition=None, current_capacity=None, cycle_count=None, designed_capacity=None, health=None, manufacture_date=None, manufacturer=None, max_capacity=None, minutes_to_full_charge=None, minutes_until_empty=None, model=None, percent_remaining=None, serial_number=None, state=None, system_id=None, voltage=None): # noqa: E501 + def __init__(self, amperage=None, charged=None, charging=None, collection_time=None, condition=None, current_capacity=None, cycle_count=None, designed_capacity=None, health=None, manufacture_date=None, manufacturer=None, max_capacity=None, minutes_to_full_charge=None, minutes_until_empty=None, model=None, percent_remaining=None, serial_number=None, state=None, system_id=None, voltage=None): # noqa: E501 """SystemInsightsBattery - a model defined in Swagger""" # noqa: E501 - - self._amgerage = None + self._amperage = None self._charged = None self._charging = None self._collection_time = None @@ -100,9 +96,8 @@ def __init__(self, amgerage=None, charged=None, charging=None, collection_time=N self._system_id = None self._voltage = None self.discriminator = None - - if amgerage is not None: - self.amgerage = amgerage + if amperage is not None: + self.amperage = amperage if charged is not None: self.charged = charged if charging is not None: @@ -143,25 +138,25 @@ def __init__(self, amgerage=None, charged=None, charging=None, collection_time=N self.voltage = voltage @property - def amgerage(self): - """Gets the amgerage of this SystemInsightsBattery. # noqa: E501 + def amperage(self): + """Gets the amperage of this SystemInsightsBattery. # noqa: E501 - :return: The amgerage of this SystemInsightsBattery. # noqa: E501 + :return: The amperage of this SystemInsightsBattery. # noqa: E501 :rtype: int """ - return self._amgerage + return self._amperage - @amgerage.setter - def amgerage(self, amgerage): - """Sets the amgerage of this SystemInsightsBattery. + @amperage.setter + def amperage(self, amperage): + """Sets the amperage of this SystemInsightsBattery. - :param amgerage: The amgerage of this SystemInsightsBattery. # noqa: E501 + :param amperage: The amperage of this SystemInsightsBattery. # noqa: E501 :type: int """ - self._amgerage = amgerage + self._amperage = amperage @property def charged(self): diff --git a/jcapiv2/jcapiv2/models/system_insights_bitlocker_info.py b/jcapiv2/jcapiv2/models/system_insights_bitlocker_info.py index 3bfb2ac..58b7b02 100644 --- a/jcapiv2/jcapiv2/models/system_insights_bitlocker_info.py +++ b/jcapiv2/jcapiv2/models/system_insights_bitlocker_info.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsBitlockerInfo(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -54,7 +51,6 @@ class SystemInsightsBitlockerInfo(object): def __init__(self, collection_time=None, conversion_status=None, device_id=None, drive_letter=None, encryption_method=None, persistent_volume_id=None, protection_status=None, system_id=None): # noqa: E501 """SystemInsightsBitlockerInfo - a model defined in Swagger""" # noqa: E501 - self._collection_time = None self._conversion_status = None self._device_id = None @@ -64,7 +60,6 @@ def __init__(self, collection_time=None, conversion_status=None, device_id=None, self._protection_status = None self._system_id = None self.discriminator = None - if collection_time is not None: self.collection_time = collection_time if conversion_status is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_browser_plugins.py b/jcapiv2/jcapiv2/models/system_insights_browser_plugins.py index ad78478..c2c7b09 100644 --- a/jcapiv2/jcapiv2/models/system_insights_browser_plugins.py +++ b/jcapiv2/jcapiv2/models/system_insights_browser_plugins.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsBrowserPlugins(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -62,7 +59,6 @@ class SystemInsightsBrowserPlugins(object): def __init__(self, collection_time=None, description=None, development_region=None, disabled=None, identifier=None, name=None, native=None, path=None, sdk=None, system_id=None, uid=None, version=None): # noqa: E501 """SystemInsightsBrowserPlugins - a model defined in Swagger""" # noqa: E501 - self._collection_time = None self._description = None self._development_region = None @@ -76,7 +72,6 @@ def __init__(self, collection_time=None, description=None, development_region=No self._uid = None self._version = None self.discriminator = None - if collection_time is not None: self.collection_time = collection_time if description is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_certificates.py b/jcapiv2/jcapiv2/models/system_insights_certificates.py new file mode 100644 index 0000000..bb06d21 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_certificates.py @@ -0,0 +1,656 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsCertificates(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'authority_key_id': 'str', + 'ca': 'int', + 'common_name': 'str', + 'issuer': 'str', + 'key_algorithm': 'str', + 'key_strength': 'str', + 'key_usage': 'str', + 'not_valid_after': 'str', + 'not_valid_before': 'str', + 'path': 'str', + 'self_signed': 'int', + 'serial': 'str', + 'sha1': 'str', + 'sid': 'str', + 'signing_algorithm': 'str', + 'store': 'str', + 'store_id': 'str', + 'store_location': 'str', + 'subject': 'str', + 'subject_key_id': 'str', + 'system_id': 'str', + 'username': 'str' + } + + attribute_map = { + 'authority_key_id': 'authority_key_id', + 'ca': 'ca', + 'common_name': 'common_name', + 'issuer': 'issuer', + 'key_algorithm': 'key_algorithm', + 'key_strength': 'key_strength', + 'key_usage': 'key_usage', + 'not_valid_after': 'not_valid_after', + 'not_valid_before': 'not_valid_before', + 'path': 'path', + 'self_signed': 'self_signed', + 'serial': 'serial', + 'sha1': 'sha1', + 'sid': 'sid', + 'signing_algorithm': 'signing_algorithm', + 'store': 'store', + 'store_id': 'store_id', + 'store_location': 'store_location', + 'subject': 'subject', + 'subject_key_id': 'subject_key_id', + 'system_id': 'system_id', + 'username': 'username' + } + + def __init__(self, authority_key_id=None, ca=None, common_name=None, issuer=None, key_algorithm=None, key_strength=None, key_usage=None, not_valid_after=None, not_valid_before=None, path=None, self_signed=None, serial=None, sha1=None, sid=None, signing_algorithm=None, store=None, store_id=None, store_location=None, subject=None, subject_key_id=None, system_id=None, username=None): # noqa: E501 + """SystemInsightsCertificates - a model defined in Swagger""" # noqa: E501 + self._authority_key_id = None + self._ca = None + self._common_name = None + self._issuer = None + self._key_algorithm = None + self._key_strength = None + self._key_usage = None + self._not_valid_after = None + self._not_valid_before = None + self._path = None + self._self_signed = None + self._serial = None + self._sha1 = None + self._sid = None + self._signing_algorithm = None + self._store = None + self._store_id = None + self._store_location = None + self._subject = None + self._subject_key_id = None + self._system_id = None + self._username = None + self.discriminator = None + if authority_key_id is not None: + self.authority_key_id = authority_key_id + if ca is not None: + self.ca = ca + if common_name is not None: + self.common_name = common_name + if issuer is not None: + self.issuer = issuer + if key_algorithm is not None: + self.key_algorithm = key_algorithm + if key_strength is not None: + self.key_strength = key_strength + if key_usage is not None: + self.key_usage = key_usage + if not_valid_after is not None: + self.not_valid_after = not_valid_after + if not_valid_before is not None: + self.not_valid_before = not_valid_before + if path is not None: + self.path = path + if self_signed is not None: + self.self_signed = self_signed + if serial is not None: + self.serial = serial + if sha1 is not None: + self.sha1 = sha1 + if sid is not None: + self.sid = sid + if signing_algorithm is not None: + self.signing_algorithm = signing_algorithm + if store is not None: + self.store = store + if store_id is not None: + self.store_id = store_id + if store_location is not None: + self.store_location = store_location + if subject is not None: + self.subject = subject + if subject_key_id is not None: + self.subject_key_id = subject_key_id + if system_id is not None: + self.system_id = system_id + if username is not None: + self.username = username + + @property + def authority_key_id(self): + """Gets the authority_key_id of this SystemInsightsCertificates. # noqa: E501 + + + :return: The authority_key_id of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._authority_key_id + + @authority_key_id.setter + def authority_key_id(self, authority_key_id): + """Sets the authority_key_id of this SystemInsightsCertificates. + + + :param authority_key_id: The authority_key_id of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._authority_key_id = authority_key_id + + @property + def ca(self): + """Gets the ca of this SystemInsightsCertificates. # noqa: E501 + + + :return: The ca of this SystemInsightsCertificates. # noqa: E501 + :rtype: int + """ + return self._ca + + @ca.setter + def ca(self, ca): + """Sets the ca of this SystemInsightsCertificates. + + + :param ca: The ca of this SystemInsightsCertificates. # noqa: E501 + :type: int + """ + + self._ca = ca + + @property + def common_name(self): + """Gets the common_name of this SystemInsightsCertificates. # noqa: E501 + + + :return: The common_name of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._common_name + + @common_name.setter + def common_name(self, common_name): + """Sets the common_name of this SystemInsightsCertificates. + + + :param common_name: The common_name of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._common_name = common_name + + @property + def issuer(self): + """Gets the issuer of this SystemInsightsCertificates. # noqa: E501 + + + :return: The issuer of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._issuer + + @issuer.setter + def issuer(self, issuer): + """Sets the issuer of this SystemInsightsCertificates. + + + :param issuer: The issuer of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._issuer = issuer + + @property + def key_algorithm(self): + """Gets the key_algorithm of this SystemInsightsCertificates. # noqa: E501 + + + :return: The key_algorithm of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._key_algorithm + + @key_algorithm.setter + def key_algorithm(self, key_algorithm): + """Sets the key_algorithm of this SystemInsightsCertificates. + + + :param key_algorithm: The key_algorithm of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._key_algorithm = key_algorithm + + @property + def key_strength(self): + """Gets the key_strength of this SystemInsightsCertificates. # noqa: E501 + + + :return: The key_strength of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._key_strength + + @key_strength.setter + def key_strength(self, key_strength): + """Sets the key_strength of this SystemInsightsCertificates. + + + :param key_strength: The key_strength of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._key_strength = key_strength + + @property + def key_usage(self): + """Gets the key_usage of this SystemInsightsCertificates. # noqa: E501 + + + :return: The key_usage of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._key_usage + + @key_usage.setter + def key_usage(self, key_usage): + """Sets the key_usage of this SystemInsightsCertificates. + + + :param key_usage: The key_usage of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._key_usage = key_usage + + @property + def not_valid_after(self): + """Gets the not_valid_after of this SystemInsightsCertificates. # noqa: E501 + + + :return: The not_valid_after of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._not_valid_after + + @not_valid_after.setter + def not_valid_after(self, not_valid_after): + """Sets the not_valid_after of this SystemInsightsCertificates. + + + :param not_valid_after: The not_valid_after of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._not_valid_after = not_valid_after + + @property + def not_valid_before(self): + """Gets the not_valid_before of this SystemInsightsCertificates. # noqa: E501 + + + :return: The not_valid_before of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._not_valid_before + + @not_valid_before.setter + def not_valid_before(self, not_valid_before): + """Sets the not_valid_before of this SystemInsightsCertificates. + + + :param not_valid_before: The not_valid_before of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._not_valid_before = not_valid_before + + @property + def path(self): + """Gets the path of this SystemInsightsCertificates. # noqa: E501 + + + :return: The path of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this SystemInsightsCertificates. + + + :param path: The path of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._path = path + + @property + def self_signed(self): + """Gets the self_signed of this SystemInsightsCertificates. # noqa: E501 + + + :return: The self_signed of this SystemInsightsCertificates. # noqa: E501 + :rtype: int + """ + return self._self_signed + + @self_signed.setter + def self_signed(self, self_signed): + """Sets the self_signed of this SystemInsightsCertificates. + + + :param self_signed: The self_signed of this SystemInsightsCertificates. # noqa: E501 + :type: int + """ + + self._self_signed = self_signed + + @property + def serial(self): + """Gets the serial of this SystemInsightsCertificates. # noqa: E501 + + + :return: The serial of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._serial + + @serial.setter + def serial(self, serial): + """Sets the serial of this SystemInsightsCertificates. + + + :param serial: The serial of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._serial = serial + + @property + def sha1(self): + """Gets the sha1 of this SystemInsightsCertificates. # noqa: E501 + + + :return: The sha1 of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._sha1 + + @sha1.setter + def sha1(self, sha1): + """Sets the sha1 of this SystemInsightsCertificates. + + + :param sha1: The sha1 of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._sha1 = sha1 + + @property + def sid(self): + """Gets the sid of this SystemInsightsCertificates. # noqa: E501 + + + :return: The sid of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._sid + + @sid.setter + def sid(self, sid): + """Sets the sid of this SystemInsightsCertificates. + + + :param sid: The sid of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._sid = sid + + @property + def signing_algorithm(self): + """Gets the signing_algorithm of this SystemInsightsCertificates. # noqa: E501 + + + :return: The signing_algorithm of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._signing_algorithm + + @signing_algorithm.setter + def signing_algorithm(self, signing_algorithm): + """Sets the signing_algorithm of this SystemInsightsCertificates. + + + :param signing_algorithm: The signing_algorithm of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._signing_algorithm = signing_algorithm + + @property + def store(self): + """Gets the store of this SystemInsightsCertificates. # noqa: E501 + + + :return: The store of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._store + + @store.setter + def store(self, store): + """Sets the store of this SystemInsightsCertificates. + + + :param store: The store of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._store = store + + @property + def store_id(self): + """Gets the store_id of this SystemInsightsCertificates. # noqa: E501 + + + :return: The store_id of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._store_id + + @store_id.setter + def store_id(self, store_id): + """Sets the store_id of this SystemInsightsCertificates. + + + :param store_id: The store_id of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._store_id = store_id + + @property + def store_location(self): + """Gets the store_location of this SystemInsightsCertificates. # noqa: E501 + + + :return: The store_location of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._store_location + + @store_location.setter + def store_location(self, store_location): + """Sets the store_location of this SystemInsightsCertificates. + + + :param store_location: The store_location of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._store_location = store_location + + @property + def subject(self): + """Gets the subject of this SystemInsightsCertificates. # noqa: E501 + + + :return: The subject of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._subject + + @subject.setter + def subject(self, subject): + """Sets the subject of this SystemInsightsCertificates. + + + :param subject: The subject of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._subject = subject + + @property + def subject_key_id(self): + """Gets the subject_key_id of this SystemInsightsCertificates. # noqa: E501 + + + :return: The subject_key_id of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._subject_key_id + + @subject_key_id.setter + def subject_key_id(self, subject_key_id): + """Sets the subject_key_id of this SystemInsightsCertificates. + + + :param subject_key_id: The subject_key_id of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._subject_key_id = subject_key_id + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsCertificates. # noqa: E501 + + + :return: The system_id of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsCertificates. + + + :param system_id: The system_id of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def username(self): + """Gets the username of this SystemInsightsCertificates. # noqa: E501 + + + :return: The username of this SystemInsightsCertificates. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this SystemInsightsCertificates. + + + :param username: The username of this SystemInsightsCertificates. # noqa: E501 + :type: str + """ + + self._username = username + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsCertificates, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsCertificates): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_chassis_info.py b/jcapiv2/jcapiv2/models/system_insights_chassis_info.py new file mode 100644 index 0000000..0bc62d3 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_chassis_info.py @@ -0,0 +1,474 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsChassisInfo(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'audible_alarm': 'str', + 'breach_description': 'str', + 'chassis_types': 'str', + 'collection_time': 'str', + 'description': 'str', + 'lock': 'str', + 'manufacturer': 'str', + 'model': 'str', + 'security_breach': 'str', + 'serial': 'str', + 'sku': 'str', + 'smbios_tag': 'str', + 'status': 'str', + 'system_id': 'str', + 'visible_alarm': 'str' + } + + attribute_map = { + 'audible_alarm': 'audible_alarm', + 'breach_description': 'breach_description', + 'chassis_types': 'chassis_types', + 'collection_time': 'collection_time', + 'description': 'description', + 'lock': 'lock', + 'manufacturer': 'manufacturer', + 'model': 'model', + 'security_breach': 'security_breach', + 'serial': 'serial', + 'sku': 'sku', + 'smbios_tag': 'smbios_tag', + 'status': 'status', + 'system_id': 'system_id', + 'visible_alarm': 'visible_alarm' + } + + def __init__(self, audible_alarm=None, breach_description=None, chassis_types=None, collection_time=None, description=None, lock=None, manufacturer=None, model=None, security_breach=None, serial=None, sku=None, smbios_tag=None, status=None, system_id=None, visible_alarm=None): # noqa: E501 + """SystemInsightsChassisInfo - a model defined in Swagger""" # noqa: E501 + self._audible_alarm = None + self._breach_description = None + self._chassis_types = None + self._collection_time = None + self._description = None + self._lock = None + self._manufacturer = None + self._model = None + self._security_breach = None + self._serial = None + self._sku = None + self._smbios_tag = None + self._status = None + self._system_id = None + self._visible_alarm = None + self.discriminator = None + if audible_alarm is not None: + self.audible_alarm = audible_alarm + if breach_description is not None: + self.breach_description = breach_description + if chassis_types is not None: + self.chassis_types = chassis_types + if collection_time is not None: + self.collection_time = collection_time + if description is not None: + self.description = description + if lock is not None: + self.lock = lock + if manufacturer is not None: + self.manufacturer = manufacturer + if model is not None: + self.model = model + if security_breach is not None: + self.security_breach = security_breach + if serial is not None: + self.serial = serial + if sku is not None: + self.sku = sku + if smbios_tag is not None: + self.smbios_tag = smbios_tag + if status is not None: + self.status = status + if system_id is not None: + self.system_id = system_id + if visible_alarm is not None: + self.visible_alarm = visible_alarm + + @property + def audible_alarm(self): + """Gets the audible_alarm of this SystemInsightsChassisInfo. # noqa: E501 + + + :return: The audible_alarm of this SystemInsightsChassisInfo. # noqa: E501 + :rtype: str + """ + return self._audible_alarm + + @audible_alarm.setter + def audible_alarm(self, audible_alarm): + """Sets the audible_alarm of this SystemInsightsChassisInfo. + + + :param audible_alarm: The audible_alarm of this SystemInsightsChassisInfo. # noqa: E501 + :type: str + """ + + self._audible_alarm = audible_alarm + + @property + def breach_description(self): + """Gets the breach_description of this SystemInsightsChassisInfo. # noqa: E501 + + + :return: The breach_description of this SystemInsightsChassisInfo. # noqa: E501 + :rtype: str + """ + return self._breach_description + + @breach_description.setter + def breach_description(self, breach_description): + """Sets the breach_description of this SystemInsightsChassisInfo. + + + :param breach_description: The breach_description of this SystemInsightsChassisInfo. # noqa: E501 + :type: str + """ + + self._breach_description = breach_description + + @property + def chassis_types(self): + """Gets the chassis_types of this SystemInsightsChassisInfo. # noqa: E501 + + + :return: The chassis_types of this SystemInsightsChassisInfo. # noqa: E501 + :rtype: str + """ + return self._chassis_types + + @chassis_types.setter + def chassis_types(self, chassis_types): + """Sets the chassis_types of this SystemInsightsChassisInfo. + + + :param chassis_types: The chassis_types of this SystemInsightsChassisInfo. # noqa: E501 + :type: str + """ + + self._chassis_types = chassis_types + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsChassisInfo. # noqa: E501 + + + :return: The collection_time of this SystemInsightsChassisInfo. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsChassisInfo. + + + :param collection_time: The collection_time of this SystemInsightsChassisInfo. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def description(self): + """Gets the description of this SystemInsightsChassisInfo. # noqa: E501 + + + :return: The description of this SystemInsightsChassisInfo. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this SystemInsightsChassisInfo. + + + :param description: The description of this SystemInsightsChassisInfo. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def lock(self): + """Gets the lock of this SystemInsightsChassisInfo. # noqa: E501 + + + :return: The lock of this SystemInsightsChassisInfo. # noqa: E501 + :rtype: str + """ + return self._lock + + @lock.setter + def lock(self, lock): + """Sets the lock of this SystemInsightsChassisInfo. + + + :param lock: The lock of this SystemInsightsChassisInfo. # noqa: E501 + :type: str + """ + + self._lock = lock + + @property + def manufacturer(self): + """Gets the manufacturer of this SystemInsightsChassisInfo. # noqa: E501 + + + :return: The manufacturer of this SystemInsightsChassisInfo. # noqa: E501 + :rtype: str + """ + return self._manufacturer + + @manufacturer.setter + def manufacturer(self, manufacturer): + """Sets the manufacturer of this SystemInsightsChassisInfo. + + + :param manufacturer: The manufacturer of this SystemInsightsChassisInfo. # noqa: E501 + :type: str + """ + + self._manufacturer = manufacturer + + @property + def model(self): + """Gets the model of this SystemInsightsChassisInfo. # noqa: E501 + + + :return: The model of this SystemInsightsChassisInfo. # noqa: E501 + :rtype: str + """ + return self._model + + @model.setter + def model(self, model): + """Sets the model of this SystemInsightsChassisInfo. + + + :param model: The model of this SystemInsightsChassisInfo. # noqa: E501 + :type: str + """ + + self._model = model + + @property + def security_breach(self): + """Gets the security_breach of this SystemInsightsChassisInfo. # noqa: E501 + + + :return: The security_breach of this SystemInsightsChassisInfo. # noqa: E501 + :rtype: str + """ + return self._security_breach + + @security_breach.setter + def security_breach(self, security_breach): + """Sets the security_breach of this SystemInsightsChassisInfo. + + + :param security_breach: The security_breach of this SystemInsightsChassisInfo. # noqa: E501 + :type: str + """ + + self._security_breach = security_breach + + @property + def serial(self): + """Gets the serial of this SystemInsightsChassisInfo. # noqa: E501 + + + :return: The serial of this SystemInsightsChassisInfo. # noqa: E501 + :rtype: str + """ + return self._serial + + @serial.setter + def serial(self, serial): + """Sets the serial of this SystemInsightsChassisInfo. + + + :param serial: The serial of this SystemInsightsChassisInfo. # noqa: E501 + :type: str + """ + + self._serial = serial + + @property + def sku(self): + """Gets the sku of this SystemInsightsChassisInfo. # noqa: E501 + + + :return: The sku of this SystemInsightsChassisInfo. # noqa: E501 + :rtype: str + """ + return self._sku + + @sku.setter + def sku(self, sku): + """Sets the sku of this SystemInsightsChassisInfo. + + + :param sku: The sku of this SystemInsightsChassisInfo. # noqa: E501 + :type: str + """ + + self._sku = sku + + @property + def smbios_tag(self): + """Gets the smbios_tag of this SystemInsightsChassisInfo. # noqa: E501 + + + :return: The smbios_tag of this SystemInsightsChassisInfo. # noqa: E501 + :rtype: str + """ + return self._smbios_tag + + @smbios_tag.setter + def smbios_tag(self, smbios_tag): + """Sets the smbios_tag of this SystemInsightsChassisInfo. + + + :param smbios_tag: The smbios_tag of this SystemInsightsChassisInfo. # noqa: E501 + :type: str + """ + + self._smbios_tag = smbios_tag + + @property + def status(self): + """Gets the status of this SystemInsightsChassisInfo. # noqa: E501 + + + :return: The status of this SystemInsightsChassisInfo. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this SystemInsightsChassisInfo. + + + :param status: The status of this SystemInsightsChassisInfo. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsChassisInfo. # noqa: E501 + + + :return: The system_id of this SystemInsightsChassisInfo. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsChassisInfo. + + + :param system_id: The system_id of this SystemInsightsChassisInfo. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def visible_alarm(self): + """Gets the visible_alarm of this SystemInsightsChassisInfo. # noqa: E501 + + + :return: The visible_alarm of this SystemInsightsChassisInfo. # noqa: E501 + :rtype: str + """ + return self._visible_alarm + + @visible_alarm.setter + def visible_alarm(self, visible_alarm): + """Sets the visible_alarm of this SystemInsightsChassisInfo. + + + :param visible_alarm: The visible_alarm of this SystemInsightsChassisInfo. # noqa: E501 + :type: str + """ + + self._visible_alarm = visible_alarm + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsChassisInfo, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsChassisInfo): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_chrome_extensions.py b/jcapiv2/jcapiv2/models/system_insights_chrome_extensions.py index 6f959bf..f982f31 100644 --- a/jcapiv2/jcapiv2/models/system_insights_chrome_extensions.py +++ b/jcapiv2/jcapiv2/models/system_insights_chrome_extensions.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsChromeExtensions(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -64,7 +61,6 @@ class SystemInsightsChromeExtensions(object): def __init__(self, author=None, collection_time=None, description=None, identifier=None, locale=None, name=None, path=None, permissions=None, persistent=None, system_id=None, uid=None, update_url=None, version=None): # noqa: E501 """SystemInsightsChromeExtensions - a model defined in Swagger""" # noqa: E501 - self._author = None self._collection_time = None self._description = None @@ -79,7 +75,6 @@ def __init__(self, author=None, collection_time=None, description=None, identifi self._update_url = None self._version = None self.discriminator = None - if author is not None: self.author = author if collection_time is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_connectivity.py b/jcapiv2/jcapiv2/models/system_insights_connectivity.py new file mode 100644 index 0000000..6e73246 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_connectivity.py @@ -0,0 +1,370 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsConnectivity(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'collection_time': 'str', + 'disconnected': 'int', + 'ipv4_internet': 'int', + 'ipv4_local_network': 'int', + 'ipv4_no_traffic': 'int', + 'ipv4_subnet': 'int', + 'ipv6_internet': 'int', + 'ipv6_local_network': 'int', + 'ipv6_no_traffic': 'int', + 'ipv6_subnet': 'int', + 'system_id': 'str' + } + + attribute_map = { + 'collection_time': 'collection_time', + 'disconnected': 'disconnected', + 'ipv4_internet': 'ipv4_internet', + 'ipv4_local_network': 'ipv4_local_network', + 'ipv4_no_traffic': 'ipv4_no_traffic', + 'ipv4_subnet': 'ipv4_subnet', + 'ipv6_internet': 'ipv6_internet', + 'ipv6_local_network': 'ipv6_local_network', + 'ipv6_no_traffic': 'ipv6_no_traffic', + 'ipv6_subnet': 'ipv6_subnet', + 'system_id': 'system_id' + } + + def __init__(self, collection_time=None, disconnected=None, ipv4_internet=None, ipv4_local_network=None, ipv4_no_traffic=None, ipv4_subnet=None, ipv6_internet=None, ipv6_local_network=None, ipv6_no_traffic=None, ipv6_subnet=None, system_id=None): # noqa: E501 + """SystemInsightsConnectivity - a model defined in Swagger""" # noqa: E501 + self._collection_time = None + self._disconnected = None + self._ipv4_internet = None + self._ipv4_local_network = None + self._ipv4_no_traffic = None + self._ipv4_subnet = None + self._ipv6_internet = None + self._ipv6_local_network = None + self._ipv6_no_traffic = None + self._ipv6_subnet = None + self._system_id = None + self.discriminator = None + if collection_time is not None: + self.collection_time = collection_time + if disconnected is not None: + self.disconnected = disconnected + if ipv4_internet is not None: + self.ipv4_internet = ipv4_internet + if ipv4_local_network is not None: + self.ipv4_local_network = ipv4_local_network + if ipv4_no_traffic is not None: + self.ipv4_no_traffic = ipv4_no_traffic + if ipv4_subnet is not None: + self.ipv4_subnet = ipv4_subnet + if ipv6_internet is not None: + self.ipv6_internet = ipv6_internet + if ipv6_local_network is not None: + self.ipv6_local_network = ipv6_local_network + if ipv6_no_traffic is not None: + self.ipv6_no_traffic = ipv6_no_traffic + if ipv6_subnet is not None: + self.ipv6_subnet = ipv6_subnet + if system_id is not None: + self.system_id = system_id + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsConnectivity. # noqa: E501 + + + :return: The collection_time of this SystemInsightsConnectivity. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsConnectivity. + + + :param collection_time: The collection_time of this SystemInsightsConnectivity. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def disconnected(self): + """Gets the disconnected of this SystemInsightsConnectivity. # noqa: E501 + + + :return: The disconnected of this SystemInsightsConnectivity. # noqa: E501 + :rtype: int + """ + return self._disconnected + + @disconnected.setter + def disconnected(self, disconnected): + """Sets the disconnected of this SystemInsightsConnectivity. + + + :param disconnected: The disconnected of this SystemInsightsConnectivity. # noqa: E501 + :type: int + """ + + self._disconnected = disconnected + + @property + def ipv4_internet(self): + """Gets the ipv4_internet of this SystemInsightsConnectivity. # noqa: E501 + + + :return: The ipv4_internet of this SystemInsightsConnectivity. # noqa: E501 + :rtype: int + """ + return self._ipv4_internet + + @ipv4_internet.setter + def ipv4_internet(self, ipv4_internet): + """Sets the ipv4_internet of this SystemInsightsConnectivity. + + + :param ipv4_internet: The ipv4_internet of this SystemInsightsConnectivity. # noqa: E501 + :type: int + """ + + self._ipv4_internet = ipv4_internet + + @property + def ipv4_local_network(self): + """Gets the ipv4_local_network of this SystemInsightsConnectivity. # noqa: E501 + + + :return: The ipv4_local_network of this SystemInsightsConnectivity. # noqa: E501 + :rtype: int + """ + return self._ipv4_local_network + + @ipv4_local_network.setter + def ipv4_local_network(self, ipv4_local_network): + """Sets the ipv4_local_network of this SystemInsightsConnectivity. + + + :param ipv4_local_network: The ipv4_local_network of this SystemInsightsConnectivity. # noqa: E501 + :type: int + """ + + self._ipv4_local_network = ipv4_local_network + + @property + def ipv4_no_traffic(self): + """Gets the ipv4_no_traffic of this SystemInsightsConnectivity. # noqa: E501 + + + :return: The ipv4_no_traffic of this SystemInsightsConnectivity. # noqa: E501 + :rtype: int + """ + return self._ipv4_no_traffic + + @ipv4_no_traffic.setter + def ipv4_no_traffic(self, ipv4_no_traffic): + """Sets the ipv4_no_traffic of this SystemInsightsConnectivity. + + + :param ipv4_no_traffic: The ipv4_no_traffic of this SystemInsightsConnectivity. # noqa: E501 + :type: int + """ + + self._ipv4_no_traffic = ipv4_no_traffic + + @property + def ipv4_subnet(self): + """Gets the ipv4_subnet of this SystemInsightsConnectivity. # noqa: E501 + + + :return: The ipv4_subnet of this SystemInsightsConnectivity. # noqa: E501 + :rtype: int + """ + return self._ipv4_subnet + + @ipv4_subnet.setter + def ipv4_subnet(self, ipv4_subnet): + """Sets the ipv4_subnet of this SystemInsightsConnectivity. + + + :param ipv4_subnet: The ipv4_subnet of this SystemInsightsConnectivity. # noqa: E501 + :type: int + """ + + self._ipv4_subnet = ipv4_subnet + + @property + def ipv6_internet(self): + """Gets the ipv6_internet of this SystemInsightsConnectivity. # noqa: E501 + + + :return: The ipv6_internet of this SystemInsightsConnectivity. # noqa: E501 + :rtype: int + """ + return self._ipv6_internet + + @ipv6_internet.setter + def ipv6_internet(self, ipv6_internet): + """Sets the ipv6_internet of this SystemInsightsConnectivity. + + + :param ipv6_internet: The ipv6_internet of this SystemInsightsConnectivity. # noqa: E501 + :type: int + """ + + self._ipv6_internet = ipv6_internet + + @property + def ipv6_local_network(self): + """Gets the ipv6_local_network of this SystemInsightsConnectivity. # noqa: E501 + + + :return: The ipv6_local_network of this SystemInsightsConnectivity. # noqa: E501 + :rtype: int + """ + return self._ipv6_local_network + + @ipv6_local_network.setter + def ipv6_local_network(self, ipv6_local_network): + """Sets the ipv6_local_network of this SystemInsightsConnectivity. + + + :param ipv6_local_network: The ipv6_local_network of this SystemInsightsConnectivity. # noqa: E501 + :type: int + """ + + self._ipv6_local_network = ipv6_local_network + + @property + def ipv6_no_traffic(self): + """Gets the ipv6_no_traffic of this SystemInsightsConnectivity. # noqa: E501 + + + :return: The ipv6_no_traffic of this SystemInsightsConnectivity. # noqa: E501 + :rtype: int + """ + return self._ipv6_no_traffic + + @ipv6_no_traffic.setter + def ipv6_no_traffic(self, ipv6_no_traffic): + """Sets the ipv6_no_traffic of this SystemInsightsConnectivity. + + + :param ipv6_no_traffic: The ipv6_no_traffic of this SystemInsightsConnectivity. # noqa: E501 + :type: int + """ + + self._ipv6_no_traffic = ipv6_no_traffic + + @property + def ipv6_subnet(self): + """Gets the ipv6_subnet of this SystemInsightsConnectivity. # noqa: E501 + + + :return: The ipv6_subnet of this SystemInsightsConnectivity. # noqa: E501 + :rtype: int + """ + return self._ipv6_subnet + + @ipv6_subnet.setter + def ipv6_subnet(self, ipv6_subnet): + """Sets the ipv6_subnet of this SystemInsightsConnectivity. + + + :param ipv6_subnet: The ipv6_subnet of this SystemInsightsConnectivity. # noqa: E501 + :type: int + """ + + self._ipv6_subnet = ipv6_subnet + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsConnectivity. # noqa: E501 + + + :return: The system_id of this SystemInsightsConnectivity. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsConnectivity. + + + :param system_id: The system_id of this SystemInsightsConnectivity. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsConnectivity, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsConnectivity): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_crashes.py b/jcapiv2/jcapiv2/models/system_insights_crashes.py index 5eb65cc..c2df80b 100644 --- a/jcapiv2/jcapiv2/models/system_insights_crashes.py +++ b/jcapiv2/jcapiv2/models/system_insights_crashes.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsCrashes(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,6 +28,7 @@ class SystemInsightsCrashes(object): and the value is json key in definition. """ swagger_types = { + 'collection_time': 'str', 'crash_path': 'str', 'crashed_thread': 'str', '_datetime': 'str', @@ -44,12 +42,14 @@ class SystemInsightsCrashes(object): 'registers': 'str', 'responsible': 'str', 'stack_trace': 'str', + 'system_id': 'str', 'type': 'str', 'uid': 'int', 'version': 'str' } attribute_map = { + 'collection_time': 'collection_time', 'crash_path': 'crash_path', 'crashed_thread': 'crashed_thread', '_datetime': 'datetime', @@ -63,14 +63,15 @@ class SystemInsightsCrashes(object): 'registers': 'registers', 'responsible': 'responsible', 'stack_trace': 'stack_trace', + 'system_id': 'system_id', 'type': 'type', 'uid': 'uid', 'version': 'version' } - def __init__(self, crash_path=None, crashed_thread=None, _datetime=None, exception_codes=None, exception_notes=None, exception_type=None, identifier=None, parent=None, path=None, pid=None, registers=None, responsible=None, stack_trace=None, type=None, uid=None, version=None): # noqa: E501 + def __init__(self, collection_time=None, crash_path=None, crashed_thread=None, _datetime=None, exception_codes=None, exception_notes=None, exception_type=None, identifier=None, parent=None, path=None, pid=None, registers=None, responsible=None, stack_trace=None, system_id=None, type=None, uid=None, version=None): # noqa: E501 """SystemInsightsCrashes - a model defined in Swagger""" # noqa: E501 - + self._collection_time = None self._crash_path = None self._crashed_thread = None self.__datetime = None @@ -84,11 +85,13 @@ def __init__(self, crash_path=None, crashed_thread=None, _datetime=None, excepti self._registers = None self._responsible = None self._stack_trace = None + self._system_id = None self._type = None self._uid = None self._version = None self.discriminator = None - + if collection_time is not None: + self.collection_time = collection_time if crash_path is not None: self.crash_path = crash_path if crashed_thread is not None: @@ -115,6 +118,8 @@ def __init__(self, crash_path=None, crashed_thread=None, _datetime=None, excepti self.responsible = responsible if stack_trace is not None: self.stack_trace = stack_trace + if system_id is not None: + self.system_id = system_id if type is not None: self.type = type if uid is not None: @@ -122,6 +127,27 @@ def __init__(self, crash_path=None, crashed_thread=None, _datetime=None, excepti if version is not None: self.version = version + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsCrashes. # noqa: E501 + + + :return: The collection_time of this SystemInsightsCrashes. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsCrashes. + + + :param collection_time: The collection_time of this SystemInsightsCrashes. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + @property def crash_path(self): """Gets the crash_path of this SystemInsightsCrashes. # noqa: E501 @@ -395,6 +421,27 @@ def stack_trace(self, stack_trace): self._stack_trace = stack_trace + @property + def system_id(self): + """Gets the system_id of this SystemInsightsCrashes. # noqa: E501 + + + :return: The system_id of this SystemInsightsCrashes. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsCrashes. + + + :param system_id: The system_id of this SystemInsightsCrashes. # noqa: E501 + :type: str + """ + + self._system_id = system_id + @property def type(self): """Gets the type of this SystemInsightsCrashes. # noqa: E501 diff --git a/jcapiv2/jcapiv2/models/system_insights_cups_destinations.py b/jcapiv2/jcapiv2/models/system_insights_cups_destinations.py new file mode 100644 index 0000000..118d077 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_cups_destinations.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsCupsDestinations(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'option_name': 'str', + 'option_value': 'str', + 'system_id': 'str' + } + + attribute_map = { + 'name': 'name', + 'option_name': 'option_name', + 'option_value': 'option_value', + 'system_id': 'system_id' + } + + def __init__(self, name=None, option_name=None, option_value=None, system_id=None): # noqa: E501 + """SystemInsightsCupsDestinations - a model defined in Swagger""" # noqa: E501 + self._name = None + self._option_name = None + self._option_value = None + self._system_id = None + self.discriminator = None + if name is not None: + self.name = name + if option_name is not None: + self.option_name = option_name + if option_value is not None: + self.option_value = option_value + if system_id is not None: + self.system_id = system_id + + @property + def name(self): + """Gets the name of this SystemInsightsCupsDestinations. # noqa: E501 + + + :return: The name of this SystemInsightsCupsDestinations. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SystemInsightsCupsDestinations. + + + :param name: The name of this SystemInsightsCupsDestinations. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def option_name(self): + """Gets the option_name of this SystemInsightsCupsDestinations. # noqa: E501 + + + :return: The option_name of this SystemInsightsCupsDestinations. # noqa: E501 + :rtype: str + """ + return self._option_name + + @option_name.setter + def option_name(self, option_name): + """Sets the option_name of this SystemInsightsCupsDestinations. + + + :param option_name: The option_name of this SystemInsightsCupsDestinations. # noqa: E501 + :type: str + """ + + self._option_name = option_name + + @property + def option_value(self): + """Gets the option_value of this SystemInsightsCupsDestinations. # noqa: E501 + + + :return: The option_value of this SystemInsightsCupsDestinations. # noqa: E501 + :rtype: str + """ + return self._option_value + + @option_value.setter + def option_value(self, option_value): + """Sets the option_value of this SystemInsightsCupsDestinations. + + + :param option_value: The option_value of this SystemInsightsCupsDestinations. # noqa: E501 + :type: str + """ + + self._option_value = option_value + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsCupsDestinations. # noqa: E501 + + + :return: The system_id of this SystemInsightsCupsDestinations. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsCupsDestinations. + + + :param system_id: The system_id of this SystemInsightsCupsDestinations. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsCupsDestinations, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsCupsDestinations): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_disk_encryption.py b/jcapiv2/jcapiv2/models/system_insights_disk_encryption.py index c0c0709..b833d86 100644 --- a/jcapiv2/jcapiv2/models/system_insights_disk_encryption.py +++ b/jcapiv2/jcapiv2/models/system_insights_disk_encryption.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsDiskEncryption(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -56,7 +53,6 @@ class SystemInsightsDiskEncryption(object): def __init__(self, collection_time=None, encrypted=None, encryption_status=None, name=None, system_id=None, type=None, uid=None, user_uuid=None, uuid=None): # noqa: E501 """SystemInsightsDiskEncryption - a model defined in Swagger""" # noqa: E501 - self._collection_time = None self._encrypted = None self._encryption_status = None @@ -67,7 +63,6 @@ def __init__(self, collection_time=None, encrypted=None, encryption_status=None, self._user_uuid = None self._uuid = None self.discriminator = None - if collection_time is not None: self.collection_time = collection_time if encrypted is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_disk_info.py b/jcapiv2/jcapiv2/models/system_insights_disk_info.py index 6f2cf02..6f53473 100644 --- a/jcapiv2/jcapiv2/models/system_insights_disk_info.py +++ b/jcapiv2/jcapiv2/models/system_insights_disk_info.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsDiskInfo(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -64,7 +61,6 @@ class SystemInsightsDiskInfo(object): def __init__(self, collection_time=None, description=None, disk_index=None, disk_size=None, hardware_model=None, id=None, manufacturer=None, name=None, partitions=None, pnp_device_id=None, serial=None, system_id=None, type=None): # noqa: E501 """SystemInsightsDiskInfo - a model defined in Swagger""" # noqa: E501 - self._collection_time = None self._description = None self._disk_index = None @@ -79,7 +75,6 @@ def __init__(self, collection_time=None, description=None, disk_index=None, disk self._system_id = None self._type = None self.discriminator = None - if collection_time is not None: self.collection_time = collection_time if description is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_dns_resolvers.py b/jcapiv2/jcapiv2/models/system_insights_dns_resolvers.py new file mode 100644 index 0000000..603dca4 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_dns_resolvers.py @@ -0,0 +1,266 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsDnsResolvers(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'address': 'str', + 'collection_time': 'str', + 'id': 'float', + 'netmask': 'str', + 'options': 'str', + 'system_id': 'str', + 'type': 'str' + } + + attribute_map = { + 'address': 'address', + 'collection_time': 'collection_time', + 'id': 'id', + 'netmask': 'netmask', + 'options': 'options', + 'system_id': 'system_id', + 'type': 'type' + } + + def __init__(self, address=None, collection_time=None, id=None, netmask=None, options=None, system_id=None, type=None): # noqa: E501 + """SystemInsightsDnsResolvers - a model defined in Swagger""" # noqa: E501 + self._address = None + self._collection_time = None + self._id = None + self._netmask = None + self._options = None + self._system_id = None + self._type = None + self.discriminator = None + if address is not None: + self.address = address + if collection_time is not None: + self.collection_time = collection_time + if id is not None: + self.id = id + if netmask is not None: + self.netmask = netmask + if options is not None: + self.options = options + if system_id is not None: + self.system_id = system_id + if type is not None: + self.type = type + + @property + def address(self): + """Gets the address of this SystemInsightsDnsResolvers. # noqa: E501 + + + :return: The address of this SystemInsightsDnsResolvers. # noqa: E501 + :rtype: str + """ + return self._address + + @address.setter + def address(self, address): + """Sets the address of this SystemInsightsDnsResolvers. + + + :param address: The address of this SystemInsightsDnsResolvers. # noqa: E501 + :type: str + """ + + self._address = address + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsDnsResolvers. # noqa: E501 + + + :return: The collection_time of this SystemInsightsDnsResolvers. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsDnsResolvers. + + + :param collection_time: The collection_time of this SystemInsightsDnsResolvers. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def id(self): + """Gets the id of this SystemInsightsDnsResolvers. # noqa: E501 + + + :return: The id of this SystemInsightsDnsResolvers. # noqa: E501 + :rtype: float + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this SystemInsightsDnsResolvers. + + + :param id: The id of this SystemInsightsDnsResolvers. # noqa: E501 + :type: float + """ + + self._id = id + + @property + def netmask(self): + """Gets the netmask of this SystemInsightsDnsResolvers. # noqa: E501 + + + :return: The netmask of this SystemInsightsDnsResolvers. # noqa: E501 + :rtype: str + """ + return self._netmask + + @netmask.setter + def netmask(self, netmask): + """Sets the netmask of this SystemInsightsDnsResolvers. + + + :param netmask: The netmask of this SystemInsightsDnsResolvers. # noqa: E501 + :type: str + """ + + self._netmask = netmask + + @property + def options(self): + """Gets the options of this SystemInsightsDnsResolvers. # noqa: E501 + + + :return: The options of this SystemInsightsDnsResolvers. # noqa: E501 + :rtype: str + """ + return self._options + + @options.setter + def options(self, options): + """Sets the options of this SystemInsightsDnsResolvers. + + + :param options: The options of this SystemInsightsDnsResolvers. # noqa: E501 + :type: str + """ + + self._options = options + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsDnsResolvers. # noqa: E501 + + + :return: The system_id of this SystemInsightsDnsResolvers. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsDnsResolvers. + + + :param system_id: The system_id of this SystemInsightsDnsResolvers. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def type(self): + """Gets the type of this SystemInsightsDnsResolvers. # noqa: E501 + + + :return: The type of this SystemInsightsDnsResolvers. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SystemInsightsDnsResolvers. + + + :param type: The type of this SystemInsightsDnsResolvers. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsDnsResolvers, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsDnsResolvers): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_etc_hosts.py b/jcapiv2/jcapiv2/models/system_insights_etc_hosts.py index c71e3eb..f888d42 100644 --- a/jcapiv2/jcapiv2/models/system_insights_etc_hosts.py +++ b/jcapiv2/jcapiv2/models/system_insights_etc_hosts.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsEtcHosts(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -46,13 +43,11 @@ class SystemInsightsEtcHosts(object): def __init__(self, address=None, collection_time=None, hostnames=None, system_id=None): # noqa: E501 """SystemInsightsEtcHosts - a model defined in Swagger""" # noqa: E501 - self._address = None self._collection_time = None self._hostnames = None self._system_id = None self.discriminator = None - if address is not None: self.address = address if collection_time is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_firefox_addons.py b/jcapiv2/jcapiv2/models/system_insights_firefox_addons.py index 79b332e..cbdae9c 100644 --- a/jcapiv2/jcapiv2/models/system_insights_firefox_addons.py +++ b/jcapiv2/jcapiv2/models/system_insights_firefox_addons.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsFirefoxAddons(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -70,7 +67,6 @@ class SystemInsightsFirefoxAddons(object): def __init__(self, active=None, autoupdate=None, collection_time=None, creator=None, description=None, disabled=None, identifier=None, location=None, name=None, path=None, source_url=None, system_id=None, type=None, uid=None, version=None, visible=None): # noqa: E501 """SystemInsightsFirefoxAddons - a model defined in Swagger""" # noqa: E501 - self._active = None self._autoupdate = None self._collection_time = None @@ -88,7 +84,6 @@ def __init__(self, active=None, autoupdate=None, collection_time=None, creator=N self._version = None self._visible = None self.discriminator = None - if active is not None: self.active = active if autoupdate is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_groups.py b/jcapiv2/jcapiv2/models/system_insights_groups.py index b2dabbe..72626f3 100644 --- a/jcapiv2/jcapiv2/models/system_insights_groups.py +++ b/jcapiv2/jcapiv2/models/system_insights_groups.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsGroups(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -52,7 +49,6 @@ class SystemInsightsGroups(object): def __init__(self, collection_time=None, comment=None, gid=None, gid_signed=None, group_sid=None, groupname=None, system_id=None): # noqa: E501 """SystemInsightsGroups - a model defined in Swagger""" # noqa: E501 - self._collection_time = None self._comment = None self._gid = None @@ -61,7 +57,6 @@ def __init__(self, collection_time=None, comment=None, gid=None, gid_signed=None self._groupname = None self._system_id = None self.discriminator = None - if collection_time is not None: self.collection_time = collection_time if comment is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_ie_extensions.py b/jcapiv2/jcapiv2/models/system_insights_ie_extensions.py index a421fc4..22ada79 100644 --- a/jcapiv2/jcapiv2/models/system_insights_ie_extensions.py +++ b/jcapiv2/jcapiv2/models/system_insights_ie_extensions.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsIeExtensions(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -50,7 +47,6 @@ class SystemInsightsIeExtensions(object): def __init__(self, collection_time=None, name=None, path=None, registry_path=None, system_id=None, version=None): # noqa: E501 """SystemInsightsIeExtensions - a model defined in Swagger""" # noqa: E501 - self._collection_time = None self._name = None self._path = None @@ -58,7 +54,6 @@ def __init__(self, collection_time=None, name=None, path=None, registry_path=Non self._system_id = None self._version = None self.discriminator = None - if collection_time is not None: self.collection_time = collection_time if name is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_interface_addresses.py b/jcapiv2/jcapiv2/models/system_insights_interface_addresses.py index c6cac61..467b61c 100644 --- a/jcapiv2/jcapiv2/models/system_insights_interface_addresses.py +++ b/jcapiv2/jcapiv2/models/system_insights_interface_addresses.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsInterfaceAddresses(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -56,7 +53,6 @@ class SystemInsightsInterfaceAddresses(object): def __init__(self, address=None, broadcast=None, collection_time=None, friendly_name=None, interface=None, mask=None, point_to_point=None, system_id=None, type=None): # noqa: E501 """SystemInsightsInterfaceAddresses - a model defined in Swagger""" # noqa: E501 - self._address = None self._broadcast = None self._collection_time = None @@ -67,7 +63,6 @@ def __init__(self, address=None, broadcast=None, collection_time=None, friendly_ self._system_id = None self._type = None self.discriminator = None - if address is not None: self.address = address if broadcast is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_interface_details.py b/jcapiv2/jcapiv2/models/system_insights_interface_details.py new file mode 100644 index 0000000..7606ac6 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_interface_details.py @@ -0,0 +1,1020 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsInterfaceDetails(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'collisions': 'str', + 'connection_id': 'str', + 'connection_status': 'str', + 'description': 'str', + 'dhcp_enabled': 'int', + 'dhcp_lease_expires': 'str', + 'dhcp_lease_obtained': 'str', + 'dhcp_server': 'str', + 'dns_domain': 'str', + 'dns_domain_suffix_search_order': 'str', + 'dns_host_name': 'str', + 'dns_server_search_order': 'str', + 'enabled': 'int', + 'flags': 'int', + 'friendly_name': 'str', + 'ibytes': 'str', + 'idrops': 'str', + 'ierrors': 'str', + 'interface': 'str', + 'ipackets': 'str', + 'last_change': 'str', + 'link_speed': 'str', + 'mac': 'str', + 'manufacturer': 'str', + 'metric': 'int', + 'mtu': 'int', + 'obytes': 'str', + 'odrops': 'str', + 'oerrors': 'str', + 'opackets': 'str', + 'pci_slot': 'str', + 'physical_adapter': 'int', + 'service': 'str', + 'speed': 'int', + 'system_id': 'str', + 'type': 'int' + } + + attribute_map = { + 'collisions': 'collisions', + 'connection_id': 'connection_id', + 'connection_status': 'connection_status', + 'description': 'description', + 'dhcp_enabled': 'dhcp_enabled', + 'dhcp_lease_expires': 'dhcp_lease_expires', + 'dhcp_lease_obtained': 'dhcp_lease_obtained', + 'dhcp_server': 'dhcp_server', + 'dns_domain': 'dns_domain', + 'dns_domain_suffix_search_order': 'dns_domain_suffix_search_order', + 'dns_host_name': 'dns_host_name', + 'dns_server_search_order': 'dns_server_search_order', + 'enabled': 'enabled', + 'flags': 'flags', + 'friendly_name': 'friendly_name', + 'ibytes': 'ibytes', + 'idrops': 'idrops', + 'ierrors': 'ierrors', + 'interface': 'interface', + 'ipackets': 'ipackets', + 'last_change': 'last_change', + 'link_speed': 'link_speed', + 'mac': 'mac', + 'manufacturer': 'manufacturer', + 'metric': 'metric', + 'mtu': 'mtu', + 'obytes': 'obytes', + 'odrops': 'odrops', + 'oerrors': 'oerrors', + 'opackets': 'opackets', + 'pci_slot': 'pci_slot', + 'physical_adapter': 'physical_adapter', + 'service': 'service', + 'speed': 'speed', + 'system_id': 'system_id', + 'type': 'type' + } + + def __init__(self, collisions=None, connection_id=None, connection_status=None, description=None, dhcp_enabled=None, dhcp_lease_expires=None, dhcp_lease_obtained=None, dhcp_server=None, dns_domain=None, dns_domain_suffix_search_order=None, dns_host_name=None, dns_server_search_order=None, enabled=None, flags=None, friendly_name=None, ibytes=None, idrops=None, ierrors=None, interface=None, ipackets=None, last_change=None, link_speed=None, mac=None, manufacturer=None, metric=None, mtu=None, obytes=None, odrops=None, oerrors=None, opackets=None, pci_slot=None, physical_adapter=None, service=None, speed=None, system_id=None, type=None): # noqa: E501 + """SystemInsightsInterfaceDetails - a model defined in Swagger""" # noqa: E501 + self._collisions = None + self._connection_id = None + self._connection_status = None + self._description = None + self._dhcp_enabled = None + self._dhcp_lease_expires = None + self._dhcp_lease_obtained = None + self._dhcp_server = None + self._dns_domain = None + self._dns_domain_suffix_search_order = None + self._dns_host_name = None + self._dns_server_search_order = None + self._enabled = None + self._flags = None + self._friendly_name = None + self._ibytes = None + self._idrops = None + self._ierrors = None + self._interface = None + self._ipackets = None + self._last_change = None + self._link_speed = None + self._mac = None + self._manufacturer = None + self._metric = None + self._mtu = None + self._obytes = None + self._odrops = None + self._oerrors = None + self._opackets = None + self._pci_slot = None + self._physical_adapter = None + self._service = None + self._speed = None + self._system_id = None + self._type = None + self.discriminator = None + if collisions is not None: + self.collisions = collisions + if connection_id is not None: + self.connection_id = connection_id + if connection_status is not None: + self.connection_status = connection_status + if description is not None: + self.description = description + if dhcp_enabled is not None: + self.dhcp_enabled = dhcp_enabled + if dhcp_lease_expires is not None: + self.dhcp_lease_expires = dhcp_lease_expires + if dhcp_lease_obtained is not None: + self.dhcp_lease_obtained = dhcp_lease_obtained + if dhcp_server is not None: + self.dhcp_server = dhcp_server + if dns_domain is not None: + self.dns_domain = dns_domain + if dns_domain_suffix_search_order is not None: + self.dns_domain_suffix_search_order = dns_domain_suffix_search_order + if dns_host_name is not None: + self.dns_host_name = dns_host_name + if dns_server_search_order is not None: + self.dns_server_search_order = dns_server_search_order + if enabled is not None: + self.enabled = enabled + if flags is not None: + self.flags = flags + if friendly_name is not None: + self.friendly_name = friendly_name + if ibytes is not None: + self.ibytes = ibytes + if idrops is not None: + self.idrops = idrops + if ierrors is not None: + self.ierrors = ierrors + if interface is not None: + self.interface = interface + if ipackets is not None: + self.ipackets = ipackets + if last_change is not None: + self.last_change = last_change + if link_speed is not None: + self.link_speed = link_speed + if mac is not None: + self.mac = mac + if manufacturer is not None: + self.manufacturer = manufacturer + if metric is not None: + self.metric = metric + if mtu is not None: + self.mtu = mtu + if obytes is not None: + self.obytes = obytes + if odrops is not None: + self.odrops = odrops + if oerrors is not None: + self.oerrors = oerrors + if opackets is not None: + self.opackets = opackets + if pci_slot is not None: + self.pci_slot = pci_slot + if physical_adapter is not None: + self.physical_adapter = physical_adapter + if service is not None: + self.service = service + if speed is not None: + self.speed = speed + if system_id is not None: + self.system_id = system_id + if type is not None: + self.type = type + + @property + def collisions(self): + """Gets the collisions of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The collisions of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._collisions + + @collisions.setter + def collisions(self, collisions): + """Sets the collisions of this SystemInsightsInterfaceDetails. + + + :param collisions: The collisions of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._collisions = collisions + + @property + def connection_id(self): + """Gets the connection_id of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The connection_id of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._connection_id + + @connection_id.setter + def connection_id(self, connection_id): + """Sets the connection_id of this SystemInsightsInterfaceDetails. + + + :param connection_id: The connection_id of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._connection_id = connection_id + + @property + def connection_status(self): + """Gets the connection_status of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The connection_status of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._connection_status + + @connection_status.setter + def connection_status(self, connection_status): + """Sets the connection_status of this SystemInsightsInterfaceDetails. + + + :param connection_status: The connection_status of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._connection_status = connection_status + + @property + def description(self): + """Gets the description of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The description of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this SystemInsightsInterfaceDetails. + + + :param description: The description of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def dhcp_enabled(self): + """Gets the dhcp_enabled of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The dhcp_enabled of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: int + """ + return self._dhcp_enabled + + @dhcp_enabled.setter + def dhcp_enabled(self, dhcp_enabled): + """Sets the dhcp_enabled of this SystemInsightsInterfaceDetails. + + + :param dhcp_enabled: The dhcp_enabled of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: int + """ + + self._dhcp_enabled = dhcp_enabled + + @property + def dhcp_lease_expires(self): + """Gets the dhcp_lease_expires of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The dhcp_lease_expires of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._dhcp_lease_expires + + @dhcp_lease_expires.setter + def dhcp_lease_expires(self, dhcp_lease_expires): + """Sets the dhcp_lease_expires of this SystemInsightsInterfaceDetails. + + + :param dhcp_lease_expires: The dhcp_lease_expires of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._dhcp_lease_expires = dhcp_lease_expires + + @property + def dhcp_lease_obtained(self): + """Gets the dhcp_lease_obtained of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The dhcp_lease_obtained of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._dhcp_lease_obtained + + @dhcp_lease_obtained.setter + def dhcp_lease_obtained(self, dhcp_lease_obtained): + """Sets the dhcp_lease_obtained of this SystemInsightsInterfaceDetails. + + + :param dhcp_lease_obtained: The dhcp_lease_obtained of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._dhcp_lease_obtained = dhcp_lease_obtained + + @property + def dhcp_server(self): + """Gets the dhcp_server of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The dhcp_server of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._dhcp_server + + @dhcp_server.setter + def dhcp_server(self, dhcp_server): + """Sets the dhcp_server of this SystemInsightsInterfaceDetails. + + + :param dhcp_server: The dhcp_server of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._dhcp_server = dhcp_server + + @property + def dns_domain(self): + """Gets the dns_domain of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The dns_domain of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._dns_domain + + @dns_domain.setter + def dns_domain(self, dns_domain): + """Sets the dns_domain of this SystemInsightsInterfaceDetails. + + + :param dns_domain: The dns_domain of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._dns_domain = dns_domain + + @property + def dns_domain_suffix_search_order(self): + """Gets the dns_domain_suffix_search_order of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The dns_domain_suffix_search_order of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._dns_domain_suffix_search_order + + @dns_domain_suffix_search_order.setter + def dns_domain_suffix_search_order(self, dns_domain_suffix_search_order): + """Sets the dns_domain_suffix_search_order of this SystemInsightsInterfaceDetails. + + + :param dns_domain_suffix_search_order: The dns_domain_suffix_search_order of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._dns_domain_suffix_search_order = dns_domain_suffix_search_order + + @property + def dns_host_name(self): + """Gets the dns_host_name of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The dns_host_name of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._dns_host_name + + @dns_host_name.setter + def dns_host_name(self, dns_host_name): + """Sets the dns_host_name of this SystemInsightsInterfaceDetails. + + + :param dns_host_name: The dns_host_name of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._dns_host_name = dns_host_name + + @property + def dns_server_search_order(self): + """Gets the dns_server_search_order of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The dns_server_search_order of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._dns_server_search_order + + @dns_server_search_order.setter + def dns_server_search_order(self, dns_server_search_order): + """Sets the dns_server_search_order of this SystemInsightsInterfaceDetails. + + + :param dns_server_search_order: The dns_server_search_order of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._dns_server_search_order = dns_server_search_order + + @property + def enabled(self): + """Gets the enabled of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The enabled of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: int + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled): + """Sets the enabled of this SystemInsightsInterfaceDetails. + + + :param enabled: The enabled of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: int + """ + + self._enabled = enabled + + @property + def flags(self): + """Gets the flags of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The flags of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: int + """ + return self._flags + + @flags.setter + def flags(self, flags): + """Sets the flags of this SystemInsightsInterfaceDetails. + + + :param flags: The flags of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: int + """ + + self._flags = flags + + @property + def friendly_name(self): + """Gets the friendly_name of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The friendly_name of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._friendly_name + + @friendly_name.setter + def friendly_name(self, friendly_name): + """Sets the friendly_name of this SystemInsightsInterfaceDetails. + + + :param friendly_name: The friendly_name of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._friendly_name = friendly_name + + @property + def ibytes(self): + """Gets the ibytes of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The ibytes of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._ibytes + + @ibytes.setter + def ibytes(self, ibytes): + """Sets the ibytes of this SystemInsightsInterfaceDetails. + + + :param ibytes: The ibytes of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._ibytes = ibytes + + @property + def idrops(self): + """Gets the idrops of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The idrops of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._idrops + + @idrops.setter + def idrops(self, idrops): + """Sets the idrops of this SystemInsightsInterfaceDetails. + + + :param idrops: The idrops of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._idrops = idrops + + @property + def ierrors(self): + """Gets the ierrors of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The ierrors of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._ierrors + + @ierrors.setter + def ierrors(self, ierrors): + """Sets the ierrors of this SystemInsightsInterfaceDetails. + + + :param ierrors: The ierrors of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._ierrors = ierrors + + @property + def interface(self): + """Gets the interface of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The interface of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._interface + + @interface.setter + def interface(self, interface): + """Sets the interface of this SystemInsightsInterfaceDetails. + + + :param interface: The interface of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._interface = interface + + @property + def ipackets(self): + """Gets the ipackets of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The ipackets of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._ipackets + + @ipackets.setter + def ipackets(self, ipackets): + """Sets the ipackets of this SystemInsightsInterfaceDetails. + + + :param ipackets: The ipackets of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._ipackets = ipackets + + @property + def last_change(self): + """Gets the last_change of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The last_change of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._last_change + + @last_change.setter + def last_change(self, last_change): + """Sets the last_change of this SystemInsightsInterfaceDetails. + + + :param last_change: The last_change of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._last_change = last_change + + @property + def link_speed(self): + """Gets the link_speed of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The link_speed of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._link_speed + + @link_speed.setter + def link_speed(self, link_speed): + """Sets the link_speed of this SystemInsightsInterfaceDetails. + + + :param link_speed: The link_speed of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._link_speed = link_speed + + @property + def mac(self): + """Gets the mac of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The mac of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._mac + + @mac.setter + def mac(self, mac): + """Sets the mac of this SystemInsightsInterfaceDetails. + + + :param mac: The mac of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._mac = mac + + @property + def manufacturer(self): + """Gets the manufacturer of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The manufacturer of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._manufacturer + + @manufacturer.setter + def manufacturer(self, manufacturer): + """Sets the manufacturer of this SystemInsightsInterfaceDetails. + + + :param manufacturer: The manufacturer of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._manufacturer = manufacturer + + @property + def metric(self): + """Gets the metric of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The metric of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: int + """ + return self._metric + + @metric.setter + def metric(self, metric): + """Sets the metric of this SystemInsightsInterfaceDetails. + + + :param metric: The metric of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: int + """ + + self._metric = metric + + @property + def mtu(self): + """Gets the mtu of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The mtu of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: int + """ + return self._mtu + + @mtu.setter + def mtu(self, mtu): + """Sets the mtu of this SystemInsightsInterfaceDetails. + + + :param mtu: The mtu of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: int + """ + + self._mtu = mtu + + @property + def obytes(self): + """Gets the obytes of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The obytes of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._obytes + + @obytes.setter + def obytes(self, obytes): + """Sets the obytes of this SystemInsightsInterfaceDetails. + + + :param obytes: The obytes of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._obytes = obytes + + @property + def odrops(self): + """Gets the odrops of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The odrops of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._odrops + + @odrops.setter + def odrops(self, odrops): + """Sets the odrops of this SystemInsightsInterfaceDetails. + + + :param odrops: The odrops of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._odrops = odrops + + @property + def oerrors(self): + """Gets the oerrors of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The oerrors of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._oerrors + + @oerrors.setter + def oerrors(self, oerrors): + """Sets the oerrors of this SystemInsightsInterfaceDetails. + + + :param oerrors: The oerrors of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._oerrors = oerrors + + @property + def opackets(self): + """Gets the opackets of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The opackets of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._opackets + + @opackets.setter + def opackets(self, opackets): + """Sets the opackets of this SystemInsightsInterfaceDetails. + + + :param opackets: The opackets of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._opackets = opackets + + @property + def pci_slot(self): + """Gets the pci_slot of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The pci_slot of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._pci_slot + + @pci_slot.setter + def pci_slot(self, pci_slot): + """Sets the pci_slot of this SystemInsightsInterfaceDetails. + + + :param pci_slot: The pci_slot of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._pci_slot = pci_slot + + @property + def physical_adapter(self): + """Gets the physical_adapter of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The physical_adapter of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: int + """ + return self._physical_adapter + + @physical_adapter.setter + def physical_adapter(self, physical_adapter): + """Sets the physical_adapter of this SystemInsightsInterfaceDetails. + + + :param physical_adapter: The physical_adapter of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: int + """ + + self._physical_adapter = physical_adapter + + @property + def service(self): + """Gets the service of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The service of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._service + + @service.setter + def service(self, service): + """Sets the service of this SystemInsightsInterfaceDetails. + + + :param service: The service of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._service = service + + @property + def speed(self): + """Gets the speed of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The speed of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: int + """ + return self._speed + + @speed.setter + def speed(self, speed): + """Sets the speed of this SystemInsightsInterfaceDetails. + + + :param speed: The speed of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: int + """ + + self._speed = speed + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The system_id of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsInterfaceDetails. + + + :param system_id: The system_id of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def type(self): + """Gets the type of this SystemInsightsInterfaceDetails. # noqa: E501 + + + :return: The type of this SystemInsightsInterfaceDetails. # noqa: E501 + :rtype: int + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SystemInsightsInterfaceDetails. + + + :param type: The type of this SystemInsightsInterfaceDetails. # noqa: E501 + :type: int + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsInterfaceDetails, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsInterfaceDetails): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_kernel_info.py b/jcapiv2/jcapiv2/models/system_insights_kernel_info.py index 5b9b621..bd7a7da 100644 --- a/jcapiv2/jcapiv2/models/system_insights_kernel_info.py +++ b/jcapiv2/jcapiv2/models/system_insights_kernel_info.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsKernelInfo(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -50,7 +47,6 @@ class SystemInsightsKernelInfo(object): def __init__(self, arguments=None, collection_time=None, device=None, path=None, system_id=None, version=None): # noqa: E501 """SystemInsightsKernelInfo - a model defined in Swagger""" # noqa: E501 - self._arguments = None self._collection_time = None self._device = None @@ -58,7 +54,6 @@ def __init__(self, arguments=None, collection_time=None, device=None, path=None, self._system_id = None self._version = None self.discriminator = None - if arguments is not None: self.arguments = arguments if collection_time is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_launchd.py b/jcapiv2/jcapiv2/models/system_insights_launchd.py index b09b23f..167f2c9 100644 --- a/jcapiv2/jcapiv2/models/system_insights_launchd.py +++ b/jcapiv2/jcapiv2/models/system_insights_launchd.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsLaunchd(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -84,7 +81,6 @@ class SystemInsightsLaunchd(object): def __init__(self, collection_time=None, disabled=None, groupname=None, inetd_compatibility=None, keep_alive=None, label=None, name=None, on_demand=None, path=None, process_type=None, program=None, program_arguments=None, queue_directories=None, root_directory=None, run_at_load=None, start_interval=None, start_on_mount=None, stderr_path=None, stdout_path=None, system_id=None, username=None, watch_paths=None, working_directory=None): # noqa: E501 """SystemInsightsLaunchd - a model defined in Swagger""" # noqa: E501 - self._collection_time = None self._disabled = None self._groupname = None @@ -109,7 +105,6 @@ def __init__(self, collection_time=None, disabled=None, groupname=None, inetd_co self._watch_paths = None self._working_directory = None self.discriminator = None - if collection_time is not None: self.collection_time = collection_time if disabled is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_linux_packages.py b/jcapiv2/jcapiv2/models/system_insights_linux_packages.py new file mode 100644 index 0000000..19d9b40 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_linux_packages.py @@ -0,0 +1,396 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsLinuxPackages(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'arch': 'str', + 'install_time': 'int', + 'maintainer_or_vendor': 'str', + 'mount_namespace_id': 'str', + 'name': 'str', + 'package_format': 'str', + 'package_group_or_section': 'str', + 'pid_with_namespace': 'int', + 'release_or_revision': 'str', + 'size': 'str', + 'system_id': 'str', + 'version': 'str' + } + + attribute_map = { + 'arch': 'arch', + 'install_time': 'install_time', + 'maintainer_or_vendor': 'maintainer_or_vendor', + 'mount_namespace_id': 'mount_namespace_id', + 'name': 'name', + 'package_format': 'package_format', + 'package_group_or_section': 'package_group_or_section', + 'pid_with_namespace': 'pid_with_namespace', + 'release_or_revision': 'release_or_revision', + 'size': 'size', + 'system_id': 'system_id', + 'version': 'version' + } + + def __init__(self, arch=None, install_time=None, maintainer_or_vendor=None, mount_namespace_id=None, name=None, package_format=None, package_group_or_section=None, pid_with_namespace=None, release_or_revision=None, size=None, system_id=None, version=None): # noqa: E501 + """SystemInsightsLinuxPackages - a model defined in Swagger""" # noqa: E501 + self._arch = None + self._install_time = None + self._maintainer_or_vendor = None + self._mount_namespace_id = None + self._name = None + self._package_format = None + self._package_group_or_section = None + self._pid_with_namespace = None + self._release_or_revision = None + self._size = None + self._system_id = None + self._version = None + self.discriminator = None + if arch is not None: + self.arch = arch + if install_time is not None: + self.install_time = install_time + if maintainer_or_vendor is not None: + self.maintainer_or_vendor = maintainer_or_vendor + if mount_namespace_id is not None: + self.mount_namespace_id = mount_namespace_id + if name is not None: + self.name = name + if package_format is not None: + self.package_format = package_format + if package_group_or_section is not None: + self.package_group_or_section = package_group_or_section + if pid_with_namespace is not None: + self.pid_with_namespace = pid_with_namespace + if release_or_revision is not None: + self.release_or_revision = release_or_revision + if size is not None: + self.size = size + if system_id is not None: + self.system_id = system_id + if version is not None: + self.version = version + + @property + def arch(self): + """Gets the arch of this SystemInsightsLinuxPackages. # noqa: E501 + + + :return: The arch of this SystemInsightsLinuxPackages. # noqa: E501 + :rtype: str + """ + return self._arch + + @arch.setter + def arch(self, arch): + """Sets the arch of this SystemInsightsLinuxPackages. + + + :param arch: The arch of this SystemInsightsLinuxPackages. # noqa: E501 + :type: str + """ + + self._arch = arch + + @property + def install_time(self): + """Gets the install_time of this SystemInsightsLinuxPackages. # noqa: E501 + + + :return: The install_time of this SystemInsightsLinuxPackages. # noqa: E501 + :rtype: int + """ + return self._install_time + + @install_time.setter + def install_time(self, install_time): + """Sets the install_time of this SystemInsightsLinuxPackages. + + + :param install_time: The install_time of this SystemInsightsLinuxPackages. # noqa: E501 + :type: int + """ + + self._install_time = install_time + + @property + def maintainer_or_vendor(self): + """Gets the maintainer_or_vendor of this SystemInsightsLinuxPackages. # noqa: E501 + + + :return: The maintainer_or_vendor of this SystemInsightsLinuxPackages. # noqa: E501 + :rtype: str + """ + return self._maintainer_or_vendor + + @maintainer_or_vendor.setter + def maintainer_or_vendor(self, maintainer_or_vendor): + """Sets the maintainer_or_vendor of this SystemInsightsLinuxPackages. + + + :param maintainer_or_vendor: The maintainer_or_vendor of this SystemInsightsLinuxPackages. # noqa: E501 + :type: str + """ + + self._maintainer_or_vendor = maintainer_or_vendor + + @property + def mount_namespace_id(self): + """Gets the mount_namespace_id of this SystemInsightsLinuxPackages. # noqa: E501 + + + :return: The mount_namespace_id of this SystemInsightsLinuxPackages. # noqa: E501 + :rtype: str + """ + return self._mount_namespace_id + + @mount_namespace_id.setter + def mount_namespace_id(self, mount_namespace_id): + """Sets the mount_namespace_id of this SystemInsightsLinuxPackages. + + + :param mount_namespace_id: The mount_namespace_id of this SystemInsightsLinuxPackages. # noqa: E501 + :type: str + """ + + self._mount_namespace_id = mount_namespace_id + + @property + def name(self): + """Gets the name of this SystemInsightsLinuxPackages. # noqa: E501 + + + :return: The name of this SystemInsightsLinuxPackages. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SystemInsightsLinuxPackages. + + + :param name: The name of this SystemInsightsLinuxPackages. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def package_format(self): + """Gets the package_format of this SystemInsightsLinuxPackages. # noqa: E501 + + + :return: The package_format of this SystemInsightsLinuxPackages. # noqa: E501 + :rtype: str + """ + return self._package_format + + @package_format.setter + def package_format(self, package_format): + """Sets the package_format of this SystemInsightsLinuxPackages. + + + :param package_format: The package_format of this SystemInsightsLinuxPackages. # noqa: E501 + :type: str + """ + + self._package_format = package_format + + @property + def package_group_or_section(self): + """Gets the package_group_or_section of this SystemInsightsLinuxPackages. # noqa: E501 + + + :return: The package_group_or_section of this SystemInsightsLinuxPackages. # noqa: E501 + :rtype: str + """ + return self._package_group_or_section + + @package_group_or_section.setter + def package_group_or_section(self, package_group_or_section): + """Sets the package_group_or_section of this SystemInsightsLinuxPackages. + + + :param package_group_or_section: The package_group_or_section of this SystemInsightsLinuxPackages. # noqa: E501 + :type: str + """ + + self._package_group_or_section = package_group_or_section + + @property + def pid_with_namespace(self): + """Gets the pid_with_namespace of this SystemInsightsLinuxPackages. # noqa: E501 + + + :return: The pid_with_namespace of this SystemInsightsLinuxPackages. # noqa: E501 + :rtype: int + """ + return self._pid_with_namespace + + @pid_with_namespace.setter + def pid_with_namespace(self, pid_with_namespace): + """Sets the pid_with_namespace of this SystemInsightsLinuxPackages. + + + :param pid_with_namespace: The pid_with_namespace of this SystemInsightsLinuxPackages. # noqa: E501 + :type: int + """ + + self._pid_with_namespace = pid_with_namespace + + @property + def release_or_revision(self): + """Gets the release_or_revision of this SystemInsightsLinuxPackages. # noqa: E501 + + + :return: The release_or_revision of this SystemInsightsLinuxPackages. # noqa: E501 + :rtype: str + """ + return self._release_or_revision + + @release_or_revision.setter + def release_or_revision(self, release_or_revision): + """Sets the release_or_revision of this SystemInsightsLinuxPackages. + + + :param release_or_revision: The release_or_revision of this SystemInsightsLinuxPackages. # noqa: E501 + :type: str + """ + + self._release_or_revision = release_or_revision + + @property + def size(self): + """Gets the size of this SystemInsightsLinuxPackages. # noqa: E501 + + + :return: The size of this SystemInsightsLinuxPackages. # noqa: E501 + :rtype: str + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this SystemInsightsLinuxPackages. + + + :param size: The size of this SystemInsightsLinuxPackages. # noqa: E501 + :type: str + """ + + self._size = size + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsLinuxPackages. # noqa: E501 + + + :return: The system_id of this SystemInsightsLinuxPackages. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsLinuxPackages. + + + :param system_id: The system_id of this SystemInsightsLinuxPackages. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def version(self): + """Gets the version of this SystemInsightsLinuxPackages. # noqa: E501 + + + :return: The version of this SystemInsightsLinuxPackages. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this SystemInsightsLinuxPackages. + + + :param version: The version of this SystemInsightsLinuxPackages. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsLinuxPackages, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsLinuxPackages): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_logged_in_users.py b/jcapiv2/jcapiv2/models/system_insights_logged_in_users.py index 7aaf85a..0dd8e1a 100644 --- a/jcapiv2/jcapiv2/models/system_insights_logged_in_users.py +++ b/jcapiv2/jcapiv2/models/system_insights_logged_in_users.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsLoggedInUsers(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -54,7 +51,6 @@ class SystemInsightsLoggedInUsers(object): def __init__(self, collection_time=None, host=None, pid=None, system_id=None, time=None, tty=None, type=None, user=None): # noqa: E501 """SystemInsightsLoggedInUsers - a model defined in Swagger""" # noqa: E501 - self._collection_time = None self._host = None self._pid = None @@ -64,7 +60,6 @@ def __init__(self, collection_time=None, host=None, pid=None, system_id=None, ti self._type = None self._user = None self.discriminator = None - if collection_time is not None: self.collection_time = collection_time if host is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_logical_drives.py b/jcapiv2/jcapiv2/models/system_insights_logical_drives.py new file mode 100644 index 0000000..b30ba27 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_logical_drives.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsLogicalDrives(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'boot_partition': 'int', + 'collection_time': 'str', + 'device_id': 'str', + 'file_system': 'str', + 'free_space': 'str', + 'size': 'str', + 'system_id': 'str', + 'type': 'str' + } + + attribute_map = { + 'boot_partition': 'boot_partition', + 'collection_time': 'collection_time', + 'device_id': 'device_id', + 'file_system': 'file_system', + 'free_space': 'free_space', + 'size': 'size', + 'system_id': 'system_id', + 'type': 'type' + } + + def __init__(self, boot_partition=None, collection_time=None, device_id=None, file_system=None, free_space=None, size=None, system_id=None, type=None): # noqa: E501 + """SystemInsightsLogicalDrives - a model defined in Swagger""" # noqa: E501 + self._boot_partition = None + self._collection_time = None + self._device_id = None + self._file_system = None + self._free_space = None + self._size = None + self._system_id = None + self._type = None + self.discriminator = None + if boot_partition is not None: + self.boot_partition = boot_partition + if collection_time is not None: + self.collection_time = collection_time + if device_id is not None: + self.device_id = device_id + if file_system is not None: + self.file_system = file_system + if free_space is not None: + self.free_space = free_space + if size is not None: + self.size = size + if system_id is not None: + self.system_id = system_id + if type is not None: + self.type = type + + @property + def boot_partition(self): + """Gets the boot_partition of this SystemInsightsLogicalDrives. # noqa: E501 + + + :return: The boot_partition of this SystemInsightsLogicalDrives. # noqa: E501 + :rtype: int + """ + return self._boot_partition + + @boot_partition.setter + def boot_partition(self, boot_partition): + """Sets the boot_partition of this SystemInsightsLogicalDrives. + + + :param boot_partition: The boot_partition of this SystemInsightsLogicalDrives. # noqa: E501 + :type: int + """ + + self._boot_partition = boot_partition + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsLogicalDrives. # noqa: E501 + + + :return: The collection_time of this SystemInsightsLogicalDrives. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsLogicalDrives. + + + :param collection_time: The collection_time of this SystemInsightsLogicalDrives. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def device_id(self): + """Gets the device_id of this SystemInsightsLogicalDrives. # noqa: E501 + + + :return: The device_id of this SystemInsightsLogicalDrives. # noqa: E501 + :rtype: str + """ + return self._device_id + + @device_id.setter + def device_id(self, device_id): + """Sets the device_id of this SystemInsightsLogicalDrives. + + + :param device_id: The device_id of this SystemInsightsLogicalDrives. # noqa: E501 + :type: str + """ + + self._device_id = device_id + + @property + def file_system(self): + """Gets the file_system of this SystemInsightsLogicalDrives. # noqa: E501 + + + :return: The file_system of this SystemInsightsLogicalDrives. # noqa: E501 + :rtype: str + """ + return self._file_system + + @file_system.setter + def file_system(self, file_system): + """Sets the file_system of this SystemInsightsLogicalDrives. + + + :param file_system: The file_system of this SystemInsightsLogicalDrives. # noqa: E501 + :type: str + """ + + self._file_system = file_system + + @property + def free_space(self): + """Gets the free_space of this SystemInsightsLogicalDrives. # noqa: E501 + + + :return: The free_space of this SystemInsightsLogicalDrives. # noqa: E501 + :rtype: str + """ + return self._free_space + + @free_space.setter + def free_space(self, free_space): + """Sets the free_space of this SystemInsightsLogicalDrives. + + + :param free_space: The free_space of this SystemInsightsLogicalDrives. # noqa: E501 + :type: str + """ + + self._free_space = free_space + + @property + def size(self): + """Gets the size of this SystemInsightsLogicalDrives. # noqa: E501 + + + :return: The size of this SystemInsightsLogicalDrives. # noqa: E501 + :rtype: str + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this SystemInsightsLogicalDrives. + + + :param size: The size of this SystemInsightsLogicalDrives. # noqa: E501 + :type: str + """ + + self._size = size + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsLogicalDrives. # noqa: E501 + + + :return: The system_id of this SystemInsightsLogicalDrives. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsLogicalDrives. + + + :param system_id: The system_id of this SystemInsightsLogicalDrives. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def type(self): + """Gets the type of this SystemInsightsLogicalDrives. # noqa: E501 + + + :return: The type of this SystemInsightsLogicalDrives. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SystemInsightsLogicalDrives. + + + :param type: The type of this SystemInsightsLogicalDrives. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsLogicalDrives, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsLogicalDrives): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_logical_drvies.py b/jcapiv2/jcapiv2/models/system_insights_logical_drvies.py deleted file mode 100644 index 9be86b2..0000000 --- a/jcapiv2/jcapiv2/models/system_insights_logical_drvies.py +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class SystemInsightsLogicalDrvies(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'boot_partition': 'int', - 'collection_time': 'str', - 'device_id': 'str', - 'file_system': 'str', - 'free_space': 'str', - 'size': 'str', - 'system_id': 'str', - 'type': 'str' - } - - attribute_map = { - 'boot_partition': 'boot_partition', - 'collection_time': 'collection_time', - 'device_id': 'device_id', - 'file_system': 'file_system', - 'free_space': 'free_space', - 'size': 'size', - 'system_id': 'system_id', - 'type': 'type' - } - - def __init__(self, boot_partition=None, collection_time=None, device_id=None, file_system=None, free_space=None, size=None, system_id=None, type=None): # noqa: E501 - """SystemInsightsLogicalDrvies - a model defined in Swagger""" # noqa: E501 - - self._boot_partition = None - self._collection_time = None - self._device_id = None - self._file_system = None - self._free_space = None - self._size = None - self._system_id = None - self._type = None - self.discriminator = None - - if boot_partition is not None: - self.boot_partition = boot_partition - if collection_time is not None: - self.collection_time = collection_time - if device_id is not None: - self.device_id = device_id - if file_system is not None: - self.file_system = file_system - if free_space is not None: - self.free_space = free_space - if size is not None: - self.size = size - if system_id is not None: - self.system_id = system_id - if type is not None: - self.type = type - - @property - def boot_partition(self): - """Gets the boot_partition of this SystemInsightsLogicalDrvies. # noqa: E501 - - - :return: The boot_partition of this SystemInsightsLogicalDrvies. # noqa: E501 - :rtype: int - """ - return self._boot_partition - - @boot_partition.setter - def boot_partition(self, boot_partition): - """Sets the boot_partition of this SystemInsightsLogicalDrvies. - - - :param boot_partition: The boot_partition of this SystemInsightsLogicalDrvies. # noqa: E501 - :type: int - """ - - self._boot_partition = boot_partition - - @property - def collection_time(self): - """Gets the collection_time of this SystemInsightsLogicalDrvies. # noqa: E501 - - - :return: The collection_time of this SystemInsightsLogicalDrvies. # noqa: E501 - :rtype: str - """ - return self._collection_time - - @collection_time.setter - def collection_time(self, collection_time): - """Sets the collection_time of this SystemInsightsLogicalDrvies. - - - :param collection_time: The collection_time of this SystemInsightsLogicalDrvies. # noqa: E501 - :type: str - """ - - self._collection_time = collection_time - - @property - def device_id(self): - """Gets the device_id of this SystemInsightsLogicalDrvies. # noqa: E501 - - - :return: The device_id of this SystemInsightsLogicalDrvies. # noqa: E501 - :rtype: str - """ - return self._device_id - - @device_id.setter - def device_id(self, device_id): - """Sets the device_id of this SystemInsightsLogicalDrvies. - - - :param device_id: The device_id of this SystemInsightsLogicalDrvies. # noqa: E501 - :type: str - """ - - self._device_id = device_id - - @property - def file_system(self): - """Gets the file_system of this SystemInsightsLogicalDrvies. # noqa: E501 - - - :return: The file_system of this SystemInsightsLogicalDrvies. # noqa: E501 - :rtype: str - """ - return self._file_system - - @file_system.setter - def file_system(self, file_system): - """Sets the file_system of this SystemInsightsLogicalDrvies. - - - :param file_system: The file_system of this SystemInsightsLogicalDrvies. # noqa: E501 - :type: str - """ - - self._file_system = file_system - - @property - def free_space(self): - """Gets the free_space of this SystemInsightsLogicalDrvies. # noqa: E501 - - - :return: The free_space of this SystemInsightsLogicalDrvies. # noqa: E501 - :rtype: str - """ - return self._free_space - - @free_space.setter - def free_space(self, free_space): - """Sets the free_space of this SystemInsightsLogicalDrvies. - - - :param free_space: The free_space of this SystemInsightsLogicalDrvies. # noqa: E501 - :type: str - """ - - self._free_space = free_space - - @property - def size(self): - """Gets the size of this SystemInsightsLogicalDrvies. # noqa: E501 - - - :return: The size of this SystemInsightsLogicalDrvies. # noqa: E501 - :rtype: str - """ - return self._size - - @size.setter - def size(self, size): - """Sets the size of this SystemInsightsLogicalDrvies. - - - :param size: The size of this SystemInsightsLogicalDrvies. # noqa: E501 - :type: str - """ - - self._size = size - - @property - def system_id(self): - """Gets the system_id of this SystemInsightsLogicalDrvies. # noqa: E501 - - - :return: The system_id of this SystemInsightsLogicalDrvies. # noqa: E501 - :rtype: str - """ - return self._system_id - - @system_id.setter - def system_id(self, system_id): - """Sets the system_id of this SystemInsightsLogicalDrvies. - - - :param system_id: The system_id of this SystemInsightsLogicalDrvies. # noqa: E501 - :type: str - """ - - self._system_id = system_id - - @property - def type(self): - """Gets the type of this SystemInsightsLogicalDrvies. # noqa: E501 - - - :return: The type of this SystemInsightsLogicalDrvies. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this SystemInsightsLogicalDrvies. - - - :param type: The type of this SystemInsightsLogicalDrvies. # noqa: E501 - :type: str - """ - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SystemInsightsLogicalDrvies, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SystemInsightsLogicalDrvies): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_managed_policies.py b/jcapiv2/jcapiv2/models/system_insights_managed_policies.py new file mode 100644 index 0000000..e2a702f --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_managed_policies.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsManagedPolicies(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'collection_time': 'str', + 'domain': 'str', + 'manual': 'int', + 'name': 'str', + 'system_id': 'str', + 'username': 'str', + 'uuid': 'str', + 'value': 'str' + } + + attribute_map = { + 'collection_time': 'collection_time', + 'domain': 'domain', + 'manual': 'manual', + 'name': 'name', + 'system_id': 'system_id', + 'username': 'username', + 'uuid': 'uuid', + 'value': 'value' + } + + def __init__(self, collection_time=None, domain=None, manual=None, name=None, system_id=None, username=None, uuid=None, value=None): # noqa: E501 + """SystemInsightsManagedPolicies - a model defined in Swagger""" # noqa: E501 + self._collection_time = None + self._domain = None + self._manual = None + self._name = None + self._system_id = None + self._username = None + self._uuid = None + self._value = None + self.discriminator = None + if collection_time is not None: + self.collection_time = collection_time + if domain is not None: + self.domain = domain + if manual is not None: + self.manual = manual + if name is not None: + self.name = name + if system_id is not None: + self.system_id = system_id + if username is not None: + self.username = username + if uuid is not None: + self.uuid = uuid + if value is not None: + self.value = value + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsManagedPolicies. # noqa: E501 + + + :return: The collection_time of this SystemInsightsManagedPolicies. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsManagedPolicies. + + + :param collection_time: The collection_time of this SystemInsightsManagedPolicies. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def domain(self): + """Gets the domain of this SystemInsightsManagedPolicies. # noqa: E501 + + + :return: The domain of this SystemInsightsManagedPolicies. # noqa: E501 + :rtype: str + """ + return self._domain + + @domain.setter + def domain(self, domain): + """Sets the domain of this SystemInsightsManagedPolicies. + + + :param domain: The domain of this SystemInsightsManagedPolicies. # noqa: E501 + :type: str + """ + + self._domain = domain + + @property + def manual(self): + """Gets the manual of this SystemInsightsManagedPolicies. # noqa: E501 + + + :return: The manual of this SystemInsightsManagedPolicies. # noqa: E501 + :rtype: int + """ + return self._manual + + @manual.setter + def manual(self, manual): + """Sets the manual of this SystemInsightsManagedPolicies. + + + :param manual: The manual of this SystemInsightsManagedPolicies. # noqa: E501 + :type: int + """ + + self._manual = manual + + @property + def name(self): + """Gets the name of this SystemInsightsManagedPolicies. # noqa: E501 + + + :return: The name of this SystemInsightsManagedPolicies. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SystemInsightsManagedPolicies. + + + :param name: The name of this SystemInsightsManagedPolicies. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsManagedPolicies. # noqa: E501 + + + :return: The system_id of this SystemInsightsManagedPolicies. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsManagedPolicies. + + + :param system_id: The system_id of this SystemInsightsManagedPolicies. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def username(self): + """Gets the username of this SystemInsightsManagedPolicies. # noqa: E501 + + + :return: The username of this SystemInsightsManagedPolicies. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this SystemInsightsManagedPolicies. + + + :param username: The username of this SystemInsightsManagedPolicies. # noqa: E501 + :type: str + """ + + self._username = username + + @property + def uuid(self): + """Gets the uuid of this SystemInsightsManagedPolicies. # noqa: E501 + + + :return: The uuid of this SystemInsightsManagedPolicies. # noqa: E501 + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid): + """Sets the uuid of this SystemInsightsManagedPolicies. + + + :param uuid: The uuid of this SystemInsightsManagedPolicies. # noqa: E501 + :type: str + """ + + self._uuid = uuid + + @property + def value(self): + """Gets the value of this SystemInsightsManagedPolicies. # noqa: E501 + + + :return: The value of this SystemInsightsManagedPolicies. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this SystemInsightsManagedPolicies. + + + :param value: The value of this SystemInsightsManagedPolicies. # noqa: E501 + :type: str + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsManagedPolicies, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsManagedPolicies): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_mounts.py b/jcapiv2/jcapiv2/models/system_insights_mounts.py index f76e8de..b79c981 100644 --- a/jcapiv2/jcapiv2/models/system_insights_mounts.py +++ b/jcapiv2/jcapiv2/models/system_insights_mounts.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsMounts(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -64,7 +61,6 @@ class SystemInsightsMounts(object): def __init__(self, blocks=None, blocks_available=None, blocks_free=None, blocks_size=None, collection_time=None, device=None, device_alias=None, flags=None, inodes=None, inodes_free=None, path=None, system_id=None, type=None): # noqa: E501 """SystemInsightsMounts - a model defined in Swagger""" # noqa: E501 - self._blocks = None self._blocks_available = None self._blocks_free = None @@ -79,7 +75,6 @@ def __init__(self, blocks=None, blocks_available=None, blocks_free=None, blocks_ self._system_id = None self._type = None self.discriminator = None - if blocks is not None: self.blocks = blocks if blocks_available is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_os_version.py b/jcapiv2/jcapiv2/models/system_insights_os_version.py index 6f0446d..bb9424f 100644 --- a/jcapiv2/jcapiv2/models/system_insights_os_version.py +++ b/jcapiv2/jcapiv2/models/system_insights_os_version.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsOsVersion(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -62,7 +59,6 @@ class SystemInsightsOsVersion(object): def __init__(self, build=None, codename=None, collection_time=None, install_date=None, major=None, minor=None, name=None, patch=None, platform=None, platform_like=None, system_id=None, version=None): # noqa: E501 """SystemInsightsOsVersion - a model defined in Swagger""" # noqa: E501 - self._build = None self._codename = None self._collection_time = None @@ -76,7 +72,6 @@ def __init__(self, build=None, codename=None, collection_time=None, install_date self._system_id = None self._version = None self.discriminator = None - if build is not None: self.build = build if codename is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_patches.py b/jcapiv2/jcapiv2/models/system_insights_patches.py index abd0a2d..bf0532e 100644 --- a/jcapiv2/jcapiv2/models/system_insights_patches.py +++ b/jcapiv2/jcapiv2/models/system_insights_patches.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsPatches(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -58,7 +55,6 @@ class SystemInsightsPatches(object): def __init__(self, caption=None, collection_time=None, csname=None, description=None, fix_comments=None, hotfix_id=None, install_date=None, installed_by=None, installed_on=None, system_id=None): # noqa: E501 """SystemInsightsPatches - a model defined in Swagger""" # noqa: E501 - self._caption = None self._collection_time = None self._csname = None @@ -70,7 +66,6 @@ def __init__(self, caption=None, collection_time=None, csname=None, description= self._installed_on = None self._system_id = None self.discriminator = None - if caption is not None: self.caption = caption if collection_time is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_programs.py b/jcapiv2/jcapiv2/models/system_insights_programs.py index d088bfb..418c074 100644 --- a/jcapiv2/jcapiv2/models/system_insights_programs.py +++ b/jcapiv2/jcapiv2/models/system_insights_programs.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsPrograms(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -60,7 +57,6 @@ class SystemInsightsPrograms(object): def __init__(self, collection_time=None, identifying_number=None, install_date=None, install_location=None, install_source=None, language=None, name=None, publisher=None, system_id=None, uninstall_string=None, version=None): # noqa: E501 """SystemInsightsPrograms - a model defined in Swagger""" # noqa: E501 - self._collection_time = None self._identifying_number = None self._install_date = None @@ -73,7 +69,6 @@ def __init__(self, collection_time=None, identifying_number=None, install_date=N self._uninstall_string = None self._version = None self.discriminator = None - if collection_time is not None: self.collection_time = collection_time if identifying_number is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_python_packages.py b/jcapiv2/jcapiv2/models/system_insights_python_packages.py new file mode 100644 index 0000000..65fa4f0 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_python_packages.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsPythonPackages(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'auther': 'str', + 'directory': 'str', + 'license': 'str', + 'name': 'str', + 'path': 'str', + 'summary': 'str', + 'system_id': 'str', + 'version': 'str' + } + + attribute_map = { + 'auther': 'auther', + 'directory': 'directory', + 'license': 'license', + 'name': 'name', + 'path': 'path', + 'summary': 'summary', + 'system_id': 'system_id', + 'version': 'version' + } + + def __init__(self, auther=None, directory=None, license=None, name=None, path=None, summary=None, system_id=None, version=None): # noqa: E501 + """SystemInsightsPythonPackages - a model defined in Swagger""" # noqa: E501 + self._auther = None + self._directory = None + self._license = None + self._name = None + self._path = None + self._summary = None + self._system_id = None + self._version = None + self.discriminator = None + if auther is not None: + self.auther = auther + if directory is not None: + self.directory = directory + if license is not None: + self.license = license + if name is not None: + self.name = name + if path is not None: + self.path = path + if summary is not None: + self.summary = summary + if system_id is not None: + self.system_id = system_id + if version is not None: + self.version = version + + @property + def auther(self): + """Gets the auther of this SystemInsightsPythonPackages. # noqa: E501 + + + :return: The auther of this SystemInsightsPythonPackages. # noqa: E501 + :rtype: str + """ + return self._auther + + @auther.setter + def auther(self, auther): + """Sets the auther of this SystemInsightsPythonPackages. + + + :param auther: The auther of this SystemInsightsPythonPackages. # noqa: E501 + :type: str + """ + + self._auther = auther + + @property + def directory(self): + """Gets the directory of this SystemInsightsPythonPackages. # noqa: E501 + + + :return: The directory of this SystemInsightsPythonPackages. # noqa: E501 + :rtype: str + """ + return self._directory + + @directory.setter + def directory(self, directory): + """Sets the directory of this SystemInsightsPythonPackages. + + + :param directory: The directory of this SystemInsightsPythonPackages. # noqa: E501 + :type: str + """ + + self._directory = directory + + @property + def license(self): + """Gets the license of this SystemInsightsPythonPackages. # noqa: E501 + + + :return: The license of this SystemInsightsPythonPackages. # noqa: E501 + :rtype: str + """ + return self._license + + @license.setter + def license(self, license): + """Sets the license of this SystemInsightsPythonPackages. + + + :param license: The license of this SystemInsightsPythonPackages. # noqa: E501 + :type: str + """ + + self._license = license + + @property + def name(self): + """Gets the name of this SystemInsightsPythonPackages. # noqa: E501 + + + :return: The name of this SystemInsightsPythonPackages. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SystemInsightsPythonPackages. + + + :param name: The name of this SystemInsightsPythonPackages. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def path(self): + """Gets the path of this SystemInsightsPythonPackages. # noqa: E501 + + + :return: The path of this SystemInsightsPythonPackages. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this SystemInsightsPythonPackages. + + + :param path: The path of this SystemInsightsPythonPackages. # noqa: E501 + :type: str + """ + + self._path = path + + @property + def summary(self): + """Gets the summary of this SystemInsightsPythonPackages. # noqa: E501 + + + :return: The summary of this SystemInsightsPythonPackages. # noqa: E501 + :rtype: str + """ + return self._summary + + @summary.setter + def summary(self, summary): + """Sets the summary of this SystemInsightsPythonPackages. + + + :param summary: The summary of this SystemInsightsPythonPackages. # noqa: E501 + :type: str + """ + + self._summary = summary + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsPythonPackages. # noqa: E501 + + + :return: The system_id of this SystemInsightsPythonPackages. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsPythonPackages. + + + :param system_id: The system_id of this SystemInsightsPythonPackages. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def version(self): + """Gets the version of this SystemInsightsPythonPackages. # noqa: E501 + + + :return: The version of this SystemInsightsPythonPackages. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this SystemInsightsPythonPackages. + + + :param version: The version of this SystemInsightsPythonPackages. # noqa: E501 + :type: str + """ + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsPythonPackages, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsPythonPackages): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_safari_extensions.py b/jcapiv2/jcapiv2/models/system_insights_safari_extensions.py index 94a9f50..2e03e16 100644 --- a/jcapiv2/jcapiv2/models/system_insights_safari_extensions.py +++ b/jcapiv2/jcapiv2/models/system_insights_safari_extensions.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsSafariExtensions(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -62,7 +59,6 @@ class SystemInsightsSafariExtensions(object): def __init__(self, author=None, collection_time=None, description=None, developer_id=None, identifier=None, name=None, path=None, sdk=None, system_id=None, uid=None, update_url=None, version=None): # noqa: E501 """SystemInsightsSafariExtensions - a model defined in Swagger""" # noqa: E501 - self._author = None self._collection_time = None self._description = None @@ -76,7 +72,6 @@ def __init__(self, author=None, collection_time=None, description=None, develope self._update_url = None self._version = None self.discriminator = None - if author is not None: self.author = author if collection_time is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_scheduled_tasks.py b/jcapiv2/jcapiv2/models/system_insights_scheduled_tasks.py new file mode 100644 index 0000000..998a02e --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_scheduled_tasks.py @@ -0,0 +1,370 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsScheduledTasks(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'action': 'str', + 'enabled': 'int', + 'hidden': 'int', + 'last_run_code': 'str', + 'last_run_message': 'str', + 'last_run_time': 'str', + 'name': 'str', + 'next_run_time': 'str', + 'path': 'str', + 'state': 'str', + 'system_id': 'str' + } + + attribute_map = { + 'action': 'action', + 'enabled': 'enabled', + 'hidden': 'hidden', + 'last_run_code': 'last_run_code', + 'last_run_message': 'last_run_message', + 'last_run_time': 'last_run_time', + 'name': 'name', + 'next_run_time': 'next_run_time', + 'path': 'path', + 'state': 'state', + 'system_id': 'system_id' + } + + def __init__(self, action=None, enabled=None, hidden=None, last_run_code=None, last_run_message=None, last_run_time=None, name=None, next_run_time=None, path=None, state=None, system_id=None): # noqa: E501 + """SystemInsightsScheduledTasks - a model defined in Swagger""" # noqa: E501 + self._action = None + self._enabled = None + self._hidden = None + self._last_run_code = None + self._last_run_message = None + self._last_run_time = None + self._name = None + self._next_run_time = None + self._path = None + self._state = None + self._system_id = None + self.discriminator = None + if action is not None: + self.action = action + if enabled is not None: + self.enabled = enabled + if hidden is not None: + self.hidden = hidden + if last_run_code is not None: + self.last_run_code = last_run_code + if last_run_message is not None: + self.last_run_message = last_run_message + if last_run_time is not None: + self.last_run_time = last_run_time + if name is not None: + self.name = name + if next_run_time is not None: + self.next_run_time = next_run_time + if path is not None: + self.path = path + if state is not None: + self.state = state + if system_id is not None: + self.system_id = system_id + + @property + def action(self): + """Gets the action of this SystemInsightsScheduledTasks. # noqa: E501 + + + :return: The action of this SystemInsightsScheduledTasks. # noqa: E501 + :rtype: str + """ + return self._action + + @action.setter + def action(self, action): + """Sets the action of this SystemInsightsScheduledTasks. + + + :param action: The action of this SystemInsightsScheduledTasks. # noqa: E501 + :type: str + """ + + self._action = action + + @property + def enabled(self): + """Gets the enabled of this SystemInsightsScheduledTasks. # noqa: E501 + + + :return: The enabled of this SystemInsightsScheduledTasks. # noqa: E501 + :rtype: int + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled): + """Sets the enabled of this SystemInsightsScheduledTasks. + + + :param enabled: The enabled of this SystemInsightsScheduledTasks. # noqa: E501 + :type: int + """ + + self._enabled = enabled + + @property + def hidden(self): + """Gets the hidden of this SystemInsightsScheduledTasks. # noqa: E501 + + + :return: The hidden of this SystemInsightsScheduledTasks. # noqa: E501 + :rtype: int + """ + return self._hidden + + @hidden.setter + def hidden(self, hidden): + """Sets the hidden of this SystemInsightsScheduledTasks. + + + :param hidden: The hidden of this SystemInsightsScheduledTasks. # noqa: E501 + :type: int + """ + + self._hidden = hidden + + @property + def last_run_code(self): + """Gets the last_run_code of this SystemInsightsScheduledTasks. # noqa: E501 + + + :return: The last_run_code of this SystemInsightsScheduledTasks. # noqa: E501 + :rtype: str + """ + return self._last_run_code + + @last_run_code.setter + def last_run_code(self, last_run_code): + """Sets the last_run_code of this SystemInsightsScheduledTasks. + + + :param last_run_code: The last_run_code of this SystemInsightsScheduledTasks. # noqa: E501 + :type: str + """ + + self._last_run_code = last_run_code + + @property + def last_run_message(self): + """Gets the last_run_message of this SystemInsightsScheduledTasks. # noqa: E501 + + + :return: The last_run_message of this SystemInsightsScheduledTasks. # noqa: E501 + :rtype: str + """ + return self._last_run_message + + @last_run_message.setter + def last_run_message(self, last_run_message): + """Sets the last_run_message of this SystemInsightsScheduledTasks. + + + :param last_run_message: The last_run_message of this SystemInsightsScheduledTasks. # noqa: E501 + :type: str + """ + + self._last_run_message = last_run_message + + @property + def last_run_time(self): + """Gets the last_run_time of this SystemInsightsScheduledTasks. # noqa: E501 + + + :return: The last_run_time of this SystemInsightsScheduledTasks. # noqa: E501 + :rtype: str + """ + return self._last_run_time + + @last_run_time.setter + def last_run_time(self, last_run_time): + """Sets the last_run_time of this SystemInsightsScheduledTasks. + + + :param last_run_time: The last_run_time of this SystemInsightsScheduledTasks. # noqa: E501 + :type: str + """ + + self._last_run_time = last_run_time + + @property + def name(self): + """Gets the name of this SystemInsightsScheduledTasks. # noqa: E501 + + + :return: The name of this SystemInsightsScheduledTasks. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SystemInsightsScheduledTasks. + + + :param name: The name of this SystemInsightsScheduledTasks. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def next_run_time(self): + """Gets the next_run_time of this SystemInsightsScheduledTasks. # noqa: E501 + + + :return: The next_run_time of this SystemInsightsScheduledTasks. # noqa: E501 + :rtype: str + """ + return self._next_run_time + + @next_run_time.setter + def next_run_time(self, next_run_time): + """Sets the next_run_time of this SystemInsightsScheduledTasks. + + + :param next_run_time: The next_run_time of this SystemInsightsScheduledTasks. # noqa: E501 + :type: str + """ + + self._next_run_time = next_run_time + + @property + def path(self): + """Gets the path of this SystemInsightsScheduledTasks. # noqa: E501 + + + :return: The path of this SystemInsightsScheduledTasks. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this SystemInsightsScheduledTasks. + + + :param path: The path of this SystemInsightsScheduledTasks. # noqa: E501 + :type: str + """ + + self._path = path + + @property + def state(self): + """Gets the state of this SystemInsightsScheduledTasks. # noqa: E501 + + + :return: The state of this SystemInsightsScheduledTasks. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this SystemInsightsScheduledTasks. + + + :param state: The state of this SystemInsightsScheduledTasks. # noqa: E501 + :type: str + """ + + self._state = state + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsScheduledTasks. # noqa: E501 + + + :return: The system_id of this SystemInsightsScheduledTasks. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsScheduledTasks. + + + :param system_id: The system_id of this SystemInsightsScheduledTasks. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsScheduledTasks, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsScheduledTasks): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_secureboot.py b/jcapiv2/jcapiv2/models/system_insights_secureboot.py new file mode 100644 index 0000000..8df0bf1 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_secureboot.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsSecureboot(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'collection_time': 'str', + 'secure_boot': 'float', + 'setup_mode': 'float', + 'system_id': 'str' + } + + attribute_map = { + 'collection_time': 'collection_time', + 'secure_boot': 'secure_boot', + 'setup_mode': 'setup_mode', + 'system_id': 'system_id' + } + + def __init__(self, collection_time=None, secure_boot=None, setup_mode=None, system_id=None): # noqa: E501 + """SystemInsightsSecureboot - a model defined in Swagger""" # noqa: E501 + self._collection_time = None + self._secure_boot = None + self._setup_mode = None + self._system_id = None + self.discriminator = None + if collection_time is not None: + self.collection_time = collection_time + if secure_boot is not None: + self.secure_boot = secure_boot + if setup_mode is not None: + self.setup_mode = setup_mode + if system_id is not None: + self.system_id = system_id + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsSecureboot. # noqa: E501 + + + :return: The collection_time of this SystemInsightsSecureboot. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsSecureboot. + + + :param collection_time: The collection_time of this SystemInsightsSecureboot. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def secure_boot(self): + """Gets the secure_boot of this SystemInsightsSecureboot. # noqa: E501 + + + :return: The secure_boot of this SystemInsightsSecureboot. # noqa: E501 + :rtype: float + """ + return self._secure_boot + + @secure_boot.setter + def secure_boot(self, secure_boot): + """Sets the secure_boot of this SystemInsightsSecureboot. + + + :param secure_boot: The secure_boot of this SystemInsightsSecureboot. # noqa: E501 + :type: float + """ + + self._secure_boot = secure_boot + + @property + def setup_mode(self): + """Gets the setup_mode of this SystemInsightsSecureboot. # noqa: E501 + + + :return: The setup_mode of this SystemInsightsSecureboot. # noqa: E501 + :rtype: float + """ + return self._setup_mode + + @setup_mode.setter + def setup_mode(self, setup_mode): + """Sets the setup_mode of this SystemInsightsSecureboot. + + + :param setup_mode: The setup_mode of this SystemInsightsSecureboot. # noqa: E501 + :type: float + """ + + self._setup_mode = setup_mode + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsSecureboot. # noqa: E501 + + + :return: The system_id of this SystemInsightsSecureboot. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsSecureboot. + + + :param system_id: The system_id of this SystemInsightsSecureboot. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsSecureboot, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsSecureboot): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_services.py b/jcapiv2/jcapiv2/models/system_insights_services.py new file mode 100644 index 0000000..375bdf4 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_services.py @@ -0,0 +1,422 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsServices(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'description': 'str', + 'display_name': 'str', + 'module_path': 'str', + 'name': 'str', + 'path': 'str', + 'pid': 'int', + 'service_exit_code': 'int', + 'service_type': 'str', + 'start_type': 'str', + 'status': 'str', + 'system_id': 'str', + 'user_account': 'str', + 'win32_exit_code': 'int' + } + + attribute_map = { + 'description': 'description', + 'display_name': 'display_name', + 'module_path': 'module_path', + 'name': 'name', + 'path': 'path', + 'pid': 'pid', + 'service_exit_code': 'service_exit_code', + 'service_type': 'service_type', + 'start_type': 'start_type', + 'status': 'status', + 'system_id': 'system_id', + 'user_account': 'user_account', + 'win32_exit_code': 'win32_exit_code' + } + + def __init__(self, description=None, display_name=None, module_path=None, name=None, path=None, pid=None, service_exit_code=None, service_type=None, start_type=None, status=None, system_id=None, user_account=None, win32_exit_code=None): # noqa: E501 + """SystemInsightsServices - a model defined in Swagger""" # noqa: E501 + self._description = None + self._display_name = None + self._module_path = None + self._name = None + self._path = None + self._pid = None + self._service_exit_code = None + self._service_type = None + self._start_type = None + self._status = None + self._system_id = None + self._user_account = None + self._win32_exit_code = None + self.discriminator = None + if description is not None: + self.description = description + if display_name is not None: + self.display_name = display_name + if module_path is not None: + self.module_path = module_path + if name is not None: + self.name = name + if path is not None: + self.path = path + if pid is not None: + self.pid = pid + if service_exit_code is not None: + self.service_exit_code = service_exit_code + if service_type is not None: + self.service_type = service_type + if start_type is not None: + self.start_type = start_type + if status is not None: + self.status = status + if system_id is not None: + self.system_id = system_id + if user_account is not None: + self.user_account = user_account + if win32_exit_code is not None: + self.win32_exit_code = win32_exit_code + + @property + def description(self): + """Gets the description of this SystemInsightsServices. # noqa: E501 + + + :return: The description of this SystemInsightsServices. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this SystemInsightsServices. + + + :param description: The description of this SystemInsightsServices. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def display_name(self): + """Gets the display_name of this SystemInsightsServices. # noqa: E501 + + + :return: The display_name of this SystemInsightsServices. # noqa: E501 + :rtype: str + """ + return self._display_name + + @display_name.setter + def display_name(self, display_name): + """Sets the display_name of this SystemInsightsServices. + + + :param display_name: The display_name of this SystemInsightsServices. # noqa: E501 + :type: str + """ + + self._display_name = display_name + + @property + def module_path(self): + """Gets the module_path of this SystemInsightsServices. # noqa: E501 + + + :return: The module_path of this SystemInsightsServices. # noqa: E501 + :rtype: str + """ + return self._module_path + + @module_path.setter + def module_path(self, module_path): + """Sets the module_path of this SystemInsightsServices. + + + :param module_path: The module_path of this SystemInsightsServices. # noqa: E501 + :type: str + """ + + self._module_path = module_path + + @property + def name(self): + """Gets the name of this SystemInsightsServices. # noqa: E501 + + + :return: The name of this SystemInsightsServices. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SystemInsightsServices. + + + :param name: The name of this SystemInsightsServices. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def path(self): + """Gets the path of this SystemInsightsServices. # noqa: E501 + + + :return: The path of this SystemInsightsServices. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this SystemInsightsServices. + + + :param path: The path of this SystemInsightsServices. # noqa: E501 + :type: str + """ + + self._path = path + + @property + def pid(self): + """Gets the pid of this SystemInsightsServices. # noqa: E501 + + + :return: The pid of this SystemInsightsServices. # noqa: E501 + :rtype: int + """ + return self._pid + + @pid.setter + def pid(self, pid): + """Sets the pid of this SystemInsightsServices. + + + :param pid: The pid of this SystemInsightsServices. # noqa: E501 + :type: int + """ + + self._pid = pid + + @property + def service_exit_code(self): + """Gets the service_exit_code of this SystemInsightsServices. # noqa: E501 + + + :return: The service_exit_code of this SystemInsightsServices. # noqa: E501 + :rtype: int + """ + return self._service_exit_code + + @service_exit_code.setter + def service_exit_code(self, service_exit_code): + """Sets the service_exit_code of this SystemInsightsServices. + + + :param service_exit_code: The service_exit_code of this SystemInsightsServices. # noqa: E501 + :type: int + """ + + self._service_exit_code = service_exit_code + + @property + def service_type(self): + """Gets the service_type of this SystemInsightsServices. # noqa: E501 + + + :return: The service_type of this SystemInsightsServices. # noqa: E501 + :rtype: str + """ + return self._service_type + + @service_type.setter + def service_type(self, service_type): + """Sets the service_type of this SystemInsightsServices. + + + :param service_type: The service_type of this SystemInsightsServices. # noqa: E501 + :type: str + """ + + self._service_type = service_type + + @property + def start_type(self): + """Gets the start_type of this SystemInsightsServices. # noqa: E501 + + + :return: The start_type of this SystemInsightsServices. # noqa: E501 + :rtype: str + """ + return self._start_type + + @start_type.setter + def start_type(self, start_type): + """Sets the start_type of this SystemInsightsServices. + + + :param start_type: The start_type of this SystemInsightsServices. # noqa: E501 + :type: str + """ + + self._start_type = start_type + + @property + def status(self): + """Gets the status of this SystemInsightsServices. # noqa: E501 + + + :return: The status of this SystemInsightsServices. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this SystemInsightsServices. + + + :param status: The status of this SystemInsightsServices. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsServices. # noqa: E501 + + + :return: The system_id of this SystemInsightsServices. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsServices. + + + :param system_id: The system_id of this SystemInsightsServices. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def user_account(self): + """Gets the user_account of this SystemInsightsServices. # noqa: E501 + + + :return: The user_account of this SystemInsightsServices. # noqa: E501 + :rtype: str + """ + return self._user_account + + @user_account.setter + def user_account(self, user_account): + """Sets the user_account of this SystemInsightsServices. + + + :param user_account: The user_account of this SystemInsightsServices. # noqa: E501 + :type: str + """ + + self._user_account = user_account + + @property + def win32_exit_code(self): + """Gets the win32_exit_code of this SystemInsightsServices. # noqa: E501 + + + :return: The win32_exit_code of this SystemInsightsServices. # noqa: E501 + :rtype: int + """ + return self._win32_exit_code + + @win32_exit_code.setter + def win32_exit_code(self, win32_exit_code): + """Sets the win32_exit_code of this SystemInsightsServices. + + + :param win32_exit_code: The win32_exit_code of this SystemInsightsServices. # noqa: E501 + :type: int + """ + + self._win32_exit_code = win32_exit_code + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsServices, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsServices): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_shadow.py b/jcapiv2/jcapiv2/models/system_insights_shadow.py new file mode 100644 index 0000000..c8c1204 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_shadow.py @@ -0,0 +1,396 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsShadow(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'collection_time': 'str', + 'expire': 'str', + 'flag': 'str', + 'hash_alg': 'str', + 'inactive': 'str', + 'last_change': 'str', + 'max': 'str', + 'min': 'str', + 'password_status': 'str', + 'system_id': 'str', + 'username': 'str', + 'warning': 'str' + } + + attribute_map = { + 'collection_time': 'collection_time', + 'expire': 'expire', + 'flag': 'flag', + 'hash_alg': 'hash_alg', + 'inactive': 'inactive', + 'last_change': 'last_change', + 'max': 'max', + 'min': 'min', + 'password_status': 'password_status', + 'system_id': 'system_id', + 'username': 'username', + 'warning': 'warning' + } + + def __init__(self, collection_time=None, expire=None, flag=None, hash_alg=None, inactive=None, last_change=None, max=None, min=None, password_status=None, system_id=None, username=None, warning=None): # noqa: E501 + """SystemInsightsShadow - a model defined in Swagger""" # noqa: E501 + self._collection_time = None + self._expire = None + self._flag = None + self._hash_alg = None + self._inactive = None + self._last_change = None + self._max = None + self._min = None + self._password_status = None + self._system_id = None + self._username = None + self._warning = None + self.discriminator = None + if collection_time is not None: + self.collection_time = collection_time + if expire is not None: + self.expire = expire + if flag is not None: + self.flag = flag + if hash_alg is not None: + self.hash_alg = hash_alg + if inactive is not None: + self.inactive = inactive + if last_change is not None: + self.last_change = last_change + if max is not None: + self.max = max + if min is not None: + self.min = min + if password_status is not None: + self.password_status = password_status + if system_id is not None: + self.system_id = system_id + if username is not None: + self.username = username + if warning is not None: + self.warning = warning + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsShadow. # noqa: E501 + + + :return: The collection_time of this SystemInsightsShadow. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsShadow. + + + :param collection_time: The collection_time of this SystemInsightsShadow. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def expire(self): + """Gets the expire of this SystemInsightsShadow. # noqa: E501 + + + :return: The expire of this SystemInsightsShadow. # noqa: E501 + :rtype: str + """ + return self._expire + + @expire.setter + def expire(self, expire): + """Sets the expire of this SystemInsightsShadow. + + + :param expire: The expire of this SystemInsightsShadow. # noqa: E501 + :type: str + """ + + self._expire = expire + + @property + def flag(self): + """Gets the flag of this SystemInsightsShadow. # noqa: E501 + + + :return: The flag of this SystemInsightsShadow. # noqa: E501 + :rtype: str + """ + return self._flag + + @flag.setter + def flag(self, flag): + """Sets the flag of this SystemInsightsShadow. + + + :param flag: The flag of this SystemInsightsShadow. # noqa: E501 + :type: str + """ + + self._flag = flag + + @property + def hash_alg(self): + """Gets the hash_alg of this SystemInsightsShadow. # noqa: E501 + + + :return: The hash_alg of this SystemInsightsShadow. # noqa: E501 + :rtype: str + """ + return self._hash_alg + + @hash_alg.setter + def hash_alg(self, hash_alg): + """Sets the hash_alg of this SystemInsightsShadow. + + + :param hash_alg: The hash_alg of this SystemInsightsShadow. # noqa: E501 + :type: str + """ + + self._hash_alg = hash_alg + + @property + def inactive(self): + """Gets the inactive of this SystemInsightsShadow. # noqa: E501 + + + :return: The inactive of this SystemInsightsShadow. # noqa: E501 + :rtype: str + """ + return self._inactive + + @inactive.setter + def inactive(self, inactive): + """Sets the inactive of this SystemInsightsShadow. + + + :param inactive: The inactive of this SystemInsightsShadow. # noqa: E501 + :type: str + """ + + self._inactive = inactive + + @property + def last_change(self): + """Gets the last_change of this SystemInsightsShadow. # noqa: E501 + + + :return: The last_change of this SystemInsightsShadow. # noqa: E501 + :rtype: str + """ + return self._last_change + + @last_change.setter + def last_change(self, last_change): + """Sets the last_change of this SystemInsightsShadow. + + + :param last_change: The last_change of this SystemInsightsShadow. # noqa: E501 + :type: str + """ + + self._last_change = last_change + + @property + def max(self): + """Gets the max of this SystemInsightsShadow. # noqa: E501 + + + :return: The max of this SystemInsightsShadow. # noqa: E501 + :rtype: str + """ + return self._max + + @max.setter + def max(self, max): + """Sets the max of this SystemInsightsShadow. + + + :param max: The max of this SystemInsightsShadow. # noqa: E501 + :type: str + """ + + self._max = max + + @property + def min(self): + """Gets the min of this SystemInsightsShadow. # noqa: E501 + + + :return: The min of this SystemInsightsShadow. # noqa: E501 + :rtype: str + """ + return self._min + + @min.setter + def min(self, min): + """Sets the min of this SystemInsightsShadow. + + + :param min: The min of this SystemInsightsShadow. # noqa: E501 + :type: str + """ + + self._min = min + + @property + def password_status(self): + """Gets the password_status of this SystemInsightsShadow. # noqa: E501 + + + :return: The password_status of this SystemInsightsShadow. # noqa: E501 + :rtype: str + """ + return self._password_status + + @password_status.setter + def password_status(self, password_status): + """Sets the password_status of this SystemInsightsShadow. + + + :param password_status: The password_status of this SystemInsightsShadow. # noqa: E501 + :type: str + """ + + self._password_status = password_status + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsShadow. # noqa: E501 + + + :return: The system_id of this SystemInsightsShadow. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsShadow. + + + :param system_id: The system_id of this SystemInsightsShadow. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def username(self): + """Gets the username of this SystemInsightsShadow. # noqa: E501 + + + :return: The username of this SystemInsightsShadow. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this SystemInsightsShadow. + + + :param username: The username of this SystemInsightsShadow. # noqa: E501 + :type: str + """ + + self._username = username + + @property + def warning(self): + """Gets the warning of this SystemInsightsShadow. # noqa: E501 + + + :return: The warning of this SystemInsightsShadow. # noqa: E501 + :rtype: str + """ + return self._warning + + @warning.setter + def warning(self, warning): + """Sets the warning of this SystemInsightsShadow. + + + :param warning: The warning of this SystemInsightsShadow. # noqa: E501 + :type: str + """ + + self._warning = warning + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsShadow, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsShadow): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_shared_folders.py b/jcapiv2/jcapiv2/models/system_insights_shared_folders.py new file mode 100644 index 0000000..c072069 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_shared_folders.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsSharedFolders(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'collection_time': 'str', + 'name': 'str', + 'path': 'str', + 'system_id': 'str' + } + + attribute_map = { + 'collection_time': 'collection_time', + 'name': 'name', + 'path': 'path', + 'system_id': 'system_id' + } + + def __init__(self, collection_time=None, name=None, path=None, system_id=None): # noqa: E501 + """SystemInsightsSharedFolders - a model defined in Swagger""" # noqa: E501 + self._collection_time = None + self._name = None + self._path = None + self._system_id = None + self.discriminator = None + if collection_time is not None: + self.collection_time = collection_time + if name is not None: + self.name = name + if path is not None: + self.path = path + if system_id is not None: + self.system_id = system_id + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsSharedFolders. # noqa: E501 + + + :return: The collection_time of this SystemInsightsSharedFolders. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsSharedFolders. + + + :param collection_time: The collection_time of this SystemInsightsSharedFolders. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def name(self): + """Gets the name of this SystemInsightsSharedFolders. # noqa: E501 + + + :return: The name of this SystemInsightsSharedFolders. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SystemInsightsSharedFolders. + + + :param name: The name of this SystemInsightsSharedFolders. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def path(self): + """Gets the path of this SystemInsightsSharedFolders. # noqa: E501 + + + :return: The path of this SystemInsightsSharedFolders. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this SystemInsightsSharedFolders. + + + :param path: The path of this SystemInsightsSharedFolders. # noqa: E501 + :type: str + """ + + self._path = path + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsSharedFolders. # noqa: E501 + + + :return: The system_id of this SystemInsightsSharedFolders. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsSharedFolders. + + + :param system_id: The system_id of this SystemInsightsSharedFolders. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsSharedFolders, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsSharedFolders): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_shared_resources.py b/jcapiv2/jcapiv2/models/system_insights_shared_resources.py new file mode 100644 index 0000000..2621847 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_shared_resources.py @@ -0,0 +1,344 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsSharedResources(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'allow_maximum': 'int', + 'collection_time': 'str', + 'description': 'str', + 'install_date': 'str', + 'maximum_allowed': 'int', + 'name': 'str', + 'path': 'str', + 'status': 'str', + 'system_id': 'str', + 'type': 'int' + } + + attribute_map = { + 'allow_maximum': 'allow_maximum', + 'collection_time': 'collection_time', + 'description': 'description', + 'install_date': 'install_date', + 'maximum_allowed': 'maximum_allowed', + 'name': 'name', + 'path': 'path', + 'status': 'status', + 'system_id': 'system_id', + 'type': 'type' + } + + def __init__(self, allow_maximum=None, collection_time=None, description=None, install_date=None, maximum_allowed=None, name=None, path=None, status=None, system_id=None, type=None): # noqa: E501 + """SystemInsightsSharedResources - a model defined in Swagger""" # noqa: E501 + self._allow_maximum = None + self._collection_time = None + self._description = None + self._install_date = None + self._maximum_allowed = None + self._name = None + self._path = None + self._status = None + self._system_id = None + self._type = None + self.discriminator = None + if allow_maximum is not None: + self.allow_maximum = allow_maximum + if collection_time is not None: + self.collection_time = collection_time + if description is not None: + self.description = description + if install_date is not None: + self.install_date = install_date + if maximum_allowed is not None: + self.maximum_allowed = maximum_allowed + if name is not None: + self.name = name + if path is not None: + self.path = path + if status is not None: + self.status = status + if system_id is not None: + self.system_id = system_id + if type is not None: + self.type = type + + @property + def allow_maximum(self): + """Gets the allow_maximum of this SystemInsightsSharedResources. # noqa: E501 + + + :return: The allow_maximum of this SystemInsightsSharedResources. # noqa: E501 + :rtype: int + """ + return self._allow_maximum + + @allow_maximum.setter + def allow_maximum(self, allow_maximum): + """Sets the allow_maximum of this SystemInsightsSharedResources. + + + :param allow_maximum: The allow_maximum of this SystemInsightsSharedResources. # noqa: E501 + :type: int + """ + + self._allow_maximum = allow_maximum + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsSharedResources. # noqa: E501 + + + :return: The collection_time of this SystemInsightsSharedResources. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsSharedResources. + + + :param collection_time: The collection_time of this SystemInsightsSharedResources. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def description(self): + """Gets the description of this SystemInsightsSharedResources. # noqa: E501 + + + :return: The description of this SystemInsightsSharedResources. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this SystemInsightsSharedResources. + + + :param description: The description of this SystemInsightsSharedResources. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def install_date(self): + """Gets the install_date of this SystemInsightsSharedResources. # noqa: E501 + + + :return: The install_date of this SystemInsightsSharedResources. # noqa: E501 + :rtype: str + """ + return self._install_date + + @install_date.setter + def install_date(self, install_date): + """Sets the install_date of this SystemInsightsSharedResources. + + + :param install_date: The install_date of this SystemInsightsSharedResources. # noqa: E501 + :type: str + """ + + self._install_date = install_date + + @property + def maximum_allowed(self): + """Gets the maximum_allowed of this SystemInsightsSharedResources. # noqa: E501 + + + :return: The maximum_allowed of this SystemInsightsSharedResources. # noqa: E501 + :rtype: int + """ + return self._maximum_allowed + + @maximum_allowed.setter + def maximum_allowed(self, maximum_allowed): + """Sets the maximum_allowed of this SystemInsightsSharedResources. + + + :param maximum_allowed: The maximum_allowed of this SystemInsightsSharedResources. # noqa: E501 + :type: int + """ + + self._maximum_allowed = maximum_allowed + + @property + def name(self): + """Gets the name of this SystemInsightsSharedResources. # noqa: E501 + + + :return: The name of this SystemInsightsSharedResources. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SystemInsightsSharedResources. + + + :param name: The name of this SystemInsightsSharedResources. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def path(self): + """Gets the path of this SystemInsightsSharedResources. # noqa: E501 + + + :return: The path of this SystemInsightsSharedResources. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this SystemInsightsSharedResources. + + + :param path: The path of this SystemInsightsSharedResources. # noqa: E501 + :type: str + """ + + self._path = path + + @property + def status(self): + """Gets the status of this SystemInsightsSharedResources. # noqa: E501 + + + :return: The status of this SystemInsightsSharedResources. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this SystemInsightsSharedResources. + + + :param status: The status of this SystemInsightsSharedResources. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsSharedResources. # noqa: E501 + + + :return: The system_id of this SystemInsightsSharedResources. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsSharedResources. + + + :param system_id: The system_id of this SystemInsightsSharedResources. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def type(self): + """Gets the type of this SystemInsightsSharedResources. # noqa: E501 + + + :return: The type of this SystemInsightsSharedResources. # noqa: E501 + :rtype: int + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SystemInsightsSharedResources. + + + :param type: The type of this SystemInsightsSharedResources. # noqa: E501 + :type: int + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsSharedResources, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsSharedResources): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_sharing_preferences.py b/jcapiv2/jcapiv2/models/system_insights_sharing_preferences.py new file mode 100644 index 0000000..a39a401 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_sharing_preferences.py @@ -0,0 +1,396 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsSharingPreferences(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'bluetooth_sharing': 'int', + 'collection_time': 'str', + 'content_caching': 'int', + 'disc_sharing': 'int', + 'file_sharing': 'int', + 'internet_sharing': 'int', + 'printer_sharing': 'int', + 'remote_apple_events': 'int', + 'remote_login': 'int', + 'remote_management': 'int', + 'screen_sharing': 'int', + 'system_id': 'str' + } + + attribute_map = { + 'bluetooth_sharing': 'bluetooth_sharing', + 'collection_time': 'collection_time', + 'content_caching': 'content_caching', + 'disc_sharing': 'disc_sharing', + 'file_sharing': 'file_sharing', + 'internet_sharing': 'internet_sharing', + 'printer_sharing': 'printer_sharing', + 'remote_apple_events': 'remote_apple_events', + 'remote_login': 'remote_login', + 'remote_management': 'remote_management', + 'screen_sharing': 'screen_sharing', + 'system_id': 'system_id' + } + + def __init__(self, bluetooth_sharing=None, collection_time=None, content_caching=None, disc_sharing=None, file_sharing=None, internet_sharing=None, printer_sharing=None, remote_apple_events=None, remote_login=None, remote_management=None, screen_sharing=None, system_id=None): # noqa: E501 + """SystemInsightsSharingPreferences - a model defined in Swagger""" # noqa: E501 + self._bluetooth_sharing = None + self._collection_time = None + self._content_caching = None + self._disc_sharing = None + self._file_sharing = None + self._internet_sharing = None + self._printer_sharing = None + self._remote_apple_events = None + self._remote_login = None + self._remote_management = None + self._screen_sharing = None + self._system_id = None + self.discriminator = None + if bluetooth_sharing is not None: + self.bluetooth_sharing = bluetooth_sharing + if collection_time is not None: + self.collection_time = collection_time + if content_caching is not None: + self.content_caching = content_caching + if disc_sharing is not None: + self.disc_sharing = disc_sharing + if file_sharing is not None: + self.file_sharing = file_sharing + if internet_sharing is not None: + self.internet_sharing = internet_sharing + if printer_sharing is not None: + self.printer_sharing = printer_sharing + if remote_apple_events is not None: + self.remote_apple_events = remote_apple_events + if remote_login is not None: + self.remote_login = remote_login + if remote_management is not None: + self.remote_management = remote_management + if screen_sharing is not None: + self.screen_sharing = screen_sharing + if system_id is not None: + self.system_id = system_id + + @property + def bluetooth_sharing(self): + """Gets the bluetooth_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + + + :return: The bluetooth_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + :rtype: int + """ + return self._bluetooth_sharing + + @bluetooth_sharing.setter + def bluetooth_sharing(self, bluetooth_sharing): + """Sets the bluetooth_sharing of this SystemInsightsSharingPreferences. + + + :param bluetooth_sharing: The bluetooth_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + :type: int + """ + + self._bluetooth_sharing = bluetooth_sharing + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsSharingPreferences. # noqa: E501 + + + :return: The collection_time of this SystemInsightsSharingPreferences. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsSharingPreferences. + + + :param collection_time: The collection_time of this SystemInsightsSharingPreferences. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def content_caching(self): + """Gets the content_caching of this SystemInsightsSharingPreferences. # noqa: E501 + + + :return: The content_caching of this SystemInsightsSharingPreferences. # noqa: E501 + :rtype: int + """ + return self._content_caching + + @content_caching.setter + def content_caching(self, content_caching): + """Sets the content_caching of this SystemInsightsSharingPreferences. + + + :param content_caching: The content_caching of this SystemInsightsSharingPreferences. # noqa: E501 + :type: int + """ + + self._content_caching = content_caching + + @property + def disc_sharing(self): + """Gets the disc_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + + + :return: The disc_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + :rtype: int + """ + return self._disc_sharing + + @disc_sharing.setter + def disc_sharing(self, disc_sharing): + """Sets the disc_sharing of this SystemInsightsSharingPreferences. + + + :param disc_sharing: The disc_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + :type: int + """ + + self._disc_sharing = disc_sharing + + @property + def file_sharing(self): + """Gets the file_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + + + :return: The file_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + :rtype: int + """ + return self._file_sharing + + @file_sharing.setter + def file_sharing(self, file_sharing): + """Sets the file_sharing of this SystemInsightsSharingPreferences. + + + :param file_sharing: The file_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + :type: int + """ + + self._file_sharing = file_sharing + + @property + def internet_sharing(self): + """Gets the internet_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + + + :return: The internet_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + :rtype: int + """ + return self._internet_sharing + + @internet_sharing.setter + def internet_sharing(self, internet_sharing): + """Sets the internet_sharing of this SystemInsightsSharingPreferences. + + + :param internet_sharing: The internet_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + :type: int + """ + + self._internet_sharing = internet_sharing + + @property + def printer_sharing(self): + """Gets the printer_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + + + :return: The printer_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + :rtype: int + """ + return self._printer_sharing + + @printer_sharing.setter + def printer_sharing(self, printer_sharing): + """Sets the printer_sharing of this SystemInsightsSharingPreferences. + + + :param printer_sharing: The printer_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + :type: int + """ + + self._printer_sharing = printer_sharing + + @property + def remote_apple_events(self): + """Gets the remote_apple_events of this SystemInsightsSharingPreferences. # noqa: E501 + + + :return: The remote_apple_events of this SystemInsightsSharingPreferences. # noqa: E501 + :rtype: int + """ + return self._remote_apple_events + + @remote_apple_events.setter + def remote_apple_events(self, remote_apple_events): + """Sets the remote_apple_events of this SystemInsightsSharingPreferences. + + + :param remote_apple_events: The remote_apple_events of this SystemInsightsSharingPreferences. # noqa: E501 + :type: int + """ + + self._remote_apple_events = remote_apple_events + + @property + def remote_login(self): + """Gets the remote_login of this SystemInsightsSharingPreferences. # noqa: E501 + + + :return: The remote_login of this SystemInsightsSharingPreferences. # noqa: E501 + :rtype: int + """ + return self._remote_login + + @remote_login.setter + def remote_login(self, remote_login): + """Sets the remote_login of this SystemInsightsSharingPreferences. + + + :param remote_login: The remote_login of this SystemInsightsSharingPreferences. # noqa: E501 + :type: int + """ + + self._remote_login = remote_login + + @property + def remote_management(self): + """Gets the remote_management of this SystemInsightsSharingPreferences. # noqa: E501 + + + :return: The remote_management of this SystemInsightsSharingPreferences. # noqa: E501 + :rtype: int + """ + return self._remote_management + + @remote_management.setter + def remote_management(self, remote_management): + """Sets the remote_management of this SystemInsightsSharingPreferences. + + + :param remote_management: The remote_management of this SystemInsightsSharingPreferences. # noqa: E501 + :type: int + """ + + self._remote_management = remote_management + + @property + def screen_sharing(self): + """Gets the screen_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + + + :return: The screen_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + :rtype: int + """ + return self._screen_sharing + + @screen_sharing.setter + def screen_sharing(self, screen_sharing): + """Sets the screen_sharing of this SystemInsightsSharingPreferences. + + + :param screen_sharing: The screen_sharing of this SystemInsightsSharingPreferences. # noqa: E501 + :type: int + """ + + self._screen_sharing = screen_sharing + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsSharingPreferences. # noqa: E501 + + + :return: The system_id of this SystemInsightsSharingPreferences. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsSharingPreferences. + + + :param system_id: The system_id of this SystemInsightsSharingPreferences. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsSharingPreferences, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsSharingPreferences): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_sip_config.py b/jcapiv2/jcapiv2/models/system_insights_sip_config.py new file mode 100644 index 0000000..7f747ee --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_sip_config.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsSipConfig(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'collection_time': 'str', + 'config_flag': 'str', + 'enabled': 'int', + 'enabled_nvram': 'int', + 'system_id': 'str' + } + + attribute_map = { + 'collection_time': 'collection_time', + 'config_flag': 'config_flag', + 'enabled': 'enabled', + 'enabled_nvram': 'enabled_nvram', + 'system_id': 'system_id' + } + + def __init__(self, collection_time=None, config_flag=None, enabled=None, enabled_nvram=None, system_id=None): # noqa: E501 + """SystemInsightsSipConfig - a model defined in Swagger""" # noqa: E501 + self._collection_time = None + self._config_flag = None + self._enabled = None + self._enabled_nvram = None + self._system_id = None + self.discriminator = None + if collection_time is not None: + self.collection_time = collection_time + if config_flag is not None: + self.config_flag = config_flag + if enabled is not None: + self.enabled = enabled + if enabled_nvram is not None: + self.enabled_nvram = enabled_nvram + if system_id is not None: + self.system_id = system_id + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsSipConfig. # noqa: E501 + + + :return: The collection_time of this SystemInsightsSipConfig. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsSipConfig. + + + :param collection_time: The collection_time of this SystemInsightsSipConfig. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def config_flag(self): + """Gets the config_flag of this SystemInsightsSipConfig. # noqa: E501 + + + :return: The config_flag of this SystemInsightsSipConfig. # noqa: E501 + :rtype: str + """ + return self._config_flag + + @config_flag.setter + def config_flag(self, config_flag): + """Sets the config_flag of this SystemInsightsSipConfig. + + + :param config_flag: The config_flag of this SystemInsightsSipConfig. # noqa: E501 + :type: str + """ + + self._config_flag = config_flag + + @property + def enabled(self): + """Gets the enabled of this SystemInsightsSipConfig. # noqa: E501 + + + :return: The enabled of this SystemInsightsSipConfig. # noqa: E501 + :rtype: int + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled): + """Sets the enabled of this SystemInsightsSipConfig. + + + :param enabled: The enabled of this SystemInsightsSipConfig. # noqa: E501 + :type: int + """ + + self._enabled = enabled + + @property + def enabled_nvram(self): + """Gets the enabled_nvram of this SystemInsightsSipConfig. # noqa: E501 + + + :return: The enabled_nvram of this SystemInsightsSipConfig. # noqa: E501 + :rtype: int + """ + return self._enabled_nvram + + @enabled_nvram.setter + def enabled_nvram(self, enabled_nvram): + """Sets the enabled_nvram of this SystemInsightsSipConfig. + + + :param enabled_nvram: The enabled_nvram of this SystemInsightsSipConfig. # noqa: E501 + :type: int + """ + + self._enabled_nvram = enabled_nvram + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsSipConfig. # noqa: E501 + + + :return: The system_id of this SystemInsightsSipConfig. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsSipConfig. + + + :param system_id: The system_id of this SystemInsightsSipConfig. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsSipConfig, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsSipConfig): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_startup_items.py b/jcapiv2/jcapiv2/models/system_insights_startup_items.py new file mode 100644 index 0000000..ebeedc6 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_startup_items.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsStartupItems(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'args': 'str', + 'name': 'str', + 'path': 'str', + 'source': 'str', + 'status': 'str', + 'system_id': 'str', + 'type': 'str', + 'username': 'str' + } + + attribute_map = { + 'args': 'args', + 'name': 'name', + 'path': 'path', + 'source': 'source', + 'status': 'status', + 'system_id': 'system_id', + 'type': 'type', + 'username': 'username' + } + + def __init__(self, args=None, name=None, path=None, source=None, status=None, system_id=None, type=None, username=None): # noqa: E501 + """SystemInsightsStartupItems - a model defined in Swagger""" # noqa: E501 + self._args = None + self._name = None + self._path = None + self._source = None + self._status = None + self._system_id = None + self._type = None + self._username = None + self.discriminator = None + if args is not None: + self.args = args + if name is not None: + self.name = name + if path is not None: + self.path = path + if source is not None: + self.source = source + if status is not None: + self.status = status + if system_id is not None: + self.system_id = system_id + if type is not None: + self.type = type + if username is not None: + self.username = username + + @property + def args(self): + """Gets the args of this SystemInsightsStartupItems. # noqa: E501 + + + :return: The args of this SystemInsightsStartupItems. # noqa: E501 + :rtype: str + """ + return self._args + + @args.setter + def args(self, args): + """Sets the args of this SystemInsightsStartupItems. + + + :param args: The args of this SystemInsightsStartupItems. # noqa: E501 + :type: str + """ + + self._args = args + + @property + def name(self): + """Gets the name of this SystemInsightsStartupItems. # noqa: E501 + + + :return: The name of this SystemInsightsStartupItems. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SystemInsightsStartupItems. + + + :param name: The name of this SystemInsightsStartupItems. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def path(self): + """Gets the path of this SystemInsightsStartupItems. # noqa: E501 + + + :return: The path of this SystemInsightsStartupItems. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this SystemInsightsStartupItems. + + + :param path: The path of this SystemInsightsStartupItems. # noqa: E501 + :type: str + """ + + self._path = path + + @property + def source(self): + """Gets the source of this SystemInsightsStartupItems. # noqa: E501 + + + :return: The source of this SystemInsightsStartupItems. # noqa: E501 + :rtype: str + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this SystemInsightsStartupItems. + + + :param source: The source of this SystemInsightsStartupItems. # noqa: E501 + :type: str + """ + + self._source = source + + @property + def status(self): + """Gets the status of this SystemInsightsStartupItems. # noqa: E501 + + + :return: The status of this SystemInsightsStartupItems. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this SystemInsightsStartupItems. + + + :param status: The status of this SystemInsightsStartupItems. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsStartupItems. # noqa: E501 + + + :return: The system_id of this SystemInsightsStartupItems. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsStartupItems. + + + :param system_id: The system_id of this SystemInsightsStartupItems. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def type(self): + """Gets the type of this SystemInsightsStartupItems. # noqa: E501 + + + :return: The type of this SystemInsightsStartupItems. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SystemInsightsStartupItems. + + + :param type: The type of this SystemInsightsStartupItems. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def username(self): + """Gets the username of this SystemInsightsStartupItems. # noqa: E501 + + + :return: The username of this SystemInsightsStartupItems. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this SystemInsightsStartupItems. + + + :param username: The username of this SystemInsightsStartupItems. # noqa: E501 + :type: str + """ + + self._username = username + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsStartupItems, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsStartupItems): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_system_controls.py b/jcapiv2/jcapiv2/models/system_insights_system_controls.py index a25450b..cf4e8b4 100644 --- a/jcapiv2/jcapiv2/models/system_insights_system_controls.py +++ b/jcapiv2/jcapiv2/models/system_insights_system_controls.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsSystemControls(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -56,7 +53,6 @@ class SystemInsightsSystemControls(object): def __init__(self, collection_time=None, config_value=None, current_value=None, field_name=None, name=None, oid=None, subsystem=None, system_id=None, type=None): # noqa: E501 """SystemInsightsSystemControls - a model defined in Swagger""" # noqa: E501 - self._collection_time = None self._config_value = None self._current_value = None @@ -67,7 +63,6 @@ def __init__(self, collection_time=None, config_value=None, current_value=None, self._system_id = None self._type = None self.discriminator = None - if collection_time is not None: self.collection_time = collection_time if config_value is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_system_info.py b/jcapiv2/jcapiv2/models/system_insights_system_info.py index 81d7892..3074bbc 100644 --- a/jcapiv2/jcapiv2/models/system_insights_system_info.py +++ b/jcapiv2/jcapiv2/models/system_insights_system_info.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsSystemInfo(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -72,7 +69,6 @@ class SystemInsightsSystemInfo(object): def __init__(self, collection_time=None, computer_name=None, cpu_brand=None, cpu_logical_cores=None, cpu_microcode=None, cpu_physical_cores=None, cpu_subtype=None, cpu_type=None, hardware_model=None, hardware_serial=None, hardware_vendor=None, hardware_version=None, hostname=None, local_hostname=None, physical_memory=None, system_id=None, uuid=None): # noqa: E501 """SystemInsightsSystemInfo - a model defined in Swagger""" # noqa: E501 - self._collection_time = None self._computer_name = None self._cpu_brand = None @@ -91,7 +87,6 @@ def __init__(self, collection_time=None, computer_name=None, cpu_brand=None, cpu self._system_id = None self._uuid = None self.discriminator = None - if collection_time is not None: self.collection_time = collection_time if computer_name is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_tpm_info.py b/jcapiv2/jcapiv2/models/system_insights_tpm_info.py new file mode 100644 index 0000000..55ac5d6 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_tpm_info.py @@ -0,0 +1,370 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsTpmInfo(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'activated': 'float', + 'collection_time': 'str', + 'enabled': 'float', + 'manufacturer_id': 'float', + 'manufacturer_name': 'str', + 'manufacturer_version': 'str', + 'owned': 'float', + 'physical_presence_version': 'str', + 'product_name': 'str', + 'spec_version': 'str', + 'system_id': 'str' + } + + attribute_map = { + 'activated': 'activated', + 'collection_time': 'collection_time', + 'enabled': 'enabled', + 'manufacturer_id': 'manufacturer_id', + 'manufacturer_name': 'manufacturer_name', + 'manufacturer_version': 'manufacturer_version', + 'owned': 'owned', + 'physical_presence_version': 'physical_presence_version', + 'product_name': 'product_name', + 'spec_version': 'spec_version', + 'system_id': 'system_id' + } + + def __init__(self, activated=None, collection_time=None, enabled=None, manufacturer_id=None, manufacturer_name=None, manufacturer_version=None, owned=None, physical_presence_version=None, product_name=None, spec_version=None, system_id=None): # noqa: E501 + """SystemInsightsTpmInfo - a model defined in Swagger""" # noqa: E501 + self._activated = None + self._collection_time = None + self._enabled = None + self._manufacturer_id = None + self._manufacturer_name = None + self._manufacturer_version = None + self._owned = None + self._physical_presence_version = None + self._product_name = None + self._spec_version = None + self._system_id = None + self.discriminator = None + if activated is not None: + self.activated = activated + if collection_time is not None: + self.collection_time = collection_time + if enabled is not None: + self.enabled = enabled + if manufacturer_id is not None: + self.manufacturer_id = manufacturer_id + if manufacturer_name is not None: + self.manufacturer_name = manufacturer_name + if manufacturer_version is not None: + self.manufacturer_version = manufacturer_version + if owned is not None: + self.owned = owned + if physical_presence_version is not None: + self.physical_presence_version = physical_presence_version + if product_name is not None: + self.product_name = product_name + if spec_version is not None: + self.spec_version = spec_version + if system_id is not None: + self.system_id = system_id + + @property + def activated(self): + """Gets the activated of this SystemInsightsTpmInfo. # noqa: E501 + + + :return: The activated of this SystemInsightsTpmInfo. # noqa: E501 + :rtype: float + """ + return self._activated + + @activated.setter + def activated(self, activated): + """Sets the activated of this SystemInsightsTpmInfo. + + + :param activated: The activated of this SystemInsightsTpmInfo. # noqa: E501 + :type: float + """ + + self._activated = activated + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsTpmInfo. # noqa: E501 + + + :return: The collection_time of this SystemInsightsTpmInfo. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsTpmInfo. + + + :param collection_time: The collection_time of this SystemInsightsTpmInfo. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def enabled(self): + """Gets the enabled of this SystemInsightsTpmInfo. # noqa: E501 + + + :return: The enabled of this SystemInsightsTpmInfo. # noqa: E501 + :rtype: float + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled): + """Sets the enabled of this SystemInsightsTpmInfo. + + + :param enabled: The enabled of this SystemInsightsTpmInfo. # noqa: E501 + :type: float + """ + + self._enabled = enabled + + @property + def manufacturer_id(self): + """Gets the manufacturer_id of this SystemInsightsTpmInfo. # noqa: E501 + + + :return: The manufacturer_id of this SystemInsightsTpmInfo. # noqa: E501 + :rtype: float + """ + return self._manufacturer_id + + @manufacturer_id.setter + def manufacturer_id(self, manufacturer_id): + """Sets the manufacturer_id of this SystemInsightsTpmInfo. + + + :param manufacturer_id: The manufacturer_id of this SystemInsightsTpmInfo. # noqa: E501 + :type: float + """ + + self._manufacturer_id = manufacturer_id + + @property + def manufacturer_name(self): + """Gets the manufacturer_name of this SystemInsightsTpmInfo. # noqa: E501 + + + :return: The manufacturer_name of this SystemInsightsTpmInfo. # noqa: E501 + :rtype: str + """ + return self._manufacturer_name + + @manufacturer_name.setter + def manufacturer_name(self, manufacturer_name): + """Sets the manufacturer_name of this SystemInsightsTpmInfo. + + + :param manufacturer_name: The manufacturer_name of this SystemInsightsTpmInfo. # noqa: E501 + :type: str + """ + + self._manufacturer_name = manufacturer_name + + @property + def manufacturer_version(self): + """Gets the manufacturer_version of this SystemInsightsTpmInfo. # noqa: E501 + + + :return: The manufacturer_version of this SystemInsightsTpmInfo. # noqa: E501 + :rtype: str + """ + return self._manufacturer_version + + @manufacturer_version.setter + def manufacturer_version(self, manufacturer_version): + """Sets the manufacturer_version of this SystemInsightsTpmInfo. + + + :param manufacturer_version: The manufacturer_version of this SystemInsightsTpmInfo. # noqa: E501 + :type: str + """ + + self._manufacturer_version = manufacturer_version + + @property + def owned(self): + """Gets the owned of this SystemInsightsTpmInfo. # noqa: E501 + + + :return: The owned of this SystemInsightsTpmInfo. # noqa: E501 + :rtype: float + """ + return self._owned + + @owned.setter + def owned(self, owned): + """Sets the owned of this SystemInsightsTpmInfo. + + + :param owned: The owned of this SystemInsightsTpmInfo. # noqa: E501 + :type: float + """ + + self._owned = owned + + @property + def physical_presence_version(self): + """Gets the physical_presence_version of this SystemInsightsTpmInfo. # noqa: E501 + + + :return: The physical_presence_version of this SystemInsightsTpmInfo. # noqa: E501 + :rtype: str + """ + return self._physical_presence_version + + @physical_presence_version.setter + def physical_presence_version(self, physical_presence_version): + """Sets the physical_presence_version of this SystemInsightsTpmInfo. + + + :param physical_presence_version: The physical_presence_version of this SystemInsightsTpmInfo. # noqa: E501 + :type: str + """ + + self._physical_presence_version = physical_presence_version + + @property + def product_name(self): + """Gets the product_name of this SystemInsightsTpmInfo. # noqa: E501 + + + :return: The product_name of this SystemInsightsTpmInfo. # noqa: E501 + :rtype: str + """ + return self._product_name + + @product_name.setter + def product_name(self, product_name): + """Sets the product_name of this SystemInsightsTpmInfo. + + + :param product_name: The product_name of this SystemInsightsTpmInfo. # noqa: E501 + :type: str + """ + + self._product_name = product_name + + @property + def spec_version(self): + """Gets the spec_version of this SystemInsightsTpmInfo. # noqa: E501 + + + :return: The spec_version of this SystemInsightsTpmInfo. # noqa: E501 + :rtype: str + """ + return self._spec_version + + @spec_version.setter + def spec_version(self, spec_version): + """Sets the spec_version of this SystemInsightsTpmInfo. + + + :param spec_version: The spec_version of this SystemInsightsTpmInfo. # noqa: E501 + :type: str + """ + + self._spec_version = spec_version + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsTpmInfo. # noqa: E501 + + + :return: The system_id of this SystemInsightsTpmInfo. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsTpmInfo. + + + :param system_id: The system_id of this SystemInsightsTpmInfo. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsTpmInfo, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsTpmInfo): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_uptime.py b/jcapiv2/jcapiv2/models/system_insights_uptime.py index 2f8fcf1..55e8b63 100644 --- a/jcapiv2/jcapiv2/models/system_insights_uptime.py +++ b/jcapiv2/jcapiv2/models/system_insights_uptime.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsUptime(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -52,7 +49,6 @@ class SystemInsightsUptime(object): def __init__(self, collection_time=None, days=None, hours=None, minutes=None, seconds=None, system_id=None, total_seconds=None): # noqa: E501 """SystemInsightsUptime - a model defined in Swagger""" # noqa: E501 - self._collection_time = None self._days = None self._hours = None @@ -61,7 +57,6 @@ def __init__(self, collection_time=None, days=None, hours=None, minutes=None, se self._system_id = None self._total_seconds = None self.discriminator = None - if collection_time is not None: self.collection_time = collection_time if days is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_usb_devices.py b/jcapiv2/jcapiv2/models/system_insights_usb_devices.py index 48125b6..699be80 100644 --- a/jcapiv2/jcapiv2/models/system_insights_usb_devices.py +++ b/jcapiv2/jcapiv2/models/system_insights_usb_devices.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsUsbDevices(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -66,7 +63,6 @@ class SystemInsightsUsbDevices(object): def __init__(self, _class=None, collection_time=None, model=None, model_id=None, protocol=None, removable=None, serial=None, subclass=None, system_id=None, usb_address=None, usb_port=None, vendor=None, vendor_id=None, version=None): # noqa: E501 """SystemInsightsUsbDevices - a model defined in Swagger""" # noqa: E501 - self.__class = None self._collection_time = None self._model = None @@ -82,7 +78,6 @@ def __init__(self, _class=None, collection_time=None, model=None, model_id=None, self._vendor_id = None self._version = None self.discriminator = None - if _class is not None: self._class = _class if collection_time is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_user_groups.py b/jcapiv2/jcapiv2/models/system_insights_user_groups.py index 001e68a..9ec9621 100644 --- a/jcapiv2/jcapiv2/models/system_insights_user_groups.py +++ b/jcapiv2/jcapiv2/models/system_insights_user_groups.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsUserGroups(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -46,13 +43,11 @@ class SystemInsightsUserGroups(object): def __init__(self, collection_time=None, gid=None, system_id=None, uid=None): # noqa: E501 """SystemInsightsUserGroups - a model defined in Swagger""" # noqa: E501 - self._collection_time = None self._gid = None self._system_id = None self._uid = None self.discriminator = None - if collection_time is not None: self.collection_time = collection_time if gid is not None: diff --git a/jcapiv2/jcapiv2/models/system_insights_user_ssh_keys.py b/jcapiv2/jcapiv2/models/system_insights_user_ssh_keys.py new file mode 100644 index 0000000..d0297bb --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_user_ssh_keys.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsUserSshKeys(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'collection_time': 'str', + 'encrypted': 'int', + 'path': 'str', + 'system_id': 'str', + 'uid': 'str' + } + + attribute_map = { + 'collection_time': 'collection_time', + 'encrypted': 'encrypted', + 'path': 'path', + 'system_id': 'system_id', + 'uid': 'uid' + } + + def __init__(self, collection_time=None, encrypted=None, path=None, system_id=None, uid=None): # noqa: E501 + """SystemInsightsUserSshKeys - a model defined in Swagger""" # noqa: E501 + self._collection_time = None + self._encrypted = None + self._path = None + self._system_id = None + self._uid = None + self.discriminator = None + if collection_time is not None: + self.collection_time = collection_time + if encrypted is not None: + self.encrypted = encrypted + if path is not None: + self.path = path + if system_id is not None: + self.system_id = system_id + if uid is not None: + self.uid = uid + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsUserSshKeys. # noqa: E501 + + + :return: The collection_time of this SystemInsightsUserSshKeys. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsUserSshKeys. + + + :param collection_time: The collection_time of this SystemInsightsUserSshKeys. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def encrypted(self): + """Gets the encrypted of this SystemInsightsUserSshKeys. # noqa: E501 + + + :return: The encrypted of this SystemInsightsUserSshKeys. # noqa: E501 + :rtype: int + """ + return self._encrypted + + @encrypted.setter + def encrypted(self, encrypted): + """Sets the encrypted of this SystemInsightsUserSshKeys. + + + :param encrypted: The encrypted of this SystemInsightsUserSshKeys. # noqa: E501 + :type: int + """ + + self._encrypted = encrypted + + @property + def path(self): + """Gets the path of this SystemInsightsUserSshKeys. # noqa: E501 + + + :return: The path of this SystemInsightsUserSshKeys. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this SystemInsightsUserSshKeys. + + + :param path: The path of this SystemInsightsUserSshKeys. # noqa: E501 + :type: str + """ + + self._path = path + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsUserSshKeys. # noqa: E501 + + + :return: The system_id of this SystemInsightsUserSshKeys. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsUserSshKeys. + + + :param system_id: The system_id of this SystemInsightsUserSshKeys. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def uid(self): + """Gets the uid of this SystemInsightsUserSshKeys. # noqa: E501 + + + :return: The uid of this SystemInsightsUserSshKeys. # noqa: E501 + :rtype: str + """ + return self._uid + + @uid.setter + def uid(self, uid): + """Sets the uid of this SystemInsightsUserSshKeys. + + + :param uid: The uid of this SystemInsightsUserSshKeys. # noqa: E501 + :type: str + """ + + self._uid = uid + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsUserSshKeys, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsUserSshKeys): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_userassist.py b/jcapiv2/jcapiv2/models/system_insights_userassist.py new file mode 100644 index 0000000..3dc7f6c --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_userassist.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsUserassist(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'collection_time': 'str', + 'count': 'float', + 'last_execution_time': 'float', + 'path': 'str', + 'sid': 'str', + 'system_id': 'str' + } + + attribute_map = { + 'collection_time': 'collection_time', + 'count': 'count', + 'last_execution_time': 'last_execution_time', + 'path': 'path', + 'sid': 'sid', + 'system_id': 'system_id' + } + + def __init__(self, collection_time=None, count=None, last_execution_time=None, path=None, sid=None, system_id=None): # noqa: E501 + """SystemInsightsUserassist - a model defined in Swagger""" # noqa: E501 + self._collection_time = None + self._count = None + self._last_execution_time = None + self._path = None + self._sid = None + self._system_id = None + self.discriminator = None + if collection_time is not None: + self.collection_time = collection_time + if count is not None: + self.count = count + if last_execution_time is not None: + self.last_execution_time = last_execution_time + if path is not None: + self.path = path + if sid is not None: + self.sid = sid + if system_id is not None: + self.system_id = system_id + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsUserassist. # noqa: E501 + + + :return: The collection_time of this SystemInsightsUserassist. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsUserassist. + + + :param collection_time: The collection_time of this SystemInsightsUserassist. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def count(self): + """Gets the count of this SystemInsightsUserassist. # noqa: E501 + + + :return: The count of this SystemInsightsUserassist. # noqa: E501 + :rtype: float + """ + return self._count + + @count.setter + def count(self, count): + """Sets the count of this SystemInsightsUserassist. + + + :param count: The count of this SystemInsightsUserassist. # noqa: E501 + :type: float + """ + + self._count = count + + @property + def last_execution_time(self): + """Gets the last_execution_time of this SystemInsightsUserassist. # noqa: E501 + + + :return: The last_execution_time of this SystemInsightsUserassist. # noqa: E501 + :rtype: float + """ + return self._last_execution_time + + @last_execution_time.setter + def last_execution_time(self, last_execution_time): + """Sets the last_execution_time of this SystemInsightsUserassist. + + + :param last_execution_time: The last_execution_time of this SystemInsightsUserassist. # noqa: E501 + :type: float + """ + + self._last_execution_time = last_execution_time + + @property + def path(self): + """Gets the path of this SystemInsightsUserassist. # noqa: E501 + + + :return: The path of this SystemInsightsUserassist. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this SystemInsightsUserassist. + + + :param path: The path of this SystemInsightsUserassist. # noqa: E501 + :type: str + """ + + self._path = path + + @property + def sid(self): + """Gets the sid of this SystemInsightsUserassist. # noqa: E501 + + + :return: The sid of this SystemInsightsUserassist. # noqa: E501 + :rtype: str + """ + return self._sid + + @sid.setter + def sid(self, sid): + """Sets the sid of this SystemInsightsUserassist. + + + :param sid: The sid of this SystemInsightsUserassist. # noqa: E501 + :type: str + """ + + self._sid = sid + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsUserassist. # noqa: E501 + + + :return: The system_id of this SystemInsightsUserassist. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsUserassist. + + + :param system_id: The system_id of this SystemInsightsUserassist. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsUserassist, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsUserassist): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_users.py b/jcapiv2/jcapiv2/models/system_insights_users.py index c81d0da..0329ea8 100644 --- a/jcapiv2/jcapiv2/models/system_insights_users.py +++ b/jcapiv2/jcapiv2/models/system_insights_users.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class SystemInsightsUsers(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -31,12 +28,18 @@ class SystemInsightsUsers(object): and the value is json key in definition. """ swagger_types = { + 'ad_managed': 'bool', + 'admin': 'bool', 'collection_time': 'str', 'description': 'str', 'directory': 'str', 'gid': 'str', 'gid_signed': 'str', + 'last_login': 'str', + 'managed': 'bool', + 'real_user': 'bool', 'shell': 'str', + 'suspended': 'bool', 'system_id': 'str', 'type': 'str', 'uid': 'str', @@ -46,12 +49,18 @@ class SystemInsightsUsers(object): } attribute_map = { + 'ad_managed': 'ad_managed', + 'admin': 'admin', 'collection_time': 'collection_time', 'description': 'description', 'directory': 'directory', 'gid': 'gid', 'gid_signed': 'gid_signed', + 'last_login': 'last_login', + 'managed': 'managed', + 'real_user': 'real_user', 'shell': 'shell', + 'suspended': 'suspended', 'system_id': 'system_id', 'type': 'type', 'uid': 'uid', @@ -60,15 +69,20 @@ class SystemInsightsUsers(object): 'uuid': 'uuid' } - def __init__(self, collection_time=None, description=None, directory=None, gid=None, gid_signed=None, shell=None, system_id=None, type=None, uid=None, uid_signed=None, username=None, uuid=None): # noqa: E501 + def __init__(self, ad_managed=None, admin=None, collection_time=None, description=None, directory=None, gid=None, gid_signed=None, last_login=None, managed=None, real_user=None, shell=None, suspended=None, system_id=None, type=None, uid=None, uid_signed=None, username=None, uuid=None): # noqa: E501 """SystemInsightsUsers - a model defined in Swagger""" # noqa: E501 - + self._ad_managed = None + self._admin = None self._collection_time = None self._description = None self._directory = None self._gid = None self._gid_signed = None + self._last_login = None + self._managed = None + self._real_user = None self._shell = None + self._suspended = None self._system_id = None self._type = None self._uid = None @@ -76,7 +90,10 @@ def __init__(self, collection_time=None, description=None, directory=None, gid=N self._username = None self._uuid = None self.discriminator = None - + if ad_managed is not None: + self.ad_managed = ad_managed + if admin is not None: + self.admin = admin if collection_time is not None: self.collection_time = collection_time if description is not None: @@ -87,8 +104,16 @@ def __init__(self, collection_time=None, description=None, directory=None, gid=N self.gid = gid if gid_signed is not None: self.gid_signed = gid_signed + if last_login is not None: + self.last_login = last_login + if managed is not None: + self.managed = managed + if real_user is not None: + self.real_user = real_user if shell is not None: self.shell = shell + if suspended is not None: + self.suspended = suspended if system_id is not None: self.system_id = system_id if type is not None: @@ -102,6 +127,52 @@ def __init__(self, collection_time=None, description=None, directory=None, gid=N if uuid is not None: self.uuid = uuid + @property + def ad_managed(self): + """Gets the ad_managed of this SystemInsightsUsers. # noqa: E501 + + Indicates this account belongs to a AD-managed user # noqa: E501 + + :return: The ad_managed of this SystemInsightsUsers. # noqa: E501 + :rtype: bool + """ + return self._ad_managed + + @ad_managed.setter + def ad_managed(self, ad_managed): + """Sets the ad_managed of this SystemInsightsUsers. + + Indicates this account belongs to a AD-managed user # noqa: E501 + + :param ad_managed: The ad_managed of this SystemInsightsUsers. # noqa: E501 + :type: bool + """ + + self._ad_managed = ad_managed + + @property + def admin(self): + """Gets the admin of this SystemInsightsUsers. # noqa: E501 + + Indicates this account has local administrator privileges # noqa: E501 + + :return: The admin of this SystemInsightsUsers. # noqa: E501 + :rtype: bool + """ + return self._admin + + @admin.setter + def admin(self, admin): + """Sets the admin of this SystemInsightsUsers. + + Indicates this account has local administrator privileges # noqa: E501 + + :param admin: The admin of this SystemInsightsUsers. # noqa: E501 + :type: bool + """ + + self._admin = admin + @property def collection_time(self): """Gets the collection_time of this SystemInsightsUsers. # noqa: E501 @@ -207,6 +278,75 @@ def gid_signed(self, gid_signed): self._gid_signed = gid_signed + @property + def last_login(self): + """Gets the last_login of this SystemInsightsUsers. # noqa: E501 + + A Unix timestamp showing the last time this user logged in # noqa: E501 + + :return: The last_login of this SystemInsightsUsers. # noqa: E501 + :rtype: str + """ + return self._last_login + + @last_login.setter + def last_login(self, last_login): + """Sets the last_login of this SystemInsightsUsers. + + A Unix timestamp showing the last time this user logged in # noqa: E501 + + :param last_login: The last_login of this SystemInsightsUsers. # noqa: E501 + :type: str + """ + + self._last_login = last_login + + @property + def managed(self): + """Gets the managed of this SystemInsightsUsers. # noqa: E501 + + Indicates this account belongs to a JumpCloud-managed user # noqa: E501 + + :return: The managed of this SystemInsightsUsers. # noqa: E501 + :rtype: bool + """ + return self._managed + + @managed.setter + def managed(self, managed): + """Sets the managed of this SystemInsightsUsers. + + Indicates this account belongs to a JumpCloud-managed user # noqa: E501 + + :param managed: The managed of this SystemInsightsUsers. # noqa: E501 + :type: bool + """ + + self._managed = managed + + @property + def real_user(self): + """Gets the real_user of this SystemInsightsUsers. # noqa: E501 + + Indicates this account represents an interactive user account vs. a system or daemon account # noqa: E501 + + :return: The real_user of this SystemInsightsUsers. # noqa: E501 + :rtype: bool + """ + return self._real_user + + @real_user.setter + def real_user(self, real_user): + """Sets the real_user of this SystemInsightsUsers. + + Indicates this account represents an interactive user account vs. a system or daemon account # noqa: E501 + + :param real_user: The real_user of this SystemInsightsUsers. # noqa: E501 + :type: bool + """ + + self._real_user = real_user + @property def shell(self): """Gets the shell of this SystemInsightsUsers. # noqa: E501 @@ -228,6 +368,29 @@ def shell(self, shell): self._shell = shell + @property + def suspended(self): + """Gets the suspended of this SystemInsightsUsers. # noqa: E501 + + Indicates this account is suspended or locked out # noqa: E501 + + :return: The suspended of this SystemInsightsUsers. # noqa: E501 + :rtype: bool + """ + return self._suspended + + @suspended.setter + def suspended(self, suspended): + """Sets the suspended of this SystemInsightsUsers. + + Indicates this account is suspended or locked out # noqa: E501 + + :param suspended: The suspended of this SystemInsightsUsers. # noqa: E501 + :type: bool + """ + + self._suspended = suspended + @property def system_id(self): """Gets the system_id of this SystemInsightsUsers. # noqa: E501 diff --git a/jcapiv2/jcapiv2/models/system_insights_wifi_networks.py b/jcapiv2/jcapiv2/models/system_insights_wifi_networks.py new file mode 100644 index 0000000..21e8ec7 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_wifi_networks.py @@ -0,0 +1,448 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsWifiNetworks(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'auto_login': 'float', + 'captive_portal': 'float', + 'collection_time': 'str', + 'disabled': 'float', + 'last_connected': 'float', + 'network_name': 'str', + 'passpoint': 'float', + 'possibly_hidden': 'float', + 'roaming': 'float', + 'roaming_profile': 'str', + 'security_type': 'str', + 'ssid': 'str', + 'system_id': 'str', + 'temporarily_disabled': 'float' + } + + attribute_map = { + 'auto_login': 'auto_login', + 'captive_portal': 'captive_portal', + 'collection_time': 'collection_time', + 'disabled': 'disabled', + 'last_connected': 'last_connected', + 'network_name': 'network_name', + 'passpoint': 'passpoint', + 'possibly_hidden': 'possibly_hidden', + 'roaming': 'roaming', + 'roaming_profile': 'roaming_profile', + 'security_type': 'security_type', + 'ssid': 'ssid', + 'system_id': 'system_id', + 'temporarily_disabled': 'temporarily_disabled' + } + + def __init__(self, auto_login=None, captive_portal=None, collection_time=None, disabled=None, last_connected=None, network_name=None, passpoint=None, possibly_hidden=None, roaming=None, roaming_profile=None, security_type=None, ssid=None, system_id=None, temporarily_disabled=None): # noqa: E501 + """SystemInsightsWifiNetworks - a model defined in Swagger""" # noqa: E501 + self._auto_login = None + self._captive_portal = None + self._collection_time = None + self._disabled = None + self._last_connected = None + self._network_name = None + self._passpoint = None + self._possibly_hidden = None + self._roaming = None + self._roaming_profile = None + self._security_type = None + self._ssid = None + self._system_id = None + self._temporarily_disabled = None + self.discriminator = None + if auto_login is not None: + self.auto_login = auto_login + if captive_portal is not None: + self.captive_portal = captive_portal + if collection_time is not None: + self.collection_time = collection_time + if disabled is not None: + self.disabled = disabled + if last_connected is not None: + self.last_connected = last_connected + if network_name is not None: + self.network_name = network_name + if passpoint is not None: + self.passpoint = passpoint + if possibly_hidden is not None: + self.possibly_hidden = possibly_hidden + if roaming is not None: + self.roaming = roaming + if roaming_profile is not None: + self.roaming_profile = roaming_profile + if security_type is not None: + self.security_type = security_type + if ssid is not None: + self.ssid = ssid + if system_id is not None: + self.system_id = system_id + if temporarily_disabled is not None: + self.temporarily_disabled = temporarily_disabled + + @property + def auto_login(self): + """Gets the auto_login of this SystemInsightsWifiNetworks. # noqa: E501 + + + :return: The auto_login of this SystemInsightsWifiNetworks. # noqa: E501 + :rtype: float + """ + return self._auto_login + + @auto_login.setter + def auto_login(self, auto_login): + """Sets the auto_login of this SystemInsightsWifiNetworks. + + + :param auto_login: The auto_login of this SystemInsightsWifiNetworks. # noqa: E501 + :type: float + """ + + self._auto_login = auto_login + + @property + def captive_portal(self): + """Gets the captive_portal of this SystemInsightsWifiNetworks. # noqa: E501 + + + :return: The captive_portal of this SystemInsightsWifiNetworks. # noqa: E501 + :rtype: float + """ + return self._captive_portal + + @captive_portal.setter + def captive_portal(self, captive_portal): + """Sets the captive_portal of this SystemInsightsWifiNetworks. + + + :param captive_portal: The captive_portal of this SystemInsightsWifiNetworks. # noqa: E501 + :type: float + """ + + self._captive_portal = captive_portal + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsWifiNetworks. # noqa: E501 + + + :return: The collection_time of this SystemInsightsWifiNetworks. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsWifiNetworks. + + + :param collection_time: The collection_time of this SystemInsightsWifiNetworks. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def disabled(self): + """Gets the disabled of this SystemInsightsWifiNetworks. # noqa: E501 + + + :return: The disabled of this SystemInsightsWifiNetworks. # noqa: E501 + :rtype: float + """ + return self._disabled + + @disabled.setter + def disabled(self, disabled): + """Sets the disabled of this SystemInsightsWifiNetworks. + + + :param disabled: The disabled of this SystemInsightsWifiNetworks. # noqa: E501 + :type: float + """ + + self._disabled = disabled + + @property + def last_connected(self): + """Gets the last_connected of this SystemInsightsWifiNetworks. # noqa: E501 + + + :return: The last_connected of this SystemInsightsWifiNetworks. # noqa: E501 + :rtype: float + """ + return self._last_connected + + @last_connected.setter + def last_connected(self, last_connected): + """Sets the last_connected of this SystemInsightsWifiNetworks. + + + :param last_connected: The last_connected of this SystemInsightsWifiNetworks. # noqa: E501 + :type: float + """ + + self._last_connected = last_connected + + @property + def network_name(self): + """Gets the network_name of this SystemInsightsWifiNetworks. # noqa: E501 + + + :return: The network_name of this SystemInsightsWifiNetworks. # noqa: E501 + :rtype: str + """ + return self._network_name + + @network_name.setter + def network_name(self, network_name): + """Sets the network_name of this SystemInsightsWifiNetworks. + + + :param network_name: The network_name of this SystemInsightsWifiNetworks. # noqa: E501 + :type: str + """ + + self._network_name = network_name + + @property + def passpoint(self): + """Gets the passpoint of this SystemInsightsWifiNetworks. # noqa: E501 + + + :return: The passpoint of this SystemInsightsWifiNetworks. # noqa: E501 + :rtype: float + """ + return self._passpoint + + @passpoint.setter + def passpoint(self, passpoint): + """Sets the passpoint of this SystemInsightsWifiNetworks. + + + :param passpoint: The passpoint of this SystemInsightsWifiNetworks. # noqa: E501 + :type: float + """ + + self._passpoint = passpoint + + @property + def possibly_hidden(self): + """Gets the possibly_hidden of this SystemInsightsWifiNetworks. # noqa: E501 + + + :return: The possibly_hidden of this SystemInsightsWifiNetworks. # noqa: E501 + :rtype: float + """ + return self._possibly_hidden + + @possibly_hidden.setter + def possibly_hidden(self, possibly_hidden): + """Sets the possibly_hidden of this SystemInsightsWifiNetworks. + + + :param possibly_hidden: The possibly_hidden of this SystemInsightsWifiNetworks. # noqa: E501 + :type: float + """ + + self._possibly_hidden = possibly_hidden + + @property + def roaming(self): + """Gets the roaming of this SystemInsightsWifiNetworks. # noqa: E501 + + + :return: The roaming of this SystemInsightsWifiNetworks. # noqa: E501 + :rtype: float + """ + return self._roaming + + @roaming.setter + def roaming(self, roaming): + """Sets the roaming of this SystemInsightsWifiNetworks. + + + :param roaming: The roaming of this SystemInsightsWifiNetworks. # noqa: E501 + :type: float + """ + + self._roaming = roaming + + @property + def roaming_profile(self): + """Gets the roaming_profile of this SystemInsightsWifiNetworks. # noqa: E501 + + + :return: The roaming_profile of this SystemInsightsWifiNetworks. # noqa: E501 + :rtype: str + """ + return self._roaming_profile + + @roaming_profile.setter + def roaming_profile(self, roaming_profile): + """Sets the roaming_profile of this SystemInsightsWifiNetworks. + + + :param roaming_profile: The roaming_profile of this SystemInsightsWifiNetworks. # noqa: E501 + :type: str + """ + + self._roaming_profile = roaming_profile + + @property + def security_type(self): + """Gets the security_type of this SystemInsightsWifiNetworks. # noqa: E501 + + + :return: The security_type of this SystemInsightsWifiNetworks. # noqa: E501 + :rtype: str + """ + return self._security_type + + @security_type.setter + def security_type(self, security_type): + """Sets the security_type of this SystemInsightsWifiNetworks. + + + :param security_type: The security_type of this SystemInsightsWifiNetworks. # noqa: E501 + :type: str + """ + + self._security_type = security_type + + @property + def ssid(self): + """Gets the ssid of this SystemInsightsWifiNetworks. # noqa: E501 + + + :return: The ssid of this SystemInsightsWifiNetworks. # noqa: E501 + :rtype: str + """ + return self._ssid + + @ssid.setter + def ssid(self, ssid): + """Sets the ssid of this SystemInsightsWifiNetworks. + + + :param ssid: The ssid of this SystemInsightsWifiNetworks. # noqa: E501 + :type: str + """ + + self._ssid = ssid + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsWifiNetworks. # noqa: E501 + + + :return: The system_id of this SystemInsightsWifiNetworks. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsWifiNetworks. + + + :param system_id: The system_id of this SystemInsightsWifiNetworks. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def temporarily_disabled(self): + """Gets the temporarily_disabled of this SystemInsightsWifiNetworks. # noqa: E501 + + + :return: The temporarily_disabled of this SystemInsightsWifiNetworks. # noqa: E501 + :rtype: float + """ + return self._temporarily_disabled + + @temporarily_disabled.setter + def temporarily_disabled(self, temporarily_disabled): + """Sets the temporarily_disabled of this SystemInsightsWifiNetworks. + + + :param temporarily_disabled: The temporarily_disabled of this SystemInsightsWifiNetworks. # noqa: E501 + :type: float + """ + + self._temporarily_disabled = temporarily_disabled + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsWifiNetworks, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsWifiNetworks): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_wifi_status.py b/jcapiv2/jcapiv2/models/system_insights_wifi_status.py new file mode 100644 index 0000000..98052fb --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_wifi_status.py @@ -0,0 +1,474 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsWifiStatus(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'bssid': 'str', + 'channel': 'float', + 'channel_band': 'float', + 'channel_width': 'float', + 'collection_time': 'str', + 'country_code': 'str', + 'interface': 'str', + 'mode': 'str', + 'network_name': 'str', + 'noise': 'float', + 'rssi': 'float', + 'security_type': 'str', + 'ssid': 'str', + 'system_id': 'str', + 'transmit_rate': 'str' + } + + attribute_map = { + 'bssid': 'bssid', + 'channel': 'channel', + 'channel_band': 'channel_band', + 'channel_width': 'channel_width', + 'collection_time': 'collection_time', + 'country_code': 'country_code', + 'interface': 'interface', + 'mode': 'mode', + 'network_name': 'network_name', + 'noise': 'noise', + 'rssi': 'rssi', + 'security_type': 'security_type', + 'ssid': 'ssid', + 'system_id': 'system_id', + 'transmit_rate': 'transmit_rate' + } + + def __init__(self, bssid=None, channel=None, channel_band=None, channel_width=None, collection_time=None, country_code=None, interface=None, mode=None, network_name=None, noise=None, rssi=None, security_type=None, ssid=None, system_id=None, transmit_rate=None): # noqa: E501 + """SystemInsightsWifiStatus - a model defined in Swagger""" # noqa: E501 + self._bssid = None + self._channel = None + self._channel_band = None + self._channel_width = None + self._collection_time = None + self._country_code = None + self._interface = None + self._mode = None + self._network_name = None + self._noise = None + self._rssi = None + self._security_type = None + self._ssid = None + self._system_id = None + self._transmit_rate = None + self.discriminator = None + if bssid is not None: + self.bssid = bssid + if channel is not None: + self.channel = channel + if channel_band is not None: + self.channel_band = channel_band + if channel_width is not None: + self.channel_width = channel_width + if collection_time is not None: + self.collection_time = collection_time + if country_code is not None: + self.country_code = country_code + if interface is not None: + self.interface = interface + if mode is not None: + self.mode = mode + if network_name is not None: + self.network_name = network_name + if noise is not None: + self.noise = noise + if rssi is not None: + self.rssi = rssi + if security_type is not None: + self.security_type = security_type + if ssid is not None: + self.ssid = ssid + if system_id is not None: + self.system_id = system_id + if transmit_rate is not None: + self.transmit_rate = transmit_rate + + @property + def bssid(self): + """Gets the bssid of this SystemInsightsWifiStatus. # noqa: E501 + + + :return: The bssid of this SystemInsightsWifiStatus. # noqa: E501 + :rtype: str + """ + return self._bssid + + @bssid.setter + def bssid(self, bssid): + """Sets the bssid of this SystemInsightsWifiStatus. + + + :param bssid: The bssid of this SystemInsightsWifiStatus. # noqa: E501 + :type: str + """ + + self._bssid = bssid + + @property + def channel(self): + """Gets the channel of this SystemInsightsWifiStatus. # noqa: E501 + + + :return: The channel of this SystemInsightsWifiStatus. # noqa: E501 + :rtype: float + """ + return self._channel + + @channel.setter + def channel(self, channel): + """Sets the channel of this SystemInsightsWifiStatus. + + + :param channel: The channel of this SystemInsightsWifiStatus. # noqa: E501 + :type: float + """ + + self._channel = channel + + @property + def channel_band(self): + """Gets the channel_band of this SystemInsightsWifiStatus. # noqa: E501 + + + :return: The channel_band of this SystemInsightsWifiStatus. # noqa: E501 + :rtype: float + """ + return self._channel_band + + @channel_band.setter + def channel_band(self, channel_band): + """Sets the channel_band of this SystemInsightsWifiStatus. + + + :param channel_band: The channel_band of this SystemInsightsWifiStatus. # noqa: E501 + :type: float + """ + + self._channel_band = channel_band + + @property + def channel_width(self): + """Gets the channel_width of this SystemInsightsWifiStatus. # noqa: E501 + + + :return: The channel_width of this SystemInsightsWifiStatus. # noqa: E501 + :rtype: float + """ + return self._channel_width + + @channel_width.setter + def channel_width(self, channel_width): + """Sets the channel_width of this SystemInsightsWifiStatus. + + + :param channel_width: The channel_width of this SystemInsightsWifiStatus. # noqa: E501 + :type: float + """ + + self._channel_width = channel_width + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsWifiStatus. # noqa: E501 + + + :return: The collection_time of this SystemInsightsWifiStatus. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsWifiStatus. + + + :param collection_time: The collection_time of this SystemInsightsWifiStatus. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def country_code(self): + """Gets the country_code of this SystemInsightsWifiStatus. # noqa: E501 + + + :return: The country_code of this SystemInsightsWifiStatus. # noqa: E501 + :rtype: str + """ + return self._country_code + + @country_code.setter + def country_code(self, country_code): + """Sets the country_code of this SystemInsightsWifiStatus. + + + :param country_code: The country_code of this SystemInsightsWifiStatus. # noqa: E501 + :type: str + """ + + self._country_code = country_code + + @property + def interface(self): + """Gets the interface of this SystemInsightsWifiStatus. # noqa: E501 + + + :return: The interface of this SystemInsightsWifiStatus. # noqa: E501 + :rtype: str + """ + return self._interface + + @interface.setter + def interface(self, interface): + """Sets the interface of this SystemInsightsWifiStatus. + + + :param interface: The interface of this SystemInsightsWifiStatus. # noqa: E501 + :type: str + """ + + self._interface = interface + + @property + def mode(self): + """Gets the mode of this SystemInsightsWifiStatus. # noqa: E501 + + + :return: The mode of this SystemInsightsWifiStatus. # noqa: E501 + :rtype: str + """ + return self._mode + + @mode.setter + def mode(self, mode): + """Sets the mode of this SystemInsightsWifiStatus. + + + :param mode: The mode of this SystemInsightsWifiStatus. # noqa: E501 + :type: str + """ + + self._mode = mode + + @property + def network_name(self): + """Gets the network_name of this SystemInsightsWifiStatus. # noqa: E501 + + + :return: The network_name of this SystemInsightsWifiStatus. # noqa: E501 + :rtype: str + """ + return self._network_name + + @network_name.setter + def network_name(self, network_name): + """Sets the network_name of this SystemInsightsWifiStatus. + + + :param network_name: The network_name of this SystemInsightsWifiStatus. # noqa: E501 + :type: str + """ + + self._network_name = network_name + + @property + def noise(self): + """Gets the noise of this SystemInsightsWifiStatus. # noqa: E501 + + + :return: The noise of this SystemInsightsWifiStatus. # noqa: E501 + :rtype: float + """ + return self._noise + + @noise.setter + def noise(self, noise): + """Sets the noise of this SystemInsightsWifiStatus. + + + :param noise: The noise of this SystemInsightsWifiStatus. # noqa: E501 + :type: float + """ + + self._noise = noise + + @property + def rssi(self): + """Gets the rssi of this SystemInsightsWifiStatus. # noqa: E501 + + + :return: The rssi of this SystemInsightsWifiStatus. # noqa: E501 + :rtype: float + """ + return self._rssi + + @rssi.setter + def rssi(self, rssi): + """Sets the rssi of this SystemInsightsWifiStatus. + + + :param rssi: The rssi of this SystemInsightsWifiStatus. # noqa: E501 + :type: float + """ + + self._rssi = rssi + + @property + def security_type(self): + """Gets the security_type of this SystemInsightsWifiStatus. # noqa: E501 + + + :return: The security_type of this SystemInsightsWifiStatus. # noqa: E501 + :rtype: str + """ + return self._security_type + + @security_type.setter + def security_type(self, security_type): + """Sets the security_type of this SystemInsightsWifiStatus. + + + :param security_type: The security_type of this SystemInsightsWifiStatus. # noqa: E501 + :type: str + """ + + self._security_type = security_type + + @property + def ssid(self): + """Gets the ssid of this SystemInsightsWifiStatus. # noqa: E501 + + + :return: The ssid of this SystemInsightsWifiStatus. # noqa: E501 + :rtype: str + """ + return self._ssid + + @ssid.setter + def ssid(self, ssid): + """Sets the ssid of this SystemInsightsWifiStatus. + + + :param ssid: The ssid of this SystemInsightsWifiStatus. # noqa: E501 + :type: str + """ + + self._ssid = ssid + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsWifiStatus. # noqa: E501 + + + :return: The system_id of this SystemInsightsWifiStatus. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsWifiStatus. + + + :param system_id: The system_id of this SystemInsightsWifiStatus. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def transmit_rate(self): + """Gets the transmit_rate of this SystemInsightsWifiStatus. # noqa: E501 + + + :return: The transmit_rate of this SystemInsightsWifiStatus. # noqa: E501 + :rtype: str + """ + return self._transmit_rate + + @transmit_rate.setter + def transmit_rate(self, transmit_rate): + """Sets the transmit_rate of this SystemInsightsWifiStatus. + + + :param transmit_rate: The transmit_rate of this SystemInsightsWifiStatus. # noqa: E501 + :type: str + """ + + self._transmit_rate = transmit_rate + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsWifiStatus, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsWifiStatus): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_windows_crashes.py b/jcapiv2/jcapiv2/models/system_insights_windows_crashes.py deleted file mode 100644 index 7eb5f6e..0000000 --- a/jcapiv2/jcapiv2/models/system_insights_windows_crashes.py +++ /dev/null @@ -1,635 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class SystemInsightsWindowsCrashes(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'build_number': 'int', - 'command_line': 'str', - 'crash_path': 'str', - 'current_directory': 'str', - '_datetime': 'str', - 'exception_address': 'str', - 'exception_code': 'str', - 'exception_message': 'str', - 'machine_name': 'str', - 'major_version': 'int', - 'minor_version': 'int', - 'module': 'str', - 'path': 'str', - 'pid': 'str', - 'process_uptime': 'str', - 'registers': 'str', - 'stack_trace': 'str', - 'tid': 'str', - 'type': 'str', - 'username': 'str', - 'version': 'str' - } - - attribute_map = { - 'build_number': 'build_number', - 'command_line': 'command_line', - 'crash_path': 'crash_path', - 'current_directory': 'current_directory', - '_datetime': 'datetime', - 'exception_address': 'exception_address', - 'exception_code': 'exception_code', - 'exception_message': 'exception_message', - 'machine_name': 'machine_name', - 'major_version': 'major_version', - 'minor_version': 'minor_version', - 'module': 'module', - 'path': 'path', - 'pid': 'pid', - 'process_uptime': 'process_uptime', - 'registers': 'registers', - 'stack_trace': 'stack_trace', - 'tid': 'tid', - 'type': 'type', - 'username': 'username', - 'version': 'version' - } - - def __init__(self, build_number=None, command_line=None, crash_path=None, current_directory=None, _datetime=None, exception_address=None, exception_code=None, exception_message=None, machine_name=None, major_version=None, minor_version=None, module=None, path=None, pid=None, process_uptime=None, registers=None, stack_trace=None, tid=None, type=None, username=None, version=None): # noqa: E501 - """SystemInsightsWindowsCrashes - a model defined in Swagger""" # noqa: E501 - - self._build_number = None - self._command_line = None - self._crash_path = None - self._current_directory = None - self.__datetime = None - self._exception_address = None - self._exception_code = None - self._exception_message = None - self._machine_name = None - self._major_version = None - self._minor_version = None - self._module = None - self._path = None - self._pid = None - self._process_uptime = None - self._registers = None - self._stack_trace = None - self._tid = None - self._type = None - self._username = None - self._version = None - self.discriminator = None - - if build_number is not None: - self.build_number = build_number - if command_line is not None: - self.command_line = command_line - if crash_path is not None: - self.crash_path = crash_path - if current_directory is not None: - self.current_directory = current_directory - if _datetime is not None: - self._datetime = _datetime - if exception_address is not None: - self.exception_address = exception_address - if exception_code is not None: - self.exception_code = exception_code - if exception_message is not None: - self.exception_message = exception_message - if machine_name is not None: - self.machine_name = machine_name - if major_version is not None: - self.major_version = major_version - if minor_version is not None: - self.minor_version = minor_version - if module is not None: - self.module = module - if path is not None: - self.path = path - if pid is not None: - self.pid = pid - if process_uptime is not None: - self.process_uptime = process_uptime - if registers is not None: - self.registers = registers - if stack_trace is not None: - self.stack_trace = stack_trace - if tid is not None: - self.tid = tid - if type is not None: - self.type = type - if username is not None: - self.username = username - if version is not None: - self.version = version - - @property - def build_number(self): - """Gets the build_number of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The build_number of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: int - """ - return self._build_number - - @build_number.setter - def build_number(self, build_number): - """Sets the build_number of this SystemInsightsWindowsCrashes. - - - :param build_number: The build_number of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: int - """ - - self._build_number = build_number - - @property - def command_line(self): - """Gets the command_line of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The command_line of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self._command_line - - @command_line.setter - def command_line(self, command_line): - """Sets the command_line of this SystemInsightsWindowsCrashes. - - - :param command_line: The command_line of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self._command_line = command_line - - @property - def crash_path(self): - """Gets the crash_path of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The crash_path of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self._crash_path - - @crash_path.setter - def crash_path(self, crash_path): - """Sets the crash_path of this SystemInsightsWindowsCrashes. - - - :param crash_path: The crash_path of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self._crash_path = crash_path - - @property - def current_directory(self): - """Gets the current_directory of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The current_directory of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self._current_directory - - @current_directory.setter - def current_directory(self, current_directory): - """Sets the current_directory of this SystemInsightsWindowsCrashes. - - - :param current_directory: The current_directory of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self._current_directory = current_directory - - @property - def _datetime(self): - """Gets the _datetime of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The _datetime of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self.__datetime - - @_datetime.setter - def _datetime(self, _datetime): - """Sets the _datetime of this SystemInsightsWindowsCrashes. - - - :param _datetime: The _datetime of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self.__datetime = _datetime - - @property - def exception_address(self): - """Gets the exception_address of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The exception_address of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self._exception_address - - @exception_address.setter - def exception_address(self, exception_address): - """Sets the exception_address of this SystemInsightsWindowsCrashes. - - - :param exception_address: The exception_address of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self._exception_address = exception_address - - @property - def exception_code(self): - """Gets the exception_code of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The exception_code of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self._exception_code - - @exception_code.setter - def exception_code(self, exception_code): - """Sets the exception_code of this SystemInsightsWindowsCrashes. - - - :param exception_code: The exception_code of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self._exception_code = exception_code - - @property - def exception_message(self): - """Gets the exception_message of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The exception_message of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self._exception_message - - @exception_message.setter - def exception_message(self, exception_message): - """Sets the exception_message of this SystemInsightsWindowsCrashes. - - - :param exception_message: The exception_message of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self._exception_message = exception_message - - @property - def machine_name(self): - """Gets the machine_name of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The machine_name of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self._machine_name - - @machine_name.setter - def machine_name(self, machine_name): - """Sets the machine_name of this SystemInsightsWindowsCrashes. - - - :param machine_name: The machine_name of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self._machine_name = machine_name - - @property - def major_version(self): - """Gets the major_version of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The major_version of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: int - """ - return self._major_version - - @major_version.setter - def major_version(self, major_version): - """Sets the major_version of this SystemInsightsWindowsCrashes. - - - :param major_version: The major_version of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: int - """ - - self._major_version = major_version - - @property - def minor_version(self): - """Gets the minor_version of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The minor_version of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: int - """ - return self._minor_version - - @minor_version.setter - def minor_version(self, minor_version): - """Sets the minor_version of this SystemInsightsWindowsCrashes. - - - :param minor_version: The minor_version of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: int - """ - - self._minor_version = minor_version - - @property - def module(self): - """Gets the module of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The module of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self._module - - @module.setter - def module(self, module): - """Sets the module of this SystemInsightsWindowsCrashes. - - - :param module: The module of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self._module = module - - @property - def path(self): - """Gets the path of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The path of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self._path - - @path.setter - def path(self, path): - """Sets the path of this SystemInsightsWindowsCrashes. - - - :param path: The path of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self._path = path - - @property - def pid(self): - """Gets the pid of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The pid of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self._pid - - @pid.setter - def pid(self, pid): - """Sets the pid of this SystemInsightsWindowsCrashes. - - - :param pid: The pid of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self._pid = pid - - @property - def process_uptime(self): - """Gets the process_uptime of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The process_uptime of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self._process_uptime - - @process_uptime.setter - def process_uptime(self, process_uptime): - """Sets the process_uptime of this SystemInsightsWindowsCrashes. - - - :param process_uptime: The process_uptime of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self._process_uptime = process_uptime - - @property - def registers(self): - """Gets the registers of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The registers of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self._registers - - @registers.setter - def registers(self, registers): - """Sets the registers of this SystemInsightsWindowsCrashes. - - - :param registers: The registers of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self._registers = registers - - @property - def stack_trace(self): - """Gets the stack_trace of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The stack_trace of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self._stack_trace - - @stack_trace.setter - def stack_trace(self, stack_trace): - """Sets the stack_trace of this SystemInsightsWindowsCrashes. - - - :param stack_trace: The stack_trace of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self._stack_trace = stack_trace - - @property - def tid(self): - """Gets the tid of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The tid of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self._tid - - @tid.setter - def tid(self, tid): - """Sets the tid of this SystemInsightsWindowsCrashes. - - - :param tid: The tid of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self._tid = tid - - @property - def type(self): - """Gets the type of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The type of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this SystemInsightsWindowsCrashes. - - - :param type: The type of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self._type = type - - @property - def username(self): - """Gets the username of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The username of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self._username - - @username.setter - def username(self, username): - """Sets the username of this SystemInsightsWindowsCrashes. - - - :param username: The username of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self._username = username - - @property - def version(self): - """Gets the version of this SystemInsightsWindowsCrashes. # noqa: E501 - - - :return: The version of this SystemInsightsWindowsCrashes. # noqa: E501 - :rtype: str - """ - return self._version - - @version.setter - def version(self, version): - """Sets the version of this SystemInsightsWindowsCrashes. - - - :param version: The version of this SystemInsightsWindowsCrashes. # noqa: E501 - :type: str - """ - - self._version = version - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SystemInsightsWindowsCrashes, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SystemInsightsWindowsCrashes): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_windows_security_center.py b/jcapiv2/jcapiv2/models/system_insights_windows_security_center.py new file mode 100644 index 0000000..ba28186 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_windows_security_center.py @@ -0,0 +1,318 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsWindowsSecurityCenter(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'antispyware': 'str', + 'antivirus': 'str', + 'autoupdate': 'str', + 'collection_time': 'str', + 'firewall': 'str', + 'internet_settings': 'str', + 'system_id': 'str', + 'user_account_control': 'str', + 'windows_security_center_service': 'str' + } + + attribute_map = { + 'antispyware': 'antispyware', + 'antivirus': 'antivirus', + 'autoupdate': 'autoupdate', + 'collection_time': 'collection_time', + 'firewall': 'firewall', + 'internet_settings': 'internet_settings', + 'system_id': 'system_id', + 'user_account_control': 'user_account_control', + 'windows_security_center_service': 'windows_security_center_service' + } + + def __init__(self, antispyware=None, antivirus=None, autoupdate=None, collection_time=None, firewall=None, internet_settings=None, system_id=None, user_account_control=None, windows_security_center_service=None): # noqa: E501 + """SystemInsightsWindowsSecurityCenter - a model defined in Swagger""" # noqa: E501 + self._antispyware = None + self._antivirus = None + self._autoupdate = None + self._collection_time = None + self._firewall = None + self._internet_settings = None + self._system_id = None + self._user_account_control = None + self._windows_security_center_service = None + self.discriminator = None + if antispyware is not None: + self.antispyware = antispyware + if antivirus is not None: + self.antivirus = antivirus + if autoupdate is not None: + self.autoupdate = autoupdate + if collection_time is not None: + self.collection_time = collection_time + if firewall is not None: + self.firewall = firewall + if internet_settings is not None: + self.internet_settings = internet_settings + if system_id is not None: + self.system_id = system_id + if user_account_control is not None: + self.user_account_control = user_account_control + if windows_security_center_service is not None: + self.windows_security_center_service = windows_security_center_service + + @property + def antispyware(self): + """Gets the antispyware of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + + + :return: The antispyware of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :rtype: str + """ + return self._antispyware + + @antispyware.setter + def antispyware(self, antispyware): + """Sets the antispyware of this SystemInsightsWindowsSecurityCenter. + + + :param antispyware: The antispyware of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :type: str + """ + + self._antispyware = antispyware + + @property + def antivirus(self): + """Gets the antivirus of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + + + :return: The antivirus of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :rtype: str + """ + return self._antivirus + + @antivirus.setter + def antivirus(self, antivirus): + """Sets the antivirus of this SystemInsightsWindowsSecurityCenter. + + + :param antivirus: The antivirus of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :type: str + """ + + self._antivirus = antivirus + + @property + def autoupdate(self): + """Gets the autoupdate of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + + + :return: The autoupdate of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :rtype: str + """ + return self._autoupdate + + @autoupdate.setter + def autoupdate(self, autoupdate): + """Sets the autoupdate of this SystemInsightsWindowsSecurityCenter. + + + :param autoupdate: The autoupdate of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :type: str + """ + + self._autoupdate = autoupdate + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + + + :return: The collection_time of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsWindowsSecurityCenter. + + + :param collection_time: The collection_time of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def firewall(self): + """Gets the firewall of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + + + :return: The firewall of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :rtype: str + """ + return self._firewall + + @firewall.setter + def firewall(self, firewall): + """Sets the firewall of this SystemInsightsWindowsSecurityCenter. + + + :param firewall: The firewall of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :type: str + """ + + self._firewall = firewall + + @property + def internet_settings(self): + """Gets the internet_settings of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + + + :return: The internet_settings of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :rtype: str + """ + return self._internet_settings + + @internet_settings.setter + def internet_settings(self, internet_settings): + """Sets the internet_settings of this SystemInsightsWindowsSecurityCenter. + + + :param internet_settings: The internet_settings of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :type: str + """ + + self._internet_settings = internet_settings + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + + + :return: The system_id of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsWindowsSecurityCenter. + + + :param system_id: The system_id of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def user_account_control(self): + """Gets the user_account_control of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + + + :return: The user_account_control of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :rtype: str + """ + return self._user_account_control + + @user_account_control.setter + def user_account_control(self, user_account_control): + """Sets the user_account_control of this SystemInsightsWindowsSecurityCenter. + + + :param user_account_control: The user_account_control of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :type: str + """ + + self._user_account_control = user_account_control + + @property + def windows_security_center_service(self): + """Gets the windows_security_center_service of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + + + :return: The windows_security_center_service of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :rtype: str + """ + return self._windows_security_center_service + + @windows_security_center_service.setter + def windows_security_center_service(self, windows_security_center_service): + """Sets the windows_security_center_service of this SystemInsightsWindowsSecurityCenter. + + + :param windows_security_center_service: The windows_security_center_service of this SystemInsightsWindowsSecurityCenter. # noqa: E501 + :type: str + """ + + self._windows_security_center_service = windows_security_center_service + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsWindowsSecurityCenter, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsWindowsSecurityCenter): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/system_insights_windows_security_products.py b/jcapiv2/jcapiv2/models/system_insights_windows_security_products.py new file mode 100644 index 0000000..7026d54 --- /dev/null +++ b/jcapiv2/jcapiv2/models/system_insights_windows_security_products.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SystemInsightsWindowsSecurityProducts(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'collection_time': 'str', + 'name': 'str', + 'remediation_path': 'str', + 'signatures_up_to_date': 'float', + 'state': 'str', + 'state_timestamp': 'str', + 'system_id': 'str', + 'type': 'str' + } + + attribute_map = { + 'collection_time': 'collection_time', + 'name': 'name', + 'remediation_path': 'remediation_path', + 'signatures_up_to_date': 'signatures_up_to_date', + 'state': 'state', + 'state_timestamp': 'state_timestamp', + 'system_id': 'system_id', + 'type': 'type' + } + + def __init__(self, collection_time=None, name=None, remediation_path=None, signatures_up_to_date=None, state=None, state_timestamp=None, system_id=None, type=None): # noqa: E501 + """SystemInsightsWindowsSecurityProducts - a model defined in Swagger""" # noqa: E501 + self._collection_time = None + self._name = None + self._remediation_path = None + self._signatures_up_to_date = None + self._state = None + self._state_timestamp = None + self._system_id = None + self._type = None + self.discriminator = None + if collection_time is not None: + self.collection_time = collection_time + if name is not None: + self.name = name + if remediation_path is not None: + self.remediation_path = remediation_path + if signatures_up_to_date is not None: + self.signatures_up_to_date = signatures_up_to_date + if state is not None: + self.state = state + if state_timestamp is not None: + self.state_timestamp = state_timestamp + if system_id is not None: + self.system_id = system_id + if type is not None: + self.type = type + + @property + def collection_time(self): + """Gets the collection_time of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + + + :return: The collection_time of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + :rtype: str + """ + return self._collection_time + + @collection_time.setter + def collection_time(self, collection_time): + """Sets the collection_time of this SystemInsightsWindowsSecurityProducts. + + + :param collection_time: The collection_time of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + :type: str + """ + + self._collection_time = collection_time + + @property + def name(self): + """Gets the name of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + + + :return: The name of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SystemInsightsWindowsSecurityProducts. + + + :param name: The name of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def remediation_path(self): + """Gets the remediation_path of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + + + :return: The remediation_path of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + :rtype: str + """ + return self._remediation_path + + @remediation_path.setter + def remediation_path(self, remediation_path): + """Sets the remediation_path of this SystemInsightsWindowsSecurityProducts. + + + :param remediation_path: The remediation_path of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + :type: str + """ + + self._remediation_path = remediation_path + + @property + def signatures_up_to_date(self): + """Gets the signatures_up_to_date of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + + + :return: The signatures_up_to_date of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + :rtype: float + """ + return self._signatures_up_to_date + + @signatures_up_to_date.setter + def signatures_up_to_date(self, signatures_up_to_date): + """Sets the signatures_up_to_date of this SystemInsightsWindowsSecurityProducts. + + + :param signatures_up_to_date: The signatures_up_to_date of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + :type: float + """ + + self._signatures_up_to_date = signatures_up_to_date + + @property + def state(self): + """Gets the state of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + + + :return: The state of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this SystemInsightsWindowsSecurityProducts. + + + :param state: The state of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + :type: str + """ + + self._state = state + + @property + def state_timestamp(self): + """Gets the state_timestamp of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + + + :return: The state_timestamp of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + :rtype: str + """ + return self._state_timestamp + + @state_timestamp.setter + def state_timestamp(self, state_timestamp): + """Sets the state_timestamp of this SystemInsightsWindowsSecurityProducts. + + + :param state_timestamp: The state_timestamp of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + :type: str + """ + + self._state_timestamp = state_timestamp + + @property + def system_id(self): + """Gets the system_id of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + + + :return: The system_id of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + :rtype: str + """ + return self._system_id + + @system_id.setter + def system_id(self, system_id): + """Sets the system_id of this SystemInsightsWindowsSecurityProducts. + + + :param system_id: The system_id of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + :type: str + """ + + self._system_id = system_id + + @property + def type(self): + """Gets the type of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + + + :return: The type of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this SystemInsightsWindowsSecurityProducts. + + + :param type: The type of this SystemInsightsWindowsSecurityProducts. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SystemInsightsWindowsSecurityProducts, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SystemInsightsWindowsSecurityProducts): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/systemfdekey.py b/jcapiv2/jcapiv2/models/systemfdekey.py index d421307..775ac32 100644 --- a/jcapiv2/jcapiv2/models/systemfdekey.py +++ b/jcapiv2/jcapiv2/models/systemfdekey.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class Systemfdekey(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -40,10 +37,8 @@ class Systemfdekey(object): def __init__(self, key=None): # noqa: E501 """Systemfdekey - a model defined in Swagger""" # noqa: E501 - self._key = None self.discriminator = None - self.key = key @property diff --git a/jcapiv2/jcapiv2/models/systemuser.py b/jcapiv2/jcapiv2/models/systemuser.py deleted file mode 100644 index 2b043a0..0000000 --- a/jcapiv2/jcapiv2/models/systemuser.py +++ /dev/null @@ -1,1194 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - -from jcapiv2.models.mfa import Mfa # noqa: F401,E501 -from jcapiv2.models.sshkeylist import Sshkeylist # noqa: F401,E501 - - -class Systemuser(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'str', - 'account_locked': 'bool', - 'activated': 'bool', - 'allow_public_key': 'bool', - 'associated_tag_count': 'int', - 'attributes': 'list[object]', - 'company': 'str', - 'cost_center': 'str', - 'created': 'str', - 'department': 'str', - 'description': 'str', - 'displayname': 'str', - 'email': 'str', - 'employee_identifier': 'str', - 'employee_type': 'str', - 'enable_managed_uid': 'bool', - 'enable_user_portal_multifactor': 'bool', - 'external_dn': 'str', - 'external_source_type': 'str', - 'externally_managed': 'bool', - 'firstname': 'str', - 'job_title': 'str', - 'lastname': 'str', - 'ldap_binding_user': 'bool', - 'location': 'str', - 'mfa': 'Mfa', - 'middlename': 'str', - 'password_expiration_date': 'str', - 'password_expired': 'bool', - 'password_never_expires': 'bool', - 'passwordless_sudo': 'bool', - 'public_key': 'str', - 'samba_service_user': 'bool', - 'ssh_keys': 'list[Sshkeylist]', - 'sudo': 'bool', - 'suspended': 'bool', - 'tags': 'list[str]', - 'totp_enabled': 'bool', - 'unix_guid': 'int', - 'unix_uid': 'int', - 'username': 'str' - } - - attribute_map = { - 'id': '_id', - 'account_locked': 'account_locked', - 'activated': 'activated', - 'allow_public_key': 'allow_public_key', - 'associated_tag_count': 'associatedTagCount', - 'attributes': 'attributes', - 'company': 'company', - 'cost_center': 'costCenter', - 'created': 'created', - 'department': 'department', - 'description': 'description', - 'displayname': 'displayname', - 'email': 'email', - 'employee_identifier': 'employeeIdentifier', - 'employee_type': 'employeeType', - 'enable_managed_uid': 'enable_managed_uid', - 'enable_user_portal_multifactor': 'enable_user_portal_multifactor', - 'external_dn': 'external_dn', - 'external_source_type': 'external_source_type', - 'externally_managed': 'externally_managed', - 'firstname': 'firstname', - 'job_title': 'jobTitle', - 'lastname': 'lastname', - 'ldap_binding_user': 'ldap_binding_user', - 'location': 'location', - 'mfa': 'mfa', - 'middlename': 'middlename', - 'password_expiration_date': 'password_expiration_date', - 'password_expired': 'password_expired', - 'password_never_expires': 'password_never_expires', - 'passwordless_sudo': 'passwordless_sudo', - 'public_key': 'public_key', - 'samba_service_user': 'samba_service_user', - 'ssh_keys': 'ssh_keys', - 'sudo': 'sudo', - 'suspended': 'suspended', - 'tags': 'tags', - 'totp_enabled': 'totp_enabled', - 'unix_guid': 'unix_guid', - 'unix_uid': 'unix_uid', - 'username': 'username' - } - - def __init__(self, id=None, account_locked=None, activated=None, allow_public_key=None, associated_tag_count=None, attributes=None, company=None, cost_center=None, created=None, department=None, description=None, displayname=None, email=None, employee_identifier=None, employee_type=None, enable_managed_uid=None, enable_user_portal_multifactor=None, external_dn=None, external_source_type=None, externally_managed=None, firstname=None, job_title=None, lastname=None, ldap_binding_user=None, location=None, mfa=None, middlename=None, password_expiration_date=None, password_expired=None, password_never_expires=None, passwordless_sudo=None, public_key=None, samba_service_user=None, ssh_keys=None, sudo=None, suspended=None, tags=None, totp_enabled=None, unix_guid=None, unix_uid=None, username=None): # noqa: E501 - """Systemuser - a model defined in Swagger""" # noqa: E501 - - self._id = None - self._account_locked = None - self._activated = None - self._allow_public_key = None - self._associated_tag_count = None - self._attributes = None - self._company = None - self._cost_center = None - self._created = None - self._department = None - self._description = None - self._displayname = None - self._email = None - self._employee_identifier = None - self._employee_type = None - self._enable_managed_uid = None - self._enable_user_portal_multifactor = None - self._external_dn = None - self._external_source_type = None - self._externally_managed = None - self._firstname = None - self._job_title = None - self._lastname = None - self._ldap_binding_user = None - self._location = None - self._mfa = None - self._middlename = None - self._password_expiration_date = None - self._password_expired = None - self._password_never_expires = None - self._passwordless_sudo = None - self._public_key = None - self._samba_service_user = None - self._ssh_keys = None - self._sudo = None - self._suspended = None - self._tags = None - self._totp_enabled = None - self._unix_guid = None - self._unix_uid = None - self._username = None - self.discriminator = None - - if id is not None: - self.id = id - if account_locked is not None: - self.account_locked = account_locked - if activated is not None: - self.activated = activated - if allow_public_key is not None: - self.allow_public_key = allow_public_key - if associated_tag_count is not None: - self.associated_tag_count = associated_tag_count - if attributes is not None: - self.attributes = attributes - if company is not None: - self.company = company - if cost_center is not None: - self.cost_center = cost_center - if created is not None: - self.created = created - if department is not None: - self.department = department - if description is not None: - self.description = description - if displayname is not None: - self.displayname = displayname - if email is not None: - self.email = email - if employee_identifier is not None: - self.employee_identifier = employee_identifier - if employee_type is not None: - self.employee_type = employee_type - if enable_managed_uid is not None: - self.enable_managed_uid = enable_managed_uid - if enable_user_portal_multifactor is not None: - self.enable_user_portal_multifactor = enable_user_portal_multifactor - if external_dn is not None: - self.external_dn = external_dn - if external_source_type is not None: - self.external_source_type = external_source_type - if externally_managed is not None: - self.externally_managed = externally_managed - if firstname is not None: - self.firstname = firstname - if job_title is not None: - self.job_title = job_title - if lastname is not None: - self.lastname = lastname - if ldap_binding_user is not None: - self.ldap_binding_user = ldap_binding_user - if location is not None: - self.location = location - if mfa is not None: - self.mfa = mfa - if middlename is not None: - self.middlename = middlename - if password_expiration_date is not None: - self.password_expiration_date = password_expiration_date - if password_expired is not None: - self.password_expired = password_expired - if password_never_expires is not None: - self.password_never_expires = password_never_expires - if passwordless_sudo is not None: - self.passwordless_sudo = passwordless_sudo - if public_key is not None: - self.public_key = public_key - if samba_service_user is not None: - self.samba_service_user = samba_service_user - if ssh_keys is not None: - self.ssh_keys = ssh_keys - if sudo is not None: - self.sudo = sudo - if suspended is not None: - self.suspended = suspended - if tags is not None: - self.tags = tags - if totp_enabled is not None: - self.totp_enabled = totp_enabled - if unix_guid is not None: - self.unix_guid = unix_guid - if unix_uid is not None: - self.unix_uid = unix_uid - if username is not None: - self.username = username - - @property - def id(self): - """Gets the id of this Systemuser. # noqa: E501 - - - :return: The id of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Systemuser. - - - :param id: The id of this Systemuser. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def account_locked(self): - """Gets the account_locked of this Systemuser. # noqa: E501 - - - :return: The account_locked of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._account_locked - - @account_locked.setter - def account_locked(self, account_locked): - """Sets the account_locked of this Systemuser. - - - :param account_locked: The account_locked of this Systemuser. # noqa: E501 - :type: bool - """ - - self._account_locked = account_locked - - @property - def activated(self): - """Gets the activated of this Systemuser. # noqa: E501 - - - :return: The activated of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._activated - - @activated.setter - def activated(self, activated): - """Sets the activated of this Systemuser. - - - :param activated: The activated of this Systemuser. # noqa: E501 - :type: bool - """ - - self._activated = activated - - @property - def allow_public_key(self): - """Gets the allow_public_key of this Systemuser. # noqa: E501 - - - :return: The allow_public_key of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._allow_public_key - - @allow_public_key.setter - def allow_public_key(self, allow_public_key): - """Sets the allow_public_key of this Systemuser. - - - :param allow_public_key: The allow_public_key of this Systemuser. # noqa: E501 - :type: bool - """ - - self._allow_public_key = allow_public_key - - @property - def associated_tag_count(self): - """Gets the associated_tag_count of this Systemuser. # noqa: E501 - - - :return: The associated_tag_count of this Systemuser. # noqa: E501 - :rtype: int - """ - return self._associated_tag_count - - @associated_tag_count.setter - def associated_tag_count(self, associated_tag_count): - """Sets the associated_tag_count of this Systemuser. - - - :param associated_tag_count: The associated_tag_count of this Systemuser. # noqa: E501 - :type: int - """ - if associated_tag_count is not None and associated_tag_count < 0: # noqa: E501 - raise ValueError("Invalid value for `associated_tag_count`, must be a value greater than or equal to `0`") # noqa: E501 - - self._associated_tag_count = associated_tag_count - - @property - def attributes(self): - """Gets the attributes of this Systemuser. # noqa: E501 - - - :return: The attributes of this Systemuser. # noqa: E501 - :rtype: list[object] - """ - return self._attributes - - @attributes.setter - def attributes(self, attributes): - """Sets the attributes of this Systemuser. - - - :param attributes: The attributes of this Systemuser. # noqa: E501 - :type: list[object] - """ - - self._attributes = attributes - - @property - def company(self): - """Gets the company of this Systemuser. # noqa: E501 - - - :return: The company of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._company - - @company.setter - def company(self, company): - """Sets the company of this Systemuser. - - - :param company: The company of this Systemuser. # noqa: E501 - :type: str - """ - if company is not None and len(company) > 1024: - raise ValueError("Invalid value for `company`, length must be less than or equal to `1024`") # noqa: E501 - - self._company = company - - @property - def cost_center(self): - """Gets the cost_center of this Systemuser. # noqa: E501 - - - :return: The cost_center of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._cost_center - - @cost_center.setter - def cost_center(self, cost_center): - """Sets the cost_center of this Systemuser. - - - :param cost_center: The cost_center of this Systemuser. # noqa: E501 - :type: str - """ - if cost_center is not None and len(cost_center) > 1024: - raise ValueError("Invalid value for `cost_center`, length must be less than or equal to `1024`") # noqa: E501 - - self._cost_center = cost_center - - @property - def created(self): - """Gets the created of this Systemuser. # noqa: E501 - - - :return: The created of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._created - - @created.setter - def created(self, created): - """Sets the created of this Systemuser. - - - :param created: The created of this Systemuser. # noqa: E501 - :type: str - """ - - self._created = created - - @property - def department(self): - """Gets the department of this Systemuser. # noqa: E501 - - - :return: The department of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._department - - @department.setter - def department(self, department): - """Sets the department of this Systemuser. - - - :param department: The department of this Systemuser. # noqa: E501 - :type: str - """ - if department is not None and len(department) > 1024: - raise ValueError("Invalid value for `department`, length must be less than or equal to `1024`") # noqa: E501 - - self._department = department - - @property - def description(self): - """Gets the description of this Systemuser. # noqa: E501 - - - :return: The description of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this Systemuser. - - - :param description: The description of this Systemuser. # noqa: E501 - :type: str - """ - if description is not None and len(description) > 1024: - raise ValueError("Invalid value for `description`, length must be less than or equal to `1024`") # noqa: E501 - - self._description = description - - @property - def displayname(self): - """Gets the displayname of this Systemuser. # noqa: E501 - - - :return: The displayname of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._displayname - - @displayname.setter - def displayname(self, displayname): - """Sets the displayname of this Systemuser. - - - :param displayname: The displayname of this Systemuser. # noqa: E501 - :type: str - """ - if displayname is not None and len(displayname) > 1024: - raise ValueError("Invalid value for `displayname`, length must be less than or equal to `1024`") # noqa: E501 - - self._displayname = displayname - - @property - def email(self): - """Gets the email of this Systemuser. # noqa: E501 - - - :return: The email of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._email - - @email.setter - def email(self, email): - """Sets the email of this Systemuser. - - - :param email: The email of this Systemuser. # noqa: E501 - :type: str - """ - if email is not None and len(email) > 1024: - raise ValueError("Invalid value for `email`, length must be less than or equal to `1024`") # noqa: E501 - - self._email = email - - @property - def employee_identifier(self): - """Gets the employee_identifier of this Systemuser. # noqa: E501 - - Must be unique per user. # noqa: E501 - - :return: The employee_identifier of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._employee_identifier - - @employee_identifier.setter - def employee_identifier(self, employee_identifier): - """Sets the employee_identifier of this Systemuser. - - Must be unique per user. # noqa: E501 - - :param employee_identifier: The employee_identifier of this Systemuser. # noqa: E501 - :type: str - """ - if employee_identifier is not None and len(employee_identifier) > 256: - raise ValueError("Invalid value for `employee_identifier`, length must be less than or equal to `256`") # noqa: E501 - - self._employee_identifier = employee_identifier - - @property - def employee_type(self): - """Gets the employee_type of this Systemuser. # noqa: E501 - - - :return: The employee_type of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._employee_type - - @employee_type.setter - def employee_type(self, employee_type): - """Sets the employee_type of this Systemuser. - - - :param employee_type: The employee_type of this Systemuser. # noqa: E501 - :type: str - """ - if employee_type is not None and len(employee_type) > 1024: - raise ValueError("Invalid value for `employee_type`, length must be less than or equal to `1024`") # noqa: E501 - - self._employee_type = employee_type - - @property - def enable_managed_uid(self): - """Gets the enable_managed_uid of this Systemuser. # noqa: E501 - - - :return: The enable_managed_uid of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._enable_managed_uid - - @enable_managed_uid.setter - def enable_managed_uid(self, enable_managed_uid): - """Sets the enable_managed_uid of this Systemuser. - - - :param enable_managed_uid: The enable_managed_uid of this Systemuser. # noqa: E501 - :type: bool - """ - - self._enable_managed_uid = enable_managed_uid - - @property - def enable_user_portal_multifactor(self): - """Gets the enable_user_portal_multifactor of this Systemuser. # noqa: E501 - - - :return: The enable_user_portal_multifactor of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._enable_user_portal_multifactor - - @enable_user_portal_multifactor.setter - def enable_user_portal_multifactor(self, enable_user_portal_multifactor): - """Sets the enable_user_portal_multifactor of this Systemuser. - - - :param enable_user_portal_multifactor: The enable_user_portal_multifactor of this Systemuser. # noqa: E501 - :type: bool - """ - - self._enable_user_portal_multifactor = enable_user_portal_multifactor - - @property - def external_dn(self): - """Gets the external_dn of this Systemuser. # noqa: E501 - - - :return: The external_dn of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._external_dn - - @external_dn.setter - def external_dn(self, external_dn): - """Sets the external_dn of this Systemuser. - - - :param external_dn: The external_dn of this Systemuser. # noqa: E501 - :type: str - """ - - self._external_dn = external_dn - - @property - def external_source_type(self): - """Gets the external_source_type of this Systemuser. # noqa: E501 - - - :return: The external_source_type of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._external_source_type - - @external_source_type.setter - def external_source_type(self, external_source_type): - """Sets the external_source_type of this Systemuser. - - - :param external_source_type: The external_source_type of this Systemuser. # noqa: E501 - :type: str - """ - - self._external_source_type = external_source_type - - @property - def externally_managed(self): - """Gets the externally_managed of this Systemuser. # noqa: E501 - - - :return: The externally_managed of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._externally_managed - - @externally_managed.setter - def externally_managed(self, externally_managed): - """Sets the externally_managed of this Systemuser. - - - :param externally_managed: The externally_managed of this Systemuser. # noqa: E501 - :type: bool - """ - - self._externally_managed = externally_managed - - @property - def firstname(self): - """Gets the firstname of this Systemuser. # noqa: E501 - - - :return: The firstname of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._firstname - - @firstname.setter - def firstname(self, firstname): - """Sets the firstname of this Systemuser. - - - :param firstname: The firstname of this Systemuser. # noqa: E501 - :type: str - """ - if firstname is not None and len(firstname) > 1024: - raise ValueError("Invalid value for `firstname`, length must be less than or equal to `1024`") # noqa: E501 - - self._firstname = firstname - - @property - def job_title(self): - """Gets the job_title of this Systemuser. # noqa: E501 - - - :return: The job_title of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._job_title - - @job_title.setter - def job_title(self, job_title): - """Sets the job_title of this Systemuser. - - - :param job_title: The job_title of this Systemuser. # noqa: E501 - :type: str - """ - if job_title is not None and len(job_title) > 1024: - raise ValueError("Invalid value for `job_title`, length must be less than or equal to `1024`") # noqa: E501 - - self._job_title = job_title - - @property - def lastname(self): - """Gets the lastname of this Systemuser. # noqa: E501 - - - :return: The lastname of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._lastname - - @lastname.setter - def lastname(self, lastname): - """Sets the lastname of this Systemuser. - - - :param lastname: The lastname of this Systemuser. # noqa: E501 - :type: str - """ - if lastname is not None and len(lastname) > 1024: - raise ValueError("Invalid value for `lastname`, length must be less than or equal to `1024`") # noqa: E501 - - self._lastname = lastname - - @property - def ldap_binding_user(self): - """Gets the ldap_binding_user of this Systemuser. # noqa: E501 - - - :return: The ldap_binding_user of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._ldap_binding_user - - @ldap_binding_user.setter - def ldap_binding_user(self, ldap_binding_user): - """Sets the ldap_binding_user of this Systemuser. - - - :param ldap_binding_user: The ldap_binding_user of this Systemuser. # noqa: E501 - :type: bool - """ - - self._ldap_binding_user = ldap_binding_user - - @property - def location(self): - """Gets the location of this Systemuser. # noqa: E501 - - - :return: The location of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._location - - @location.setter - def location(self, location): - """Sets the location of this Systemuser. - - - :param location: The location of this Systemuser. # noqa: E501 - :type: str - """ - if location is not None and len(location) > 1024: - raise ValueError("Invalid value for `location`, length must be less than or equal to `1024`") # noqa: E501 - - self._location = location - - @property - def mfa(self): - """Gets the mfa of this Systemuser. # noqa: E501 - - - :return: The mfa of this Systemuser. # noqa: E501 - :rtype: Mfa - """ - return self._mfa - - @mfa.setter - def mfa(self, mfa): - """Sets the mfa of this Systemuser. - - - :param mfa: The mfa of this Systemuser. # noqa: E501 - :type: Mfa - """ - - self._mfa = mfa - - @property - def middlename(self): - """Gets the middlename of this Systemuser. # noqa: E501 - - - :return: The middlename of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._middlename - - @middlename.setter - def middlename(self, middlename): - """Sets the middlename of this Systemuser. - - - :param middlename: The middlename of this Systemuser. # noqa: E501 - :type: str - """ - if middlename is not None and len(middlename) > 1024: - raise ValueError("Invalid value for `middlename`, length must be less than or equal to `1024`") # noqa: E501 - - self._middlename = middlename - - @property - def password_expiration_date(self): - """Gets the password_expiration_date of this Systemuser. # noqa: E501 - - - :return: The password_expiration_date of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._password_expiration_date - - @password_expiration_date.setter - def password_expiration_date(self, password_expiration_date): - """Sets the password_expiration_date of this Systemuser. - - - :param password_expiration_date: The password_expiration_date of this Systemuser. # noqa: E501 - :type: str - """ - - self._password_expiration_date = password_expiration_date - - @property - def password_expired(self): - """Gets the password_expired of this Systemuser. # noqa: E501 - - - :return: The password_expired of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._password_expired - - @password_expired.setter - def password_expired(self, password_expired): - """Sets the password_expired of this Systemuser. - - - :param password_expired: The password_expired of this Systemuser. # noqa: E501 - :type: bool - """ - - self._password_expired = password_expired - - @property - def password_never_expires(self): - """Gets the password_never_expires of this Systemuser. # noqa: E501 - - - :return: The password_never_expires of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._password_never_expires - - @password_never_expires.setter - def password_never_expires(self, password_never_expires): - """Sets the password_never_expires of this Systemuser. - - - :param password_never_expires: The password_never_expires of this Systemuser. # noqa: E501 - :type: bool - """ - - self._password_never_expires = password_never_expires - - @property - def passwordless_sudo(self): - """Gets the passwordless_sudo of this Systemuser. # noqa: E501 - - - :return: The passwordless_sudo of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._passwordless_sudo - - @passwordless_sudo.setter - def passwordless_sudo(self, passwordless_sudo): - """Sets the passwordless_sudo of this Systemuser. - - - :param passwordless_sudo: The passwordless_sudo of this Systemuser. # noqa: E501 - :type: bool - """ - - self._passwordless_sudo = passwordless_sudo - - @property - def public_key(self): - """Gets the public_key of this Systemuser. # noqa: E501 - - - :return: The public_key of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._public_key - - @public_key.setter - def public_key(self, public_key): - """Sets the public_key of this Systemuser. - - - :param public_key: The public_key of this Systemuser. # noqa: E501 - :type: str - """ - - self._public_key = public_key - - @property - def samba_service_user(self): - """Gets the samba_service_user of this Systemuser. # noqa: E501 - - - :return: The samba_service_user of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._samba_service_user - - @samba_service_user.setter - def samba_service_user(self, samba_service_user): - """Sets the samba_service_user of this Systemuser. - - - :param samba_service_user: The samba_service_user of this Systemuser. # noqa: E501 - :type: bool - """ - - self._samba_service_user = samba_service_user - - @property - def ssh_keys(self): - """Gets the ssh_keys of this Systemuser. # noqa: E501 - - - :return: The ssh_keys of this Systemuser. # noqa: E501 - :rtype: list[Sshkeylist] - """ - return self._ssh_keys - - @ssh_keys.setter - def ssh_keys(self, ssh_keys): - """Sets the ssh_keys of this Systemuser. - - - :param ssh_keys: The ssh_keys of this Systemuser. # noqa: E501 - :type: list[Sshkeylist] - """ - - self._ssh_keys = ssh_keys - - @property - def sudo(self): - """Gets the sudo of this Systemuser. # noqa: E501 - - - :return: The sudo of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._sudo - - @sudo.setter - def sudo(self, sudo): - """Sets the sudo of this Systemuser. - - - :param sudo: The sudo of this Systemuser. # noqa: E501 - :type: bool - """ - - self._sudo = sudo - - @property - def suspended(self): - """Gets the suspended of this Systemuser. # noqa: E501 - - - :return: The suspended of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._suspended - - @suspended.setter - def suspended(self, suspended): - """Sets the suspended of this Systemuser. - - - :param suspended: The suspended of this Systemuser. # noqa: E501 - :type: bool - """ - - self._suspended = suspended - - @property - def tags(self): - """Gets the tags of this Systemuser. # noqa: E501 - - - :return: The tags of this Systemuser. # noqa: E501 - :rtype: list[str] - """ - return self._tags - - @tags.setter - def tags(self, tags): - """Sets the tags of this Systemuser. - - - :param tags: The tags of this Systemuser. # noqa: E501 - :type: list[str] - """ - - self._tags = tags - - @property - def totp_enabled(self): - """Gets the totp_enabled of this Systemuser. # noqa: E501 - - - :return: The totp_enabled of this Systemuser. # noqa: E501 - :rtype: bool - """ - return self._totp_enabled - - @totp_enabled.setter - def totp_enabled(self, totp_enabled): - """Sets the totp_enabled of this Systemuser. - - - :param totp_enabled: The totp_enabled of this Systemuser. # noqa: E501 - :type: bool - """ - - self._totp_enabled = totp_enabled - - @property - def unix_guid(self): - """Gets the unix_guid of this Systemuser. # noqa: E501 - - - :return: The unix_guid of this Systemuser. # noqa: E501 - :rtype: int - """ - return self._unix_guid - - @unix_guid.setter - def unix_guid(self, unix_guid): - """Sets the unix_guid of this Systemuser. - - - :param unix_guid: The unix_guid of this Systemuser. # noqa: E501 - :type: int - """ - if unix_guid is not None and unix_guid < 1: # noqa: E501 - raise ValueError("Invalid value for `unix_guid`, must be a value greater than or equal to `1`") # noqa: E501 - - self._unix_guid = unix_guid - - @property - def unix_uid(self): - """Gets the unix_uid of this Systemuser. # noqa: E501 - - - :return: The unix_uid of this Systemuser. # noqa: E501 - :rtype: int - """ - return self._unix_uid - - @unix_uid.setter - def unix_uid(self, unix_uid): - """Sets the unix_uid of this Systemuser. - - - :param unix_uid: The unix_uid of this Systemuser. # noqa: E501 - :type: int - """ - if unix_uid is not None and unix_uid < 1: # noqa: E501 - raise ValueError("Invalid value for `unix_uid`, must be a value greater than or equal to `1`") # noqa: E501 - - self._unix_uid = unix_uid - - @property - def username(self): - """Gets the username of this Systemuser. # noqa: E501 - - - :return: The username of this Systemuser. # noqa: E501 - :rtype: str - """ - return self._username - - @username.setter - def username(self, username): - """Sets the username of this Systemuser. - - - :param username: The username of this Systemuser. # noqa: E501 - :type: str - """ - if username is not None and len(username) > 1024: - raise ValueError("Invalid value for `username`, length must be less than or equal to `1024`") # noqa: E501 - - self._username = username - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Systemuser, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Systemuser): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/systemuserputpost.py b/jcapiv2/jcapiv2/models/systemuserputpost.py deleted file mode 100644 index 23ab8c2..0000000 --- a/jcapiv2/jcapiv2/models/systemuserputpost.py +++ /dev/null @@ -1,1095 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - -from jcapiv2.models.mfa import Mfa # noqa: F401,E501 -from jcapiv2.models.systemuserputpost_addresses import SystemuserputpostAddresses # noqa: F401,E501 -from jcapiv2.models.systemuserputpost_phone_numbers import SystemuserputpostPhoneNumbers # noqa: F401,E501 - - -class Systemuserputpost(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'account_locked': 'bool', - 'activated': 'bool', - 'addresses': 'list[SystemuserputpostAddresses]', - 'allow_public_key': 'bool', - 'attributes': 'list[object]', - 'company': 'str', - 'cost_center': 'str', - 'department': 'str', - 'description': 'str', - 'displayname': 'str', - 'email': 'str', - 'employee_identifier': 'str', - 'employee_type': 'str', - 'enable_managed_uid': 'bool', - 'enable_user_portal_multifactor': 'bool', - 'external_dn': 'str', - 'external_source_type': 'str', - 'externally_managed': 'bool', - 'firstname': 'str', - 'job_title': 'str', - 'lastname': 'str', - 'ldap_binding_user': 'bool', - 'location': 'str', - 'mfa': 'Mfa', - 'middlename': 'str', - 'password': 'str', - 'password_never_expires': 'bool', - 'passwordless_sudo': 'bool', - 'phone_numbers': 'list[SystemuserputpostPhoneNumbers]', - 'public_key': 'str', - 'relationships': 'list[object]', - 'samba_service_user': 'bool', - 'sudo': 'bool', - 'suspended': 'bool', - 'tags': 'list[str]', - 'unix_guid': 'int', - 'unix_uid': 'int', - 'username': 'str' - } - - attribute_map = { - 'account_locked': 'account_locked', - 'activated': 'activated', - 'addresses': 'addresses', - 'allow_public_key': 'allow_public_key', - 'attributes': 'attributes', - 'company': 'company', - 'cost_center': 'costCenter', - 'department': 'department', - 'description': 'description', - 'displayname': 'displayname', - 'email': 'email', - 'employee_identifier': 'employeeIdentifier', - 'employee_type': 'employeeType', - 'enable_managed_uid': 'enable_managed_uid', - 'enable_user_portal_multifactor': 'enable_user_portal_multifactor', - 'external_dn': 'external_dn', - 'external_source_type': 'external_source_type', - 'externally_managed': 'externally_managed', - 'firstname': 'firstname', - 'job_title': 'jobTitle', - 'lastname': 'lastname', - 'ldap_binding_user': 'ldap_binding_user', - 'location': 'location', - 'mfa': 'mfa', - 'middlename': 'middlename', - 'password': 'password', - 'password_never_expires': 'password_never_expires', - 'passwordless_sudo': 'passwordless_sudo', - 'phone_numbers': 'phoneNumbers', - 'public_key': 'public_key', - 'relationships': 'relationships', - 'samba_service_user': 'samba_service_user', - 'sudo': 'sudo', - 'suspended': 'suspended', - 'tags': 'tags', - 'unix_guid': 'unix_guid', - 'unix_uid': 'unix_uid', - 'username': 'username' - } - - def __init__(self, account_locked=None, activated=None, addresses=None, allow_public_key=None, attributes=None, company=None, cost_center=None, department=None, description=None, displayname=None, email=None, employee_identifier=None, employee_type=None, enable_managed_uid=None, enable_user_portal_multifactor=None, external_dn=None, external_source_type=None, externally_managed=None, firstname=None, job_title=None, lastname=None, ldap_binding_user=None, location=None, mfa=None, middlename=None, password=None, password_never_expires=None, passwordless_sudo=None, phone_numbers=None, public_key=None, relationships=None, samba_service_user=None, sudo=None, suspended=None, tags=None, unix_guid=None, unix_uid=None, username=None): # noqa: E501 - """Systemuserputpost - a model defined in Swagger""" # noqa: E501 - - self._account_locked = None - self._activated = None - self._addresses = None - self._allow_public_key = None - self._attributes = None - self._company = None - self._cost_center = None - self._department = None - self._description = None - self._displayname = None - self._email = None - self._employee_identifier = None - self._employee_type = None - self._enable_managed_uid = None - self._enable_user_portal_multifactor = None - self._external_dn = None - self._external_source_type = None - self._externally_managed = None - self._firstname = None - self._job_title = None - self._lastname = None - self._ldap_binding_user = None - self._location = None - self._mfa = None - self._middlename = None - self._password = None - self._password_never_expires = None - self._passwordless_sudo = None - self._phone_numbers = None - self._public_key = None - self._relationships = None - self._samba_service_user = None - self._sudo = None - self._suspended = None - self._tags = None - self._unix_guid = None - self._unix_uid = None - self._username = None - self.discriminator = None - - if account_locked is not None: - self.account_locked = account_locked - if activated is not None: - self.activated = activated - if addresses is not None: - self.addresses = addresses - if allow_public_key is not None: - self.allow_public_key = allow_public_key - if attributes is not None: - self.attributes = attributes - if company is not None: - self.company = company - if cost_center is not None: - self.cost_center = cost_center - if department is not None: - self.department = department - if description is not None: - self.description = description - if displayname is not None: - self.displayname = displayname - self.email = email - if employee_identifier is not None: - self.employee_identifier = employee_identifier - if employee_type is not None: - self.employee_type = employee_type - if enable_managed_uid is not None: - self.enable_managed_uid = enable_managed_uid - if enable_user_portal_multifactor is not None: - self.enable_user_portal_multifactor = enable_user_portal_multifactor - if external_dn is not None: - self.external_dn = external_dn - if external_source_type is not None: - self.external_source_type = external_source_type - if externally_managed is not None: - self.externally_managed = externally_managed - if firstname is not None: - self.firstname = firstname - if job_title is not None: - self.job_title = job_title - if lastname is not None: - self.lastname = lastname - if ldap_binding_user is not None: - self.ldap_binding_user = ldap_binding_user - if location is not None: - self.location = location - if mfa is not None: - self.mfa = mfa - if middlename is not None: - self.middlename = middlename - if password is not None: - self.password = password - if password_never_expires is not None: - self.password_never_expires = password_never_expires - if passwordless_sudo is not None: - self.passwordless_sudo = passwordless_sudo - if phone_numbers is not None: - self.phone_numbers = phone_numbers - if public_key is not None: - self.public_key = public_key - if relationships is not None: - self.relationships = relationships - if samba_service_user is not None: - self.samba_service_user = samba_service_user - if sudo is not None: - self.sudo = sudo - if suspended is not None: - self.suspended = suspended - if tags is not None: - self.tags = tags - if unix_guid is not None: - self.unix_guid = unix_guid - if unix_uid is not None: - self.unix_uid = unix_uid - self.username = username - - @property - def account_locked(self): - """Gets the account_locked of this Systemuserputpost. # noqa: E501 - - - :return: The account_locked of this Systemuserputpost. # noqa: E501 - :rtype: bool - """ - return self._account_locked - - @account_locked.setter - def account_locked(self, account_locked): - """Sets the account_locked of this Systemuserputpost. - - - :param account_locked: The account_locked of this Systemuserputpost. # noqa: E501 - :type: bool - """ - - self._account_locked = account_locked - - @property - def activated(self): - """Gets the activated of this Systemuserputpost. # noqa: E501 - - - :return: The activated of this Systemuserputpost. # noqa: E501 - :rtype: bool - """ - return self._activated - - @activated.setter - def activated(self, activated): - """Sets the activated of this Systemuserputpost. - - - :param activated: The activated of this Systemuserputpost. # noqa: E501 - :type: bool - """ - - self._activated = activated - - @property - def addresses(self): - """Gets the addresses of this Systemuserputpost. # noqa: E501 - - - :return: The addresses of this Systemuserputpost. # noqa: E501 - :rtype: list[SystemuserputpostAddresses] - """ - return self._addresses - - @addresses.setter - def addresses(self, addresses): - """Sets the addresses of this Systemuserputpost. - - - :param addresses: The addresses of this Systemuserputpost. # noqa: E501 - :type: list[SystemuserputpostAddresses] - """ - - self._addresses = addresses - - @property - def allow_public_key(self): - """Gets the allow_public_key of this Systemuserputpost. # noqa: E501 - - - :return: The allow_public_key of this Systemuserputpost. # noqa: E501 - :rtype: bool - """ - return self._allow_public_key - - @allow_public_key.setter - def allow_public_key(self, allow_public_key): - """Sets the allow_public_key of this Systemuserputpost. - - - :param allow_public_key: The allow_public_key of this Systemuserputpost. # noqa: E501 - :type: bool - """ - - self._allow_public_key = allow_public_key - - @property - def attributes(self): - """Gets the attributes of this Systemuserputpost. # noqa: E501 - - - :return: The attributes of this Systemuserputpost. # noqa: E501 - :rtype: list[object] - """ - return self._attributes - - @attributes.setter - def attributes(self, attributes): - """Sets the attributes of this Systemuserputpost. - - - :param attributes: The attributes of this Systemuserputpost. # noqa: E501 - :type: list[object] - """ - - self._attributes = attributes - - @property - def company(self): - """Gets the company of this Systemuserputpost. # noqa: E501 - - - :return: The company of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._company - - @company.setter - def company(self, company): - """Sets the company of this Systemuserputpost. - - - :param company: The company of this Systemuserputpost. # noqa: E501 - :type: str - """ - - self._company = company - - @property - def cost_center(self): - """Gets the cost_center of this Systemuserputpost. # noqa: E501 - - - :return: The cost_center of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._cost_center - - @cost_center.setter - def cost_center(self, cost_center): - """Sets the cost_center of this Systemuserputpost. - - - :param cost_center: The cost_center of this Systemuserputpost. # noqa: E501 - :type: str - """ - - self._cost_center = cost_center - - @property - def department(self): - """Gets the department of this Systemuserputpost. # noqa: E501 - - - :return: The department of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._department - - @department.setter - def department(self, department): - """Sets the department of this Systemuserputpost. - - - :param department: The department of this Systemuserputpost. # noqa: E501 - :type: str - """ - - self._department = department - - @property - def description(self): - """Gets the description of this Systemuserputpost. # noqa: E501 - - - :return: The description of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this Systemuserputpost. - - - :param description: The description of this Systemuserputpost. # noqa: E501 - :type: str - """ - if description is not None and len(description) > 1024: - raise ValueError("Invalid value for `description`, length must be less than or equal to `1024`") # noqa: E501 - - self._description = description - - @property - def displayname(self): - """Gets the displayname of this Systemuserputpost. # noqa: E501 - - - :return: The displayname of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._displayname - - @displayname.setter - def displayname(self, displayname): - """Sets the displayname of this Systemuserputpost. - - - :param displayname: The displayname of this Systemuserputpost. # noqa: E501 - :type: str - """ - - self._displayname = displayname - - @property - def email(self): - """Gets the email of this Systemuserputpost. # noqa: E501 - - - :return: The email of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._email - - @email.setter - def email(self, email): - """Sets the email of this Systemuserputpost. - - - :param email: The email of this Systemuserputpost. # noqa: E501 - :type: str - """ - if email is None: - raise ValueError("Invalid value for `email`, must not be `None`") # noqa: E501 - if email is not None and len(email) > 1024: - raise ValueError("Invalid value for `email`, length must be less than or equal to `1024`") # noqa: E501 - - self._email = email - - @property - def employee_identifier(self): - """Gets the employee_identifier of this Systemuserputpost. # noqa: E501 - - Must be unique per user. # noqa: E501 - - :return: The employee_identifier of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._employee_identifier - - @employee_identifier.setter - def employee_identifier(self, employee_identifier): - """Sets the employee_identifier of this Systemuserputpost. - - Must be unique per user. # noqa: E501 - - :param employee_identifier: The employee_identifier of this Systemuserputpost. # noqa: E501 - :type: str - """ - if employee_identifier is not None and len(employee_identifier) > 256: - raise ValueError("Invalid value for `employee_identifier`, length must be less than or equal to `256`") # noqa: E501 - - self._employee_identifier = employee_identifier - - @property - def employee_type(self): - """Gets the employee_type of this Systemuserputpost. # noqa: E501 - - - :return: The employee_type of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._employee_type - - @employee_type.setter - def employee_type(self, employee_type): - """Sets the employee_type of this Systemuserputpost. - - - :param employee_type: The employee_type of this Systemuserputpost. # noqa: E501 - :type: str - """ - - self._employee_type = employee_type - - @property - def enable_managed_uid(self): - """Gets the enable_managed_uid of this Systemuserputpost. # noqa: E501 - - - :return: The enable_managed_uid of this Systemuserputpost. # noqa: E501 - :rtype: bool - """ - return self._enable_managed_uid - - @enable_managed_uid.setter - def enable_managed_uid(self, enable_managed_uid): - """Sets the enable_managed_uid of this Systemuserputpost. - - - :param enable_managed_uid: The enable_managed_uid of this Systemuserputpost. # noqa: E501 - :type: bool - """ - - self._enable_managed_uid = enable_managed_uid - - @property - def enable_user_portal_multifactor(self): - """Gets the enable_user_portal_multifactor of this Systemuserputpost. # noqa: E501 - - - :return: The enable_user_portal_multifactor of this Systemuserputpost. # noqa: E501 - :rtype: bool - """ - return self._enable_user_portal_multifactor - - @enable_user_portal_multifactor.setter - def enable_user_portal_multifactor(self, enable_user_portal_multifactor): - """Sets the enable_user_portal_multifactor of this Systemuserputpost. - - - :param enable_user_portal_multifactor: The enable_user_portal_multifactor of this Systemuserputpost. # noqa: E501 - :type: bool - """ - - self._enable_user_portal_multifactor = enable_user_portal_multifactor - - @property - def external_dn(self): - """Gets the external_dn of this Systemuserputpost. # noqa: E501 - - - :return: The external_dn of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._external_dn - - @external_dn.setter - def external_dn(self, external_dn): - """Sets the external_dn of this Systemuserputpost. - - - :param external_dn: The external_dn of this Systemuserputpost. # noqa: E501 - :type: str - """ - - self._external_dn = external_dn - - @property - def external_source_type(self): - """Gets the external_source_type of this Systemuserputpost. # noqa: E501 - - - :return: The external_source_type of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._external_source_type - - @external_source_type.setter - def external_source_type(self, external_source_type): - """Sets the external_source_type of this Systemuserputpost. - - - :param external_source_type: The external_source_type of this Systemuserputpost. # noqa: E501 - :type: str - """ - - self._external_source_type = external_source_type - - @property - def externally_managed(self): - """Gets the externally_managed of this Systemuserputpost. # noqa: E501 - - - :return: The externally_managed of this Systemuserputpost. # noqa: E501 - :rtype: bool - """ - return self._externally_managed - - @externally_managed.setter - def externally_managed(self, externally_managed): - """Sets the externally_managed of this Systemuserputpost. - - - :param externally_managed: The externally_managed of this Systemuserputpost. # noqa: E501 - :type: bool - """ - - self._externally_managed = externally_managed - - @property - def firstname(self): - """Gets the firstname of this Systemuserputpost. # noqa: E501 - - - :return: The firstname of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._firstname - - @firstname.setter - def firstname(self, firstname): - """Sets the firstname of this Systemuserputpost. - - - :param firstname: The firstname of this Systemuserputpost. # noqa: E501 - :type: str - """ - - self._firstname = firstname - - @property - def job_title(self): - """Gets the job_title of this Systemuserputpost. # noqa: E501 - - - :return: The job_title of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._job_title - - @job_title.setter - def job_title(self, job_title): - """Sets the job_title of this Systemuserputpost. - - - :param job_title: The job_title of this Systemuserputpost. # noqa: E501 - :type: str - """ - - self._job_title = job_title - - @property - def lastname(self): - """Gets the lastname of this Systemuserputpost. # noqa: E501 - - - :return: The lastname of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._lastname - - @lastname.setter - def lastname(self, lastname): - """Sets the lastname of this Systemuserputpost. - - - :param lastname: The lastname of this Systemuserputpost. # noqa: E501 - :type: str - """ - - self._lastname = lastname - - @property - def ldap_binding_user(self): - """Gets the ldap_binding_user of this Systemuserputpost. # noqa: E501 - - - :return: The ldap_binding_user of this Systemuserputpost. # noqa: E501 - :rtype: bool - """ - return self._ldap_binding_user - - @ldap_binding_user.setter - def ldap_binding_user(self, ldap_binding_user): - """Sets the ldap_binding_user of this Systemuserputpost. - - - :param ldap_binding_user: The ldap_binding_user of this Systemuserputpost. # noqa: E501 - :type: bool - """ - - self._ldap_binding_user = ldap_binding_user - - @property - def location(self): - """Gets the location of this Systemuserputpost. # noqa: E501 - - - :return: The location of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._location - - @location.setter - def location(self, location): - """Sets the location of this Systemuserputpost. - - - :param location: The location of this Systemuserputpost. # noqa: E501 - :type: str - """ - - self._location = location - - @property - def mfa(self): - """Gets the mfa of this Systemuserputpost. # noqa: E501 - - - :return: The mfa of this Systemuserputpost. # noqa: E501 - :rtype: Mfa - """ - return self._mfa - - @mfa.setter - def mfa(self, mfa): - """Sets the mfa of this Systemuserputpost. - - - :param mfa: The mfa of this Systemuserputpost. # noqa: E501 - :type: Mfa - """ - - self._mfa = mfa - - @property - def middlename(self): - """Gets the middlename of this Systemuserputpost. # noqa: E501 - - - :return: The middlename of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._middlename - - @middlename.setter - def middlename(self, middlename): - """Sets the middlename of this Systemuserputpost. - - - :param middlename: The middlename of this Systemuserputpost. # noqa: E501 - :type: str - """ - - self._middlename = middlename - - @property - def password(self): - """Gets the password of this Systemuserputpost. # noqa: E501 - - - :return: The password of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._password - - @password.setter - def password(self, password): - """Sets the password of this Systemuserputpost. - - - :param password: The password of this Systemuserputpost. # noqa: E501 - :type: str - """ - - self._password = password - - @property - def password_never_expires(self): - """Gets the password_never_expires of this Systemuserputpost. # noqa: E501 - - - :return: The password_never_expires of this Systemuserputpost. # noqa: E501 - :rtype: bool - """ - return self._password_never_expires - - @password_never_expires.setter - def password_never_expires(self, password_never_expires): - """Sets the password_never_expires of this Systemuserputpost. - - - :param password_never_expires: The password_never_expires of this Systemuserputpost. # noqa: E501 - :type: bool - """ - - self._password_never_expires = password_never_expires - - @property - def passwordless_sudo(self): - """Gets the passwordless_sudo of this Systemuserputpost. # noqa: E501 - - - :return: The passwordless_sudo of this Systemuserputpost. # noqa: E501 - :rtype: bool - """ - return self._passwordless_sudo - - @passwordless_sudo.setter - def passwordless_sudo(self, passwordless_sudo): - """Sets the passwordless_sudo of this Systemuserputpost. - - - :param passwordless_sudo: The passwordless_sudo of this Systemuserputpost. # noqa: E501 - :type: bool - """ - - self._passwordless_sudo = passwordless_sudo - - @property - def phone_numbers(self): - """Gets the phone_numbers of this Systemuserputpost. # noqa: E501 - - - :return: The phone_numbers of this Systemuserputpost. # noqa: E501 - :rtype: list[SystemuserputpostPhoneNumbers] - """ - return self._phone_numbers - - @phone_numbers.setter - def phone_numbers(self, phone_numbers): - """Sets the phone_numbers of this Systemuserputpost. - - - :param phone_numbers: The phone_numbers of this Systemuserputpost. # noqa: E501 - :type: list[SystemuserputpostPhoneNumbers] - """ - - self._phone_numbers = phone_numbers - - @property - def public_key(self): - """Gets the public_key of this Systemuserputpost. # noqa: E501 - - - :return: The public_key of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._public_key - - @public_key.setter - def public_key(self, public_key): - """Sets the public_key of this Systemuserputpost. - - - :param public_key: The public_key of this Systemuserputpost. # noqa: E501 - :type: str - """ - - self._public_key = public_key - - @property - def relationships(self): - """Gets the relationships of this Systemuserputpost. # noqa: E501 - - - :return: The relationships of this Systemuserputpost. # noqa: E501 - :rtype: list[object] - """ - return self._relationships - - @relationships.setter - def relationships(self, relationships): - """Sets the relationships of this Systemuserputpost. - - - :param relationships: The relationships of this Systemuserputpost. # noqa: E501 - :type: list[object] - """ - - self._relationships = relationships - - @property - def samba_service_user(self): - """Gets the samba_service_user of this Systemuserputpost. # noqa: E501 - - - :return: The samba_service_user of this Systemuserputpost. # noqa: E501 - :rtype: bool - """ - return self._samba_service_user - - @samba_service_user.setter - def samba_service_user(self, samba_service_user): - """Sets the samba_service_user of this Systemuserputpost. - - - :param samba_service_user: The samba_service_user of this Systemuserputpost. # noqa: E501 - :type: bool - """ - - self._samba_service_user = samba_service_user - - @property - def sudo(self): - """Gets the sudo of this Systemuserputpost. # noqa: E501 - - - :return: The sudo of this Systemuserputpost. # noqa: E501 - :rtype: bool - """ - return self._sudo - - @sudo.setter - def sudo(self, sudo): - """Sets the sudo of this Systemuserputpost. - - - :param sudo: The sudo of this Systemuserputpost. # noqa: E501 - :type: bool - """ - - self._sudo = sudo - - @property - def suspended(self): - """Gets the suspended of this Systemuserputpost. # noqa: E501 - - - :return: The suspended of this Systemuserputpost. # noqa: E501 - :rtype: bool - """ - return self._suspended - - @suspended.setter - def suspended(self, suspended): - """Sets the suspended of this Systemuserputpost. - - - :param suspended: The suspended of this Systemuserputpost. # noqa: E501 - :type: bool - """ - - self._suspended = suspended - - @property - def tags(self): - """Gets the tags of this Systemuserputpost. # noqa: E501 - - - :return: The tags of this Systemuserputpost. # noqa: E501 - :rtype: list[str] - """ - return self._tags - - @tags.setter - def tags(self, tags): - """Sets the tags of this Systemuserputpost. - - - :param tags: The tags of this Systemuserputpost. # noqa: E501 - :type: list[str] - """ - - self._tags = tags - - @property - def unix_guid(self): - """Gets the unix_guid of this Systemuserputpost. # noqa: E501 - - - :return: The unix_guid of this Systemuserputpost. # noqa: E501 - :rtype: int - """ - return self._unix_guid - - @unix_guid.setter - def unix_guid(self, unix_guid): - """Sets the unix_guid of this Systemuserputpost. - - - :param unix_guid: The unix_guid of this Systemuserputpost. # noqa: E501 - :type: int - """ - if unix_guid is not None and unix_guid < 1: # noqa: E501 - raise ValueError("Invalid value for `unix_guid`, must be a value greater than or equal to `1`") # noqa: E501 - - self._unix_guid = unix_guid - - @property - def unix_uid(self): - """Gets the unix_uid of this Systemuserputpost. # noqa: E501 - - - :return: The unix_uid of this Systemuserputpost. # noqa: E501 - :rtype: int - """ - return self._unix_uid - - @unix_uid.setter - def unix_uid(self, unix_uid): - """Sets the unix_uid of this Systemuserputpost. - - - :param unix_uid: The unix_uid of this Systemuserputpost. # noqa: E501 - :type: int - """ - if unix_uid is not None and unix_uid < 1: # noqa: E501 - raise ValueError("Invalid value for `unix_uid`, must be a value greater than or equal to `1`") # noqa: E501 - - self._unix_uid = unix_uid - - @property - def username(self): - """Gets the username of this Systemuserputpost. # noqa: E501 - - - :return: The username of this Systemuserputpost. # noqa: E501 - :rtype: str - """ - return self._username - - @username.setter - def username(self, username): - """Sets the username of this Systemuserputpost. - - - :param username: The username of this Systemuserputpost. # noqa: E501 - :type: str - """ - if username is None: - raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 - - self._username = username - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Systemuserputpost, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Systemuserputpost): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/systemuserputpost_addresses.py b/jcapiv2/jcapiv2/models/systemuserputpost_addresses.py deleted file mode 100644 index 9ec69f2..0000000 --- a/jcapiv2/jcapiv2/models/systemuserputpost_addresses.py +++ /dev/null @@ -1,297 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class SystemuserputpostAddresses(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'country': 'str', - 'extended_address': 'str', - 'locality': 'str', - 'po_box': 'str', - 'postal_code': 'str', - 'region': 'str', - 'street_address': 'str', - 'type': 'str' - } - - attribute_map = { - 'country': 'country', - 'extended_address': 'extendedAddress', - 'locality': 'locality', - 'po_box': 'poBox', - 'postal_code': 'postalCode', - 'region': 'region', - 'street_address': 'streetAddress', - 'type': 'type' - } - - def __init__(self, country=None, extended_address=None, locality=None, po_box=None, postal_code=None, region=None, street_address=None, type=None): # noqa: E501 - """SystemuserputpostAddresses - a model defined in Swagger""" # noqa: E501 - - self._country = None - self._extended_address = None - self._locality = None - self._po_box = None - self._postal_code = None - self._region = None - self._street_address = None - self._type = None - self.discriminator = None - - if country is not None: - self.country = country - if extended_address is not None: - self.extended_address = extended_address - if locality is not None: - self.locality = locality - if po_box is not None: - self.po_box = po_box - if postal_code is not None: - self.postal_code = postal_code - if region is not None: - self.region = region - if street_address is not None: - self.street_address = street_address - if type is not None: - self.type = type - - @property - def country(self): - """Gets the country of this SystemuserputpostAddresses. # noqa: E501 - - - :return: The country of this SystemuserputpostAddresses. # noqa: E501 - :rtype: str - """ - return self._country - - @country.setter - def country(self, country): - """Sets the country of this SystemuserputpostAddresses. - - - :param country: The country of this SystemuserputpostAddresses. # noqa: E501 - :type: str - """ - - self._country = country - - @property - def extended_address(self): - """Gets the extended_address of this SystemuserputpostAddresses. # noqa: E501 - - - :return: The extended_address of this SystemuserputpostAddresses. # noqa: E501 - :rtype: str - """ - return self._extended_address - - @extended_address.setter - def extended_address(self, extended_address): - """Sets the extended_address of this SystemuserputpostAddresses. - - - :param extended_address: The extended_address of this SystemuserputpostAddresses. # noqa: E501 - :type: str - """ - - self._extended_address = extended_address - - @property - def locality(self): - """Gets the locality of this SystemuserputpostAddresses. # noqa: E501 - - - :return: The locality of this SystemuserputpostAddresses. # noqa: E501 - :rtype: str - """ - return self._locality - - @locality.setter - def locality(self, locality): - """Sets the locality of this SystemuserputpostAddresses. - - - :param locality: The locality of this SystemuserputpostAddresses. # noqa: E501 - :type: str - """ - - self._locality = locality - - @property - def po_box(self): - """Gets the po_box of this SystemuserputpostAddresses. # noqa: E501 - - - :return: The po_box of this SystemuserputpostAddresses. # noqa: E501 - :rtype: str - """ - return self._po_box - - @po_box.setter - def po_box(self, po_box): - """Sets the po_box of this SystemuserputpostAddresses. - - - :param po_box: The po_box of this SystemuserputpostAddresses. # noqa: E501 - :type: str - """ - - self._po_box = po_box - - @property - def postal_code(self): - """Gets the postal_code of this SystemuserputpostAddresses. # noqa: E501 - - - :return: The postal_code of this SystemuserputpostAddresses. # noqa: E501 - :rtype: str - """ - return self._postal_code - - @postal_code.setter - def postal_code(self, postal_code): - """Sets the postal_code of this SystemuserputpostAddresses. - - - :param postal_code: The postal_code of this SystemuserputpostAddresses. # noqa: E501 - :type: str - """ - - self._postal_code = postal_code - - @property - def region(self): - """Gets the region of this SystemuserputpostAddresses. # noqa: E501 - - - :return: The region of this SystemuserputpostAddresses. # noqa: E501 - :rtype: str - """ - return self._region - - @region.setter - def region(self, region): - """Sets the region of this SystemuserputpostAddresses. - - - :param region: The region of this SystemuserputpostAddresses. # noqa: E501 - :type: str - """ - - self._region = region - - @property - def street_address(self): - """Gets the street_address of this SystemuserputpostAddresses. # noqa: E501 - - - :return: The street_address of this SystemuserputpostAddresses. # noqa: E501 - :rtype: str - """ - return self._street_address - - @street_address.setter - def street_address(self, street_address): - """Sets the street_address of this SystemuserputpostAddresses. - - - :param street_address: The street_address of this SystemuserputpostAddresses. # noqa: E501 - :type: str - """ - - self._street_address = street_address - - @property - def type(self): - """Gets the type of this SystemuserputpostAddresses. # noqa: E501 - - - :return: The type of this SystemuserputpostAddresses. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this SystemuserputpostAddresses. - - - :param type: The type of this SystemuserputpostAddresses. # noqa: E501 - :type: str - """ - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SystemuserputpostAddresses, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SystemuserputpostAddresses): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/systemuserputpost_phone_numbers.py b/jcapiv2/jcapiv2/models/systemuserputpost_phone_numbers.py deleted file mode 100644 index 11b21f8..0000000 --- a/jcapiv2/jcapiv2/models/systemuserputpost_phone_numbers.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class SystemuserputpostPhoneNumbers(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'number': 'str', - 'type': 'str' - } - - attribute_map = { - 'number': 'number', - 'type': 'type' - } - - def __init__(self, number=None, type=None): # noqa: E501 - """SystemuserputpostPhoneNumbers - a model defined in Swagger""" # noqa: E501 - - self._number = None - self._type = None - self.discriminator = None - - if number is not None: - self.number = number - if type is not None: - self.type = type - - @property - def number(self): - """Gets the number of this SystemuserputpostPhoneNumbers. # noqa: E501 - - - :return: The number of this SystemuserputpostPhoneNumbers. # noqa: E501 - :rtype: str - """ - return self._number - - @number.setter - def number(self, number): - """Sets the number of this SystemuserputpostPhoneNumbers. - - - :param number: The number of this SystemuserputpostPhoneNumbers. # noqa: E501 - :type: str - """ - - self._number = number - - @property - def type(self): - """Gets the type of this SystemuserputpostPhoneNumbers. # noqa: E501 - - - :return: The type of this SystemuserputpostPhoneNumbers. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this SystemuserputpostPhoneNumbers. - - - :param type: The type of this SystemuserputpostPhoneNumbers. # noqa: E501 - :type: str - """ - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SystemuserputpostPhoneNumbers, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SystemuserputpostPhoneNumbers): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/ticketing_integration_alert.py b/jcapiv2/jcapiv2/models/ticketing_integration_alert.py new file mode 100644 index 0000000..742fee2 --- /dev/null +++ b/jcapiv2/jcapiv2/models/ticketing_integration_alert.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TicketingIntegrationAlert(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'category': 'str', + 'description': 'str', + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'category': 'category', + 'description': 'description', + 'id': 'id', + 'name': 'name' + } + + def __init__(self, category=None, description=None, id=None, name=None): # noqa: E501 + """TicketingIntegrationAlert - a model defined in Swagger""" # noqa: E501 + self._category = None + self._description = None + self._id = None + self._name = None + self.discriminator = None + if category is not None: + self.category = category + if description is not None: + self.description = description + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def category(self): + """Gets the category of this TicketingIntegrationAlert. # noqa: E501 + + + :return: The category of this TicketingIntegrationAlert. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this TicketingIntegrationAlert. + + + :param category: The category of this TicketingIntegrationAlert. # noqa: E501 + :type: str + """ + + self._category = category + + @property + def description(self): + """Gets the description of this TicketingIntegrationAlert. # noqa: E501 + + + :return: The description of this TicketingIntegrationAlert. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this TicketingIntegrationAlert. + + + :param description: The description of this TicketingIntegrationAlert. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def id(self): + """Gets the id of this TicketingIntegrationAlert. # noqa: E501 + + + :return: The id of this TicketingIntegrationAlert. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this TicketingIntegrationAlert. + + + :param id: The id of this TicketingIntegrationAlert. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this TicketingIntegrationAlert. # noqa: E501 + + + :return: The name of this TicketingIntegrationAlert. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this TicketingIntegrationAlert. + + + :param name: The name of this TicketingIntegrationAlert. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TicketingIntegrationAlert, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TicketingIntegrationAlert): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/ticketing_integration_alerts_resp.py b/jcapiv2/jcapiv2/models/ticketing_integration_alerts_resp.py new file mode 100644 index 0000000..db0cf0e --- /dev/null +++ b/jcapiv2/jcapiv2/models/ticketing_integration_alerts_resp.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TicketingIntegrationAlertsResp(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'records': 'list[TicketingIntegrationAlert]' + } + + attribute_map = { + 'records': 'records' + } + + def __init__(self, records=None): # noqa: E501 + """TicketingIntegrationAlertsResp - a model defined in Swagger""" # noqa: E501 + self._records = None + self.discriminator = None + self.records = records + + @property + def records(self): + """Gets the records of this TicketingIntegrationAlertsResp. # noqa: E501 + + + :return: The records of this TicketingIntegrationAlertsResp. # noqa: E501 + :rtype: list[TicketingIntegrationAlert] + """ + return self._records + + @records.setter + def records(self, records): + """Sets the records of this TicketingIntegrationAlertsResp. + + + :param records: The records of this TicketingIntegrationAlertsResp. # noqa: E501 + :type: list[TicketingIntegrationAlert] + """ + if records is None: + raise ValueError("Invalid value for `records`, must not be `None`") # noqa: E501 + + self._records = records + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TicketingIntegrationAlertsResp, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TicketingIntegrationAlertsResp): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/user.py b/jcapiv2/jcapiv2/models/user.py new file mode 100644 index 0000000..c6690e2 --- /dev/null +++ b/jcapiv2/jcapiv2/models/user.py @@ -0,0 +1,424 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class User(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'addresses': 'list[Address]', + 'alternate_email': 'str', + 'company': 'str', + 'cost_center': 'str', + 'department': 'str', + 'email': 'str', + 'employee_identifier': 'str', + 'employee_type': 'str', + 'firstname': 'str', + 'job_title': 'str', + 'lastname': 'str', + 'location': 'str', + 'phone_numbers': 'list[PhoneNumber]' + } + + attribute_map = { + 'addresses': 'addresses', + 'alternate_email': 'alternateEmail', + 'company': 'company', + 'cost_center': 'costCenter', + 'department': 'department', + 'email': 'email', + 'employee_identifier': 'employeeIdentifier', + 'employee_type': 'employeeType', + 'firstname': 'firstname', + 'job_title': 'jobTitle', + 'lastname': 'lastname', + 'location': 'location', + 'phone_numbers': 'phoneNumbers' + } + + def __init__(self, addresses=None, alternate_email=None, company=None, cost_center=None, department=None, email=None, employee_identifier=None, employee_type=None, firstname=None, job_title=None, lastname=None, location=None, phone_numbers=None): # noqa: E501 + """User - a model defined in Swagger""" # noqa: E501 + self._addresses = None + self._alternate_email = None + self._company = None + self._cost_center = None + self._department = None + self._email = None + self._employee_identifier = None + self._employee_type = None + self._firstname = None + self._job_title = None + self._lastname = None + self._location = None + self._phone_numbers = None + self.discriminator = None + if addresses is not None: + self.addresses = addresses + if alternate_email is not None: + self.alternate_email = alternate_email + if company is not None: + self.company = company + if cost_center is not None: + self.cost_center = cost_center + if department is not None: + self.department = department + if email is not None: + self.email = email + if employee_identifier is not None: + self.employee_identifier = employee_identifier + if employee_type is not None: + self.employee_type = employee_type + if firstname is not None: + self.firstname = firstname + if job_title is not None: + self.job_title = job_title + if lastname is not None: + self.lastname = lastname + if location is not None: + self.location = location + if phone_numbers is not None: + self.phone_numbers = phone_numbers + + @property + def addresses(self): + """Gets the addresses of this User. # noqa: E501 + + + :return: The addresses of this User. # noqa: E501 + :rtype: list[Address] + """ + return self._addresses + + @addresses.setter + def addresses(self, addresses): + """Sets the addresses of this User. + + + :param addresses: The addresses of this User. # noqa: E501 + :type: list[Address] + """ + + self._addresses = addresses + + @property + def alternate_email(self): + """Gets the alternate_email of this User. # noqa: E501 + + + :return: The alternate_email of this User. # noqa: E501 + :rtype: str + """ + return self._alternate_email + + @alternate_email.setter + def alternate_email(self, alternate_email): + """Sets the alternate_email of this User. + + + :param alternate_email: The alternate_email of this User. # noqa: E501 + :type: str + """ + + self._alternate_email = alternate_email + + @property + def company(self): + """Gets the company of this User. # noqa: E501 + + + :return: The company of this User. # noqa: E501 + :rtype: str + """ + return self._company + + @company.setter + def company(self, company): + """Sets the company of this User. + + + :param company: The company of this User. # noqa: E501 + :type: str + """ + + self._company = company + + @property + def cost_center(self): + """Gets the cost_center of this User. # noqa: E501 + + + :return: The cost_center of this User. # noqa: E501 + :rtype: str + """ + return self._cost_center + + @cost_center.setter + def cost_center(self, cost_center): + """Sets the cost_center of this User. + + + :param cost_center: The cost_center of this User. # noqa: E501 + :type: str + """ + + self._cost_center = cost_center + + @property + def department(self): + """Gets the department of this User. # noqa: E501 + + + :return: The department of this User. # noqa: E501 + :rtype: str + """ + return self._department + + @department.setter + def department(self, department): + """Sets the department of this User. + + + :param department: The department of this User. # noqa: E501 + :type: str + """ + + self._department = department + + @property + def email(self): + """Gets the email of this User. # noqa: E501 + + + :return: The email of this User. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this User. + + + :param email: The email of this User. # noqa: E501 + :type: str + """ + + self._email = email + + @property + def employee_identifier(self): + """Gets the employee_identifier of this User. # noqa: E501 + + Must be unique per user. # noqa: E501 + + :return: The employee_identifier of this User. # noqa: E501 + :rtype: str + """ + return self._employee_identifier + + @employee_identifier.setter + def employee_identifier(self, employee_identifier): + """Sets the employee_identifier of this User. + + Must be unique per user. # noqa: E501 + + :param employee_identifier: The employee_identifier of this User. # noqa: E501 + :type: str + """ + + self._employee_identifier = employee_identifier + + @property + def employee_type(self): + """Gets the employee_type of this User. # noqa: E501 + + + :return: The employee_type of this User. # noqa: E501 + :rtype: str + """ + return self._employee_type + + @employee_type.setter + def employee_type(self, employee_type): + """Sets the employee_type of this User. + + + :param employee_type: The employee_type of this User. # noqa: E501 + :type: str + """ + + self._employee_type = employee_type + + @property + def firstname(self): + """Gets the firstname of this User. # noqa: E501 + + + :return: The firstname of this User. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this User. + + + :param firstname: The firstname of this User. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def job_title(self): + """Gets the job_title of this User. # noqa: E501 + + + :return: The job_title of this User. # noqa: E501 + :rtype: str + """ + return self._job_title + + @job_title.setter + def job_title(self, job_title): + """Sets the job_title of this User. + + + :param job_title: The job_title of this User. # noqa: E501 + :type: str + """ + + self._job_title = job_title + + @property + def lastname(self): + """Gets the lastname of this User. # noqa: E501 + + + :return: The lastname of this User. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this User. + + + :param lastname: The lastname of this User. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def location(self): + """Gets the location of this User. # noqa: E501 + + + :return: The location of this User. # noqa: E501 + :rtype: str + """ + return self._location + + @location.setter + def location(self, location): + """Sets the location of this User. + + + :param location: The location of this User. # noqa: E501 + :type: str + """ + + self._location = location + + @property + def phone_numbers(self): + """Gets the phone_numbers of this User. # noqa: E501 + + + :return: The phone_numbers of this User. # noqa: E501 + :rtype: list[PhoneNumber] + """ + return self._phone_numbers + + @phone_numbers.setter + def phone_numbers(self, phone_numbers): + """Sets the phone_numbers of this User. + + + :param phone_numbers: The phone_numbers of this User. # noqa: E501 + :type: list[PhoneNumber] + """ + + self._phone_numbers = phone_numbers + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(User, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, User): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/jcapiv2/jcapiv2/models/user_graph_management_req.py b/jcapiv2/jcapiv2/models/user_graph_management_req.py deleted file mode 100644 index ba361d1..0000000 --- a/jcapiv2/jcapiv2/models/user_graph_management_req.py +++ /dev/null @@ -1,214 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - -from jcapiv2.models.system_graph_management_req_attributes import SystemGraphManagementReqAttributes # noqa: F401,E501 - - -class UserGraphManagementReq(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'attributes': 'SystemGraphManagementReqAttributes', - 'id': 'str', - 'op': 'str', - 'type': 'str' - } - - attribute_map = { - 'attributes': 'attributes', - 'id': 'id', - 'op': 'op', - 'type': 'type' - } - - def __init__(self, attributes=None, id=None, op=None, type=None): # noqa: E501 - """UserGraphManagementReq - a model defined in Swagger""" # noqa: E501 - - self._attributes = None - self._id = None - self._op = None - self._type = None - self.discriminator = None - - if attributes is not None: - self.attributes = attributes - self.id = id - self.op = op - self.type = type - - @property - def attributes(self): - """Gets the attributes of this UserGraphManagementReq. # noqa: E501 - - - :return: The attributes of this UserGraphManagementReq. # noqa: E501 - :rtype: SystemGraphManagementReqAttributes - """ - return self._attributes - - @attributes.setter - def attributes(self, attributes): - """Sets the attributes of this UserGraphManagementReq. - - - :param attributes: The attributes of this UserGraphManagementReq. # noqa: E501 - :type: SystemGraphManagementReqAttributes - """ - - self._attributes = attributes - - @property - def id(self): - """Gets the id of this UserGraphManagementReq. # noqa: E501 - - The ObjectID of graph object being added or removed as an association. # noqa: E501 - - :return: The id of this UserGraphManagementReq. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this UserGraphManagementReq. - - The ObjectID of graph object being added or removed as an association. # noqa: E501 - - :param id: The id of this UserGraphManagementReq. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def op(self): - """Gets the op of this UserGraphManagementReq. # noqa: E501 - - How to modify the graph connection. # noqa: E501 - - :return: The op of this UserGraphManagementReq. # noqa: E501 - :rtype: str - """ - return self._op - - @op.setter - def op(self, op): - """Sets the op of this UserGraphManagementReq. - - How to modify the graph connection. # noqa: E501 - - :param op: The op of this UserGraphManagementReq. # noqa: E501 - :type: str - """ - if op is None: - raise ValueError("Invalid value for `op`, must not be `None`") # noqa: E501 - allowed_values = ["add", "remove", "update"] # noqa: E501 - if op not in allowed_values: - raise ValueError( - "Invalid value for `op` ({0}), must be one of {1}" # noqa: E501 - .format(op, allowed_values) - ) - - self._op = op - - @property - def type(self): - """Gets the type of this UserGraphManagementReq. # noqa: E501 - - - :return: The type of this UserGraphManagementReq. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this UserGraphManagementReq. - - - :param type: The type of this UserGraphManagementReq. # noqa: E501 - :type: str - """ - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["active_directory", "application", "command", "g_suite", "ldap_server", "office_365", "policy", "radius_server", "system", "system_group"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(UserGraphManagementReq, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, UserGraphManagementReq): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/user_group.py b/jcapiv2/jcapiv2/models/user_group.py index 9261165..cbb418e 100644 --- a/jcapiv2/jcapiv2/models/user_group.py +++ b/jcapiv2/jcapiv2/models/user_group.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.user_group_attributes import UserGroupAttributes # noqa: F401,E501 - - class UserGroup(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,34 +28,67 @@ class UserGroup(object): and the value is json key in definition. """ swagger_types = { - 'attributes': 'UserGroupAttributes', + 'attributes': 'GroupAttributesUserGroup', + 'description': 'str', + 'email': 'str', 'id': 'str', + 'member_query': 'FilterQuery', + 'member_query_exemptions': 'list[GraphObject]', + 'member_suggestions_notify': 'bool', + 'membership_automated': 'bool', 'name': 'str', + 'suggestion_counts': 'SuggestionCounts', 'type': 'str' } attribute_map = { 'attributes': 'attributes', + 'description': 'description', + 'email': 'email', 'id': 'id', + 'member_query': 'memberQuery', + 'member_query_exemptions': 'memberQueryExemptions', + 'member_suggestions_notify': 'memberSuggestionsNotify', + 'membership_automated': 'membershipAutomated', 'name': 'name', + 'suggestion_counts': 'suggestionCounts', 'type': 'type' } - def __init__(self, attributes=None, id=None, name=None, type=None): # noqa: E501 + def __init__(self, attributes=None, description=None, email=None, id=None, member_query=None, member_query_exemptions=None, member_suggestions_notify=None, membership_automated=None, name=None, suggestion_counts=None, type=None): # noqa: E501 """UserGroup - a model defined in Swagger""" # noqa: E501 - self._attributes = None + self._description = None + self._email = None self._id = None + self._member_query = None + self._member_query_exemptions = None + self._member_suggestions_notify = None + self._membership_automated = None self._name = None + self._suggestion_counts = None self._type = None self.discriminator = None - if attributes is not None: self.attributes = attributes + if description is not None: + self.description = description + if email is not None: + self.email = email if id is not None: self.id = id + if member_query is not None: + self.member_query = member_query + if member_query_exemptions is not None: + self.member_query_exemptions = member_query_exemptions + if member_suggestions_notify is not None: + self.member_suggestions_notify = member_suggestions_notify + if membership_automated is not None: + self.membership_automated = membership_automated if name is not None: self.name = name + if suggestion_counts is not None: + self.suggestion_counts = suggestion_counts if type is not None: self.type = type @@ -70,7 +98,7 @@ def attributes(self): :return: The attributes of this UserGroup. # noqa: E501 - :rtype: UserGroupAttributes + :rtype: GroupAttributesUserGroup """ return self._attributes @@ -80,11 +108,57 @@ def attributes(self, attributes): :param attributes: The attributes of this UserGroup. # noqa: E501 - :type: UserGroupAttributes + :type: GroupAttributesUserGroup """ self._attributes = attributes + @property + def description(self): + """Gets the description of this UserGroup. # noqa: E501 + + Description of a User Group # noqa: E501 + + :return: The description of this UserGroup. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this UserGroup. + + Description of a User Group # noqa: E501 + + :param description: The description of this UserGroup. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def email(self): + """Gets the email of this UserGroup. # noqa: E501 + + Email address of a User Group # noqa: E501 + + :return: The email of this UserGroup. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this UserGroup. + + Email address of a User Group # noqa: E501 + + :param email: The email of this UserGroup. # noqa: E501 + :type: str + """ + + self._email = email + @property def id(self): """Gets the id of this UserGroup. # noqa: E501 @@ -108,6 +182,96 @@ def id(self, id): self._id = id + @property + def member_query(self): + """Gets the member_query of this UserGroup. # noqa: E501 + + + :return: The member_query of this UserGroup. # noqa: E501 + :rtype: FilterQuery + """ + return self._member_query + + @member_query.setter + def member_query(self, member_query): + """Sets the member_query of this UserGroup. + + + :param member_query: The member_query of this UserGroup. # noqa: E501 + :type: FilterQuery + """ + + self._member_query = member_query + + @property + def member_query_exemptions(self): + """Gets the member_query_exemptions of this UserGroup. # noqa: E501 + + Array of GraphObjects exempted from the query # noqa: E501 + + :return: The member_query_exemptions of this UserGroup. # noqa: E501 + :rtype: list[GraphObject] + """ + return self._member_query_exemptions + + @member_query_exemptions.setter + def member_query_exemptions(self, member_query_exemptions): + """Sets the member_query_exemptions of this UserGroup. + + Array of GraphObjects exempted from the query # noqa: E501 + + :param member_query_exemptions: The member_query_exemptions of this UserGroup. # noqa: E501 + :type: list[GraphObject] + """ + + self._member_query_exemptions = member_query_exemptions + + @property + def member_suggestions_notify(self): + """Gets the member_suggestions_notify of this UserGroup. # noqa: E501 + + True if notification emails are to be sent for membership suggestions. # noqa: E501 + + :return: The member_suggestions_notify of this UserGroup. # noqa: E501 + :rtype: bool + """ + return self._member_suggestions_notify + + @member_suggestions_notify.setter + def member_suggestions_notify(self, member_suggestions_notify): + """Sets the member_suggestions_notify of this UserGroup. + + True if notification emails are to be sent for membership suggestions. # noqa: E501 + + :param member_suggestions_notify: The member_suggestions_notify of this UserGroup. # noqa: E501 + :type: bool + """ + + self._member_suggestions_notify = member_suggestions_notify + + @property + def membership_automated(self): + """Gets the membership_automated of this UserGroup. # noqa: E501 + + True if membership of this group is automatically updated based on the Member Query and Member Query Exemptions, if configured # noqa: E501 + + :return: The membership_automated of this UserGroup. # noqa: E501 + :rtype: bool + """ + return self._membership_automated + + @membership_automated.setter + def membership_automated(self, membership_automated): + """Sets the membership_automated of this UserGroup. + + True if membership of this group is automatically updated based on the Member Query and Member Query Exemptions, if configured # noqa: E501 + + :param membership_automated: The membership_automated of this UserGroup. # noqa: E501 + :type: bool + """ + + self._membership_automated = membership_automated + @property def name(self): """Gets the name of this UserGroup. # noqa: E501 @@ -131,6 +295,27 @@ def name(self, name): self._name = name + @property + def suggestion_counts(self): + """Gets the suggestion_counts of this UserGroup. # noqa: E501 + + + :return: The suggestion_counts of this UserGroup. # noqa: E501 + :rtype: SuggestionCounts + """ + return self._suggestion_counts + + @suggestion_counts.setter + def suggestion_counts(self, suggestion_counts): + """Sets the suggestion_counts of this UserGroup. + + + :param suggestion_counts: The suggestion_counts of this UserGroup. # noqa: E501 + :type: SuggestionCounts + """ + + self._suggestion_counts = suggestion_counts + @property def type(self): """Gets the type of this UserGroup. # noqa: E501 diff --git a/jcapiv2/jcapiv2/models/user_group_attributes.py b/jcapiv2/jcapiv2/models/user_group_attributes.py deleted file mode 100644 index ecdd899..0000000 --- a/jcapiv2/jcapiv2/models/user_group_attributes.py +++ /dev/null @@ -1,143 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - -from jcapiv2.models.user_group_attributes_posix_groups import UserGroupAttributesPosixGroups # noqa: F401,E501 - - -class UserGroupAttributes(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'posix_groups': 'list[UserGroupAttributesPosixGroups]', - 'samba_enabled': 'bool' - } - - attribute_map = { - 'posix_groups': 'posixGroups', - 'samba_enabled': 'sambaEnabled' - } - - def __init__(self, posix_groups=None, samba_enabled=None): # noqa: E501 - """UserGroupAttributes - a model defined in Swagger""" # noqa: E501 - - self._posix_groups = None - self._samba_enabled = None - self.discriminator = None - - if posix_groups is not None: - self.posix_groups = posix_groups - if samba_enabled is not None: - self.samba_enabled = samba_enabled - - @property - def posix_groups(self): - """Gets the posix_groups of this UserGroupAttributes. # noqa: E501 - - - :return: The posix_groups of this UserGroupAttributes. # noqa: E501 - :rtype: list[UserGroupAttributesPosixGroups] - """ - return self._posix_groups - - @posix_groups.setter - def posix_groups(self, posix_groups): - """Sets the posix_groups of this UserGroupAttributes. - - - :param posix_groups: The posix_groups of this UserGroupAttributes. # noqa: E501 - :type: list[UserGroupAttributesPosixGroups] - """ - - self._posix_groups = posix_groups - - @property - def samba_enabled(self): - """Gets the samba_enabled of this UserGroupAttributes. # noqa: E501 - - - :return: The samba_enabled of this UserGroupAttributes. # noqa: E501 - :rtype: bool - """ - return self._samba_enabled - - @samba_enabled.setter - def samba_enabled(self, samba_enabled): - """Sets the samba_enabled of this UserGroupAttributes. - - - :param samba_enabled: The samba_enabled of this UserGroupAttributes. # noqa: E501 - :type: bool - """ - - self._samba_enabled = samba_enabled - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(UserGroupAttributes, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, UserGroupAttributes): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/user_group_attributes_posix_groups.py b/jcapiv2/jcapiv2/models/user_group_attributes_posix_groups.py deleted file mode 100644 index a34814d..0000000 --- a/jcapiv2/jcapiv2/models/user_group_attributes_posix_groups.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class UserGroupAttributesPosixGroups(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'int', - 'name': 'str' - } - - attribute_map = { - 'id': 'id', - 'name': 'name' - } - - def __init__(self, id=None, name=None): # noqa: E501 - """UserGroupAttributesPosixGroups - a model defined in Swagger""" # noqa: E501 - - self._id = None - self._name = None - self.discriminator = None - - if id is not None: - self.id = id - if name is not None: - self.name = name - - @property - def id(self): - """Gets the id of this UserGroupAttributesPosixGroups. # noqa: E501 - - - :return: The id of this UserGroupAttributesPosixGroups. # noqa: E501 - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this UserGroupAttributesPosixGroups. - - - :param id: The id of this UserGroupAttributesPosixGroups. # noqa: E501 - :type: int - """ - - self._id = id - - @property - def name(self): - """Gets the name of this UserGroupAttributesPosixGroups. # noqa: E501 - - - :return: The name of this UserGroupAttributesPosixGroups. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this UserGroupAttributesPosixGroups. - - - :param name: The name of this UserGroupAttributesPosixGroups. # noqa: E501 - :type: str - """ - - self._name = name - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(UserGroupAttributesPosixGroups, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, UserGroupAttributesPosixGroups): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/user_group_graph_management_req.py b/jcapiv2/jcapiv2/models/user_group_graph_management_req.py deleted file mode 100644 index 4b83ca6..0000000 --- a/jcapiv2/jcapiv2/models/user_group_graph_management_req.py +++ /dev/null @@ -1,188 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class UserGroupGraphManagementReq(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'str', - 'op': 'str', - 'type': 'str' - } - - attribute_map = { - 'id': 'id', - 'op': 'op', - 'type': 'type' - } - - def __init__(self, id=None, op=None, type=None): # noqa: E501 - """UserGroupGraphManagementReq - a model defined in Swagger""" # noqa: E501 - - self._id = None - self._op = None - self._type = None - self.discriminator = None - - self.id = id - self.op = op - self.type = type - - @property - def id(self): - """Gets the id of this UserGroupGraphManagementReq. # noqa: E501 - - The ObjectID of graph object being added or removed as an association. # noqa: E501 - - :return: The id of this UserGroupGraphManagementReq. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this UserGroupGraphManagementReq. - - The ObjectID of graph object being added or removed as an association. # noqa: E501 - - :param id: The id of this UserGroupGraphManagementReq. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def op(self): - """Gets the op of this UserGroupGraphManagementReq. # noqa: E501 - - How to modify the graph connection. # noqa: E501 - - :return: The op of this UserGroupGraphManagementReq. # noqa: E501 - :rtype: str - """ - return self._op - - @op.setter - def op(self, op): - """Sets the op of this UserGroupGraphManagementReq. - - How to modify the graph connection. # noqa: E501 - - :param op: The op of this UserGroupGraphManagementReq. # noqa: E501 - :type: str - """ - if op is None: - raise ValueError("Invalid value for `op`, must not be `None`") # noqa: E501 - allowed_values = ["add", "remove", "update"] # noqa: E501 - if op not in allowed_values: - raise ValueError( - "Invalid value for `op` ({0}), must be one of {1}" # noqa: E501 - .format(op, allowed_values) - ) - - self._op = op - - @property - def type(self): - """Gets the type of this UserGroupGraphManagementReq. # noqa: E501 - - The graph type # noqa: E501 - - :return: The type of this UserGroupGraphManagementReq. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this UserGroupGraphManagementReq. - - The graph type # noqa: E501 - - :param type: The type of this UserGroupGraphManagementReq. # noqa: E501 - :type: str - """ - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["active_directory", "application", "command", "g_suite", "ldap_server", "office_365", "policy", "radius_server", "system", "system_group"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(UserGroupGraphManagementReq, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, UserGroupGraphManagementReq): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/user_group_members_req.py b/jcapiv2/jcapiv2/models/user_group_members_req.py deleted file mode 100644 index bad2ad3..0000000 --- a/jcapiv2/jcapiv2/models/user_group_members_req.py +++ /dev/null @@ -1,188 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class UserGroupMembersReq(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'str', - 'op': 'str', - 'type': 'str' - } - - attribute_map = { - 'id': 'id', - 'op': 'op', - 'type': 'type' - } - - def __init__(self, id=None, op=None, type=None): # noqa: E501 - """UserGroupMembersReq - a model defined in Swagger""" # noqa: E501 - - self._id = None - self._op = None - self._type = None - self.discriminator = None - - self.id = id - self.op = op - self.type = type - - @property - def id(self): - """Gets the id of this UserGroupMembersReq. # noqa: E501 - - The ObjectID of member being added or removed. # noqa: E501 - - :return: The id of this UserGroupMembersReq. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this UserGroupMembersReq. - - The ObjectID of member being added or removed. # noqa: E501 - - :param id: The id of this UserGroupMembersReq. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def op(self): - """Gets the op of this UserGroupMembersReq. # noqa: E501 - - How to modify the membership connection. # noqa: E501 - - :return: The op of this UserGroupMembersReq. # noqa: E501 - :rtype: str - """ - return self._op - - @op.setter - def op(self, op): - """Sets the op of this UserGroupMembersReq. - - How to modify the membership connection. # noqa: E501 - - :param op: The op of this UserGroupMembersReq. # noqa: E501 - :type: str - """ - if op is None: - raise ValueError("Invalid value for `op`, must not be `None`") # noqa: E501 - allowed_values = ["add", "remove"] # noqa: E501 - if op not in allowed_values: - raise ValueError( - "Invalid value for `op` ({0}), must be one of {1}" # noqa: E501 - .format(op, allowed_values) - ) - - self._op = op - - @property - def type(self): - """Gets the type of this UserGroupMembersReq. # noqa: E501 - - The member type. # noqa: E501 - - :return: The type of this UserGroupMembersReq. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this UserGroupMembersReq. - - The member type. # noqa: E501 - - :param type: The type of this UserGroupMembersReq. # noqa: E501 - :type: str - """ - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - allowed_values = ["user"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) - - self._type = type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(UserGroupMembersReq, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, UserGroupMembersReq): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/user_group_post.py b/jcapiv2/jcapiv2/models/user_group_post.py index 61934ae..c42230a 100644 --- a/jcapiv2/jcapiv2/models/user_group_post.py +++ b/jcapiv2/jcapiv2/models/user_group_post.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.user_group_attributes import UserGroupAttributes # noqa: F401,E501 - - class UserGroupPost(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,24 +28,52 @@ class UserGroupPost(object): and the value is json key in definition. """ swagger_types = { - 'attributes': 'UserGroupAttributes', + 'attributes': 'GroupAttributesUserGroup', + 'description': 'str', + 'email': 'str', + 'member_query': 'FilterQuery', + 'member_query_exemptions': 'list[GraphObject]', + 'member_suggestions_notify': 'bool', + 'membership_automated': 'bool', 'name': 'str' } attribute_map = { 'attributes': 'attributes', + 'description': 'description', + 'email': 'email', + 'member_query': 'memberQuery', + 'member_query_exemptions': 'memberQueryExemptions', + 'member_suggestions_notify': 'memberSuggestionsNotify', + 'membership_automated': 'membershipAutomated', 'name': 'name' } - def __init__(self, attributes=None, name=None): # noqa: E501 + def __init__(self, attributes=None, description=None, email=None, member_query=None, member_query_exemptions=None, member_suggestions_notify=None, membership_automated=None, name=None): # noqa: E501 """UserGroupPost - a model defined in Swagger""" # noqa: E501 - self._attributes = None + self._description = None + self._email = None + self._member_query = None + self._member_query_exemptions = None + self._member_suggestions_notify = None + self._membership_automated = None self._name = None self.discriminator = None - if attributes is not None: self.attributes = attributes + if description is not None: + self.description = description + if email is not None: + self.email = email + if member_query is not None: + self.member_query = member_query + if member_query_exemptions is not None: + self.member_query_exemptions = member_query_exemptions + if member_suggestions_notify is not None: + self.member_suggestions_notify = member_suggestions_notify + if membership_automated is not None: + self.membership_automated = membership_automated self.name = name @property @@ -59,7 +82,7 @@ def attributes(self): :return: The attributes of this UserGroupPost. # noqa: E501 - :rtype: UserGroupAttributes + :rtype: GroupAttributesUserGroup """ return self._attributes @@ -69,11 +92,147 @@ def attributes(self, attributes): :param attributes: The attributes of this UserGroupPost. # noqa: E501 - :type: UserGroupAttributes + :type: GroupAttributesUserGroup """ self._attributes = attributes + @property + def description(self): + """Gets the description of this UserGroupPost. # noqa: E501 + + Description of a User Group # noqa: E501 + + :return: The description of this UserGroupPost. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this UserGroupPost. + + Description of a User Group # noqa: E501 + + :param description: The description of this UserGroupPost. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def email(self): + """Gets the email of this UserGroupPost. # noqa: E501 + + Email address of a User Group # noqa: E501 + + :return: The email of this UserGroupPost. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this UserGroupPost. + + Email address of a User Group # noqa: E501 + + :param email: The email of this UserGroupPost. # noqa: E501 + :type: str + """ + + self._email = email + + @property + def member_query(self): + """Gets the member_query of this UserGroupPost. # noqa: E501 + + + :return: The member_query of this UserGroupPost. # noqa: E501 + :rtype: FilterQuery + """ + return self._member_query + + @member_query.setter + def member_query(self, member_query): + """Sets the member_query of this UserGroupPost. + + + :param member_query: The member_query of this UserGroupPost. # noqa: E501 + :type: FilterQuery + """ + + self._member_query = member_query + + @property + def member_query_exemptions(self): + """Gets the member_query_exemptions of this UserGroupPost. # noqa: E501 + + Array of GraphObjects exempted from the query # noqa: E501 + + :return: The member_query_exemptions of this UserGroupPost. # noqa: E501 + :rtype: list[GraphObject] + """ + return self._member_query_exemptions + + @member_query_exemptions.setter + def member_query_exemptions(self, member_query_exemptions): + """Sets the member_query_exemptions of this UserGroupPost. + + Array of GraphObjects exempted from the query # noqa: E501 + + :param member_query_exemptions: The member_query_exemptions of this UserGroupPost. # noqa: E501 + :type: list[GraphObject] + """ + + self._member_query_exemptions = member_query_exemptions + + @property + def member_suggestions_notify(self): + """Gets the member_suggestions_notify of this UserGroupPost. # noqa: E501 + + True if notification emails are to be sent for membership suggestions. # noqa: E501 + + :return: The member_suggestions_notify of this UserGroupPost. # noqa: E501 + :rtype: bool + """ + return self._member_suggestions_notify + + @member_suggestions_notify.setter + def member_suggestions_notify(self, member_suggestions_notify): + """Sets the member_suggestions_notify of this UserGroupPost. + + True if notification emails are to be sent for membership suggestions. # noqa: E501 + + :param member_suggestions_notify: The member_suggestions_notify of this UserGroupPost. # noqa: E501 + :type: bool + """ + + self._member_suggestions_notify = member_suggestions_notify + + @property + def membership_automated(self): + """Gets the membership_automated of this UserGroupPost. # noqa: E501 + + True if membership of this group is automatically updated based on the Member Query and Member Query Exemptions, if configured # noqa: E501 + + :return: The membership_automated of this UserGroupPost. # noqa: E501 + :rtype: bool + """ + return self._membership_automated + + @membership_automated.setter + def membership_automated(self, membership_automated): + """Sets the membership_automated of this UserGroupPost. + + True if membership of this group is automatically updated based on the Member Query and Member Query Exemptions, if configured # noqa: E501 + + :param membership_automated: The membership_automated of this UserGroupPost. # noqa: E501 + :type: bool + """ + + self._membership_automated = membership_automated + @property def name(self): """Gets the name of this UserGroupPost. # noqa: E501 diff --git a/jcapiv2/jcapiv2/models/user_group_put.py b/jcapiv2/jcapiv2/models/user_group_put.py index 84960d0..54a8b6e 100644 --- a/jcapiv2/jcapiv2/models/user_group_put.py +++ b/jcapiv2/jcapiv2/models/user_group_put.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.user_group_attributes import UserGroupAttributes # noqa: F401,E501 - - class UserGroupPut(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -33,24 +28,52 @@ class UserGroupPut(object): and the value is json key in definition. """ swagger_types = { - 'attributes': 'UserGroupAttributes', + 'attributes': 'GroupAttributesUserGroup', + 'description': 'str', + 'email': 'str', + 'member_query': 'FilterQuery', + 'member_query_exemptions': 'list[GraphObject]', + 'member_suggestions_notify': 'bool', + 'membership_automated': 'bool', 'name': 'str' } attribute_map = { 'attributes': 'attributes', + 'description': 'description', + 'email': 'email', + 'member_query': 'memberQuery', + 'member_query_exemptions': 'memberQueryExemptions', + 'member_suggestions_notify': 'memberSuggestionsNotify', + 'membership_automated': 'membershipAutomated', 'name': 'name' } - def __init__(self, attributes=None, name=None): # noqa: E501 + def __init__(self, attributes=None, description=None, email=None, member_query=None, member_query_exemptions=None, member_suggestions_notify=None, membership_automated=None, name=None): # noqa: E501 """UserGroupPut - a model defined in Swagger""" # noqa: E501 - self._attributes = None + self._description = None + self._email = None + self._member_query = None + self._member_query_exemptions = None + self._member_suggestions_notify = None + self._membership_automated = None self._name = None self.discriminator = None - if attributes is not None: self.attributes = attributes + if description is not None: + self.description = description + if email is not None: + self.email = email + if member_query is not None: + self.member_query = member_query + if member_query_exemptions is not None: + self.member_query_exemptions = member_query_exemptions + if member_suggestions_notify is not None: + self.member_suggestions_notify = member_suggestions_notify + if membership_automated is not None: + self.membership_automated = membership_automated self.name = name @property @@ -59,7 +82,7 @@ def attributes(self): :return: The attributes of this UserGroupPut. # noqa: E501 - :rtype: UserGroupAttributes + :rtype: GroupAttributesUserGroup """ return self._attributes @@ -69,11 +92,147 @@ def attributes(self, attributes): :param attributes: The attributes of this UserGroupPut. # noqa: E501 - :type: UserGroupAttributes + :type: GroupAttributesUserGroup """ self._attributes = attributes + @property + def description(self): + """Gets the description of this UserGroupPut. # noqa: E501 + + Description of a User Group # noqa: E501 + + :return: The description of this UserGroupPut. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this UserGroupPut. + + Description of a User Group # noqa: E501 + + :param description: The description of this UserGroupPut. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def email(self): + """Gets the email of this UserGroupPut. # noqa: E501 + + Email address of a User Group # noqa: E501 + + :return: The email of this UserGroupPut. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this UserGroupPut. + + Email address of a User Group # noqa: E501 + + :param email: The email of this UserGroupPut. # noqa: E501 + :type: str + """ + + self._email = email + + @property + def member_query(self): + """Gets the member_query of this UserGroupPut. # noqa: E501 + + + :return: The member_query of this UserGroupPut. # noqa: E501 + :rtype: FilterQuery + """ + return self._member_query + + @member_query.setter + def member_query(self, member_query): + """Sets the member_query of this UserGroupPut. + + + :param member_query: The member_query of this UserGroupPut. # noqa: E501 + :type: FilterQuery + """ + + self._member_query = member_query + + @property + def member_query_exemptions(self): + """Gets the member_query_exemptions of this UserGroupPut. # noqa: E501 + + Array of GraphObjects exempted from the query # noqa: E501 + + :return: The member_query_exemptions of this UserGroupPut. # noqa: E501 + :rtype: list[GraphObject] + """ + return self._member_query_exemptions + + @member_query_exemptions.setter + def member_query_exemptions(self, member_query_exemptions): + """Sets the member_query_exemptions of this UserGroupPut. + + Array of GraphObjects exempted from the query # noqa: E501 + + :param member_query_exemptions: The member_query_exemptions of this UserGroupPut. # noqa: E501 + :type: list[GraphObject] + """ + + self._member_query_exemptions = member_query_exemptions + + @property + def member_suggestions_notify(self): + """Gets the member_suggestions_notify of this UserGroupPut. # noqa: E501 + + True if notification emails are to be sent for membership suggestions. # noqa: E501 + + :return: The member_suggestions_notify of this UserGroupPut. # noqa: E501 + :rtype: bool + """ + return self._member_suggestions_notify + + @member_suggestions_notify.setter + def member_suggestions_notify(self, member_suggestions_notify): + """Sets the member_suggestions_notify of this UserGroupPut. + + True if notification emails are to be sent for membership suggestions. # noqa: E501 + + :param member_suggestions_notify: The member_suggestions_notify of this UserGroupPut. # noqa: E501 + :type: bool + """ + + self._member_suggestions_notify = member_suggestions_notify + + @property + def membership_automated(self): + """Gets the membership_automated of this UserGroupPut. # noqa: E501 + + True if membership of this group is automatically updated based on the Member Query and Member Query Exemptions, if configured # noqa: E501 + + :return: The membership_automated of this UserGroupPut. # noqa: E501 + :rtype: bool + """ + return self._membership_automated + + @membership_automated.setter + def membership_automated(self, membership_automated): + """Sets the membership_automated of this UserGroupPut. + + True if membership of this group is automatically updated based on the Member Query and Member Query Exemptions, if configured # noqa: E501 + + :param membership_automated: The membership_automated of this UserGroupPut. # noqa: E501 + :type: bool + """ + + self._membership_automated = membership_automated + @property def name(self): """Gets the name of this UserGroupPut. # noqa: E501 diff --git a/jcapiv2/jcapiv2/models/workday_fields.py b/jcapiv2/jcapiv2/models/workday_fields.py index ea16296..4e3a014 100644 --- a/jcapiv2/jcapiv2/models/workday_fields.py +++ b/jcapiv2/jcapiv2/models/workday_fields.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class WorkdayFields(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -42,11 +39,9 @@ class WorkdayFields(object): def __init__(self, name=None, report_url=None): # noqa: E501 """WorkdayFields - a model defined in Swagger""" # noqa: E501 - self._name = None self._report_url = None self.discriminator = None - if name is not None: self.name = name if report_url is not None: diff --git a/jcapiv2/jcapiv2/models/workday_input.py b/jcapiv2/jcapiv2/models/workday_input.py index 2267a81..b2c7284 100644 --- a/jcapiv2/jcapiv2/models/workday_input.py +++ b/jcapiv2/jcapiv2/models/workday_input.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.auth_input import AuthInput # noqa: F401,E501 - - class WorkdayInput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -46,12 +41,10 @@ class WorkdayInput(object): def __init__(self, auth=None, name=None, report_url=None): # noqa: E501 """WorkdayInput - a model defined in Swagger""" # noqa: E501 - self._auth = None self._name = None self._report_url = None self.discriminator = None - if auth is not None: self.auth = auth if name is not None: diff --git a/jcapiv2/jcapiv2/models/workday_output.py b/jcapiv2/jcapiv2/models/workday_output.py index 3db2889..2163f97 100644 --- a/jcapiv2/jcapiv2/models/workday_output.py +++ b/jcapiv2/jcapiv2/models/workday_output.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.workdayoutput_auth import WorkdayoutputAuth # noqa: F401,E501 - - class WorkdayOutput(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -50,14 +45,12 @@ class WorkdayOutput(object): def __init__(self, auth=None, id=None, last_import=None, name=None, report_url=None): # noqa: E501 """WorkdayOutput - a model defined in Swagger""" # noqa: E501 - self._auth = None self._id = None self._last_import = None self._name = None self._report_url = None self.discriminator = None - if auth is not None: self.auth = auth if id is not None: diff --git a/jcapiv2/jcapiv2/models/workday_request.py b/jcapiv2/jcapiv2/models/workday_request.py deleted file mode 100644 index 053c6af..0000000 --- a/jcapiv2/jcapiv2/models/workday_request.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class WorkdayRequest(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'name': 'str', - 'object_id': 'str' - } - - attribute_map = { - 'name': 'name', - 'object_id': 'objectId' - } - - def __init__(self, name=None, object_id=None): # noqa: E501 - """WorkdayRequest - a model defined in Swagger""" # noqa: E501 - - self._name = None - self._object_id = None - self.discriminator = None - - if name is not None: - self.name = name - if object_id is not None: - self.object_id = object_id - - @property - def name(self): - """Gets the name of this WorkdayRequest. # noqa: E501 - - - :return: The name of this WorkdayRequest. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this WorkdayRequest. - - - :param name: The name of this WorkdayRequest. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def object_id(self): - """Gets the object_id of this WorkdayRequest. # noqa: E501 - - - :return: The object_id of this WorkdayRequest. # noqa: E501 - :rtype: str - """ - return self._object_id - - @object_id.setter - def object_id(self, object_id): - """Sets the object_id of this WorkdayRequest. - - - :param object_id: The object_id of this WorkdayRequest. # noqa: E501 - :type: str - """ - - self._object_id = object_id - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(WorkdayRequest, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, WorkdayRequest): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/jcapiv2/jcapiv2/models/workday_worker.py b/jcapiv2/jcapiv2/models/workday_worker.py index 65d7f38..0bb78d2 100644 --- a/jcapiv2/jcapiv2/models/workday_worker.py +++ b/jcapiv2/jcapiv2/models/workday_worker.py @@ -1,28 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six - class WorkdayWorker(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -48,14 +45,12 @@ class WorkdayWorker(object): def __init__(self, attributes=None, email=None, first_name=None, last_name=None, username=None): # noqa: E501 """WorkdayWorker - a model defined in Swagger""" # noqa: E501 - self._attributes = None self._email = None self._first_name = None self._last_name = None self._username = None self.discriminator = None - if attributes is not None: self.attributes = attributes if email is not None: diff --git a/jcapiv2/jcapiv2/models/workdayoutput_auth.py b/jcapiv2/jcapiv2/models/workdayoutput_auth.py index 96a5e2c..4bec51e 100644 --- a/jcapiv2/jcapiv2/models/workdayoutput_auth.py +++ b/jcapiv2/jcapiv2/models/workdayoutput_auth.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - import pprint import re # noqa: F401 import six -from jcapiv2.models.auth_info import AuthInfo # noqa: F401,E501 - - class WorkdayoutputAuth(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ Attributes: swagger_types (dict): The key is attribute name @@ -44,11 +39,9 @@ class WorkdayoutputAuth(object): def __init__(self, basic=None, oauth=None): # noqa: E501 """WorkdayoutputAuth - a model defined in Swagger""" # noqa: E501 - self._basic = None self._oauth = None self.discriminator = None - if basic is not None: self.basic = basic if oauth is not None: diff --git a/jcapiv2/jcapiv2/rest.py b/jcapiv2/jcapiv2/rest.py index 641a4b2..773f64c 100644 --- a/jcapiv2/jcapiv2/rest.py +++ b/jcapiv2/jcapiv2/rest.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import io @@ -156,7 +155,7 @@ def request(self, method, url, query_params=None, headers=None, if query_params: url += '?' + urlencode(query_params) if re.search('json', headers['Content-Type'], re.IGNORECASE): - request_body = None + request_body = '{}' if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( @@ -216,11 +215,6 @@ def request(self, method, url, query_params=None, headers=None, if _preload_content: r = RESTResponse(r) - # In the python 3, the response.data is bytes. - # we need to decode it to string. - if six.PY3: - r.data = r.data.decode('utf8') - # log response body logger.debug("response body: %s", r.data) diff --git a/jcapiv2/setup.py b/jcapiv2/setup.py index 8e914d8..3bbf37f 100644 --- a/jcapiv2/setup.py +++ b/jcapiv2/setup.py @@ -1,20 +1,19 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from setuptools import setup, find_packages # noqa: H301 NAME = "jcapiv2" -VERSION = "4.0.0" +VERSION = "5.0.0" # To install the library, run the following # # python setup.py install @@ -27,14 +26,14 @@ setup( name=NAME, version=VERSION, - description="JumpCloud APIs", - author_email="", + description="JumpCloud API", + author_email="support@jumpcloud.com", url="", - keywords=["Swagger", "JumpCloud APIs"], + keywords=["Swagger", "JumpCloud API"], install_requires=REQUIRES, packages=find_packages(), include_package_data=True, long_description="""\ - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 """ ) diff --git a/jcapiv2/test/test_active_directory_agent_get_output.py b/jcapiv2/test/test_active_directory_agent_get_output.py index ef34d46..bec7cd0 100644 --- a/jcapiv2/test/test_active_directory_agent_get_output.py +++ b/jcapiv2/test/test_active_directory_agent_get_output.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_active_directory_agent_input.py b/jcapiv2/test/test_active_directory_agent_input.py index e6d2aa7..223cc2d 100644 --- a/jcapiv2/test/test_active_directory_agent_input.py +++ b/jcapiv2/test/test_active_directory_agent_input.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_active_directory_agent_list_output.py b/jcapiv2/test/test_active_directory_agent_list_output.py index 51fb6d0..2cf785d 100644 --- a/jcapiv2/test/test_active_directory_agent_list_output.py +++ b/jcapiv2/test/test_active_directory_agent_list_output.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_active_directory_api.py b/jcapiv2/test/test_active_directory_api.py index 6ad9568..1e658dd 100644 --- a/jcapiv2/test/test_active_directory_api.py +++ b/jcapiv2/test/test_active_directory_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestActiveDirectoryApi(unittest.TestCase): """ActiveDirectoryApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.active_directory_api.ActiveDirectoryApi() # noqa: E501 + self.api = ActiveDirectoryApi() # noqa: E501 def tearDown(self): pass @@ -99,6 +98,13 @@ def test_graph_active_directory_associations_post(self): """ pass + def test_graph_active_directory_traverse_user(self): + """Test case for graph_active_directory_traverse_user + + List the Users bound to an Active Directory instance # noqa: E501 + """ + pass + def test_graph_active_directory_traverse_user_group(self): """Test case for graph_active_directory_traverse_user_group diff --git a/jcapiv2/test/test_active_directory_input.py b/jcapiv2/test/test_active_directory_input.py index 9220e48..ae54665 100644 --- a/jcapiv2/test/test_active_directory_input.py +++ b/jcapiv2/test/test_active_directory_input.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_active_directory_output.py b/jcapiv2/test/test_active_directory_output.py index 554b027..3f59a67 100644 --- a/jcapiv2/test/test_active_directory_output.py +++ b/jcapiv2/test/test_active_directory_output.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_address.py b/jcapiv2/test/test_address.py new file mode 100644 index 0000000..9ece420 --- /dev/null +++ b/jcapiv2/test/test_address.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.address import Address # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAddress(unittest.TestCase): + """Address unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAddress(self): + """Test Address""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.address.Address() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_ade.py b/jcapiv2/test/test_ade.py new file mode 100644 index 0000000..133dbb8 --- /dev/null +++ b/jcapiv2/test/test_ade.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.ade import ADE # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestADE(unittest.TestCase): + """ADE unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testADE(self): + """Test ADE""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.ade.ADE() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_ades.py b/jcapiv2/test/test_ades.py new file mode 100644 index 0000000..b401f9a --- /dev/null +++ b/jcapiv2/test/test_ades.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.ades import ADES # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestADES(unittest.TestCase): + """ADES unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testADES(self): + """Test ADES""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.ades.ADES() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_administrator.py b/jcapiv2/test/test_administrator.py index e8a7b85..cab3ff3 100644 --- a/jcapiv2/test/test_administrator.py +++ b/jcapiv2/test/test_administrator.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_administrator_organization_link.py b/jcapiv2/test/test_administrator_organization_link.py new file mode 100644 index 0000000..e82decf --- /dev/null +++ b/jcapiv2/test/test_administrator_organization_link.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.administrator_organization_link import AdministratorOrganizationLink # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAdministratorOrganizationLink(unittest.TestCase): + """AdministratorOrganizationLink unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAdministratorOrganizationLink(self): + """Test AdministratorOrganizationLink""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.administrator_organization_link.AdministratorOrganizationLink() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_administrator_organization_link_req.py b/jcapiv2/test/test_administrator_organization_link_req.py new file mode 100644 index 0000000..3444c36 --- /dev/null +++ b/jcapiv2/test/test_administrator_organization_link_req.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.administrator_organization_link_req import AdministratorOrganizationLinkReq # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAdministratorOrganizationLinkReq(unittest.TestCase): + """AdministratorOrganizationLinkReq unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAdministratorOrganizationLinkReq(self): + """Test AdministratorOrganizationLinkReq""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.administrator_organization_link_req.AdministratorOrganizationLinkReq() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_administrators_api.py b/jcapiv2/test/test_administrators_api.py new file mode 100644 index 0000000..b253d3c --- /dev/null +++ b/jcapiv2/test/test_administrators_api.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.api.administrators_api import AdministratorsApi # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAdministratorsApi(unittest.TestCase): + """AdministratorsApi unit test stubs""" + + def setUp(self): + self.api = AdministratorsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_administrator_organizations_create_by_administrator(self): + """Test case for administrator_organizations_create_by_administrator + + Allow Adminstrator access to an Organization. # noqa: E501 + """ + pass + + def test_administrator_organizations_list_by_administrator(self): + """Test case for administrator_organizations_list_by_administrator + + List the association links between an Administrator and Organizations. # noqa: E501 + """ + pass + + def test_administrator_organizations_list_by_organization(self): + """Test case for administrator_organizations_list_by_organization + + List the association links between an Organization and Administrators. # noqa: E501 + """ + pass + + def test_administrator_organizations_remove_by_administrator(self): + """Test case for administrator_organizations_remove_by_administrator + + Remove association between an Administrator and an Organization. # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_all_of_autotask_ticketing_alert_configuration_list_records_items.py b/jcapiv2/test/test_all_of_autotask_ticketing_alert_configuration_list_records_items.py new file mode 100644 index 0000000..107be20 --- /dev/null +++ b/jcapiv2/test/test_all_of_autotask_ticketing_alert_configuration_list_records_items.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.all_of_autotask_ticketing_alert_configuration_list_records_items import AllOfAutotaskTicketingAlertConfigurationListRecordsItems # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAllOfAutotaskTicketingAlertConfigurationListRecordsItems(unittest.TestCase): + """AllOfAutotaskTicketingAlertConfigurationListRecordsItems unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAllOfAutotaskTicketingAlertConfigurationListRecordsItems(self): + """Test AllOfAutotaskTicketingAlertConfigurationListRecordsItems""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.all_of_autotask_ticketing_alert_configuration_list_records_items.AllOfAutotaskTicketingAlertConfigurationListRecordsItems() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_all_of_connect_wise_ticketing_alert_configuration_list_records_items.py b/jcapiv2/test/test_all_of_connect_wise_ticketing_alert_configuration_list_records_items.py new file mode 100644 index 0000000..e42bb41 --- /dev/null +++ b/jcapiv2/test/test_all_of_connect_wise_ticketing_alert_configuration_list_records_items.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.all_of_connect_wise_ticketing_alert_configuration_list_records_items import AllOfConnectWiseTicketingAlertConfigurationListRecordsItems # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAllOfConnectWiseTicketingAlertConfigurationListRecordsItems(unittest.TestCase): + """AllOfConnectWiseTicketingAlertConfigurationListRecordsItems unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAllOfConnectWiseTicketingAlertConfigurationListRecordsItems(self): + """Test AllOfConnectWiseTicketingAlertConfigurationListRecordsItems""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.all_of_connect_wise_ticketing_alert_configuration_list_records_items.AllOfConnectWiseTicketingAlertConfigurationListRecordsItems() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_any_value.py b/jcapiv2/test/test_any_value.py new file mode 100644 index 0000000..c0d53e2 --- /dev/null +++ b/jcapiv2/test/test_any_value.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.any_value import AnyValue # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAnyValue(unittest.TestCase): + """AnyValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAnyValue(self): + """Test AnyValue""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.any_value.AnyValue() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_apple_mdm.py b/jcapiv2/test/test_apple_mdm.py index 25a95f9..870e076 100644 --- a/jcapiv2/test/test_apple_mdm.py +++ b/jcapiv2/test/test_apple_mdm.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_apple_mdm_api.py b/jcapiv2/test/test_apple_mdm_api.py index 82343f2..7a03eca 100644 --- a/jcapiv2/test/test_apple_mdm_api.py +++ b/jcapiv2/test/test_apple_mdm_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,11 +23,18 @@ class TestAppleMDMApi(unittest.TestCase): """AppleMDMApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.apple_mdm_api.AppleMDMApi() # noqa: E501 + self.api = AppleMDMApi() # noqa: E501 def tearDown(self): pass + def test_applemdms_csrget(self): + """Test case for applemdms_csrget + + Get Apple MDM CSR Plist # noqa: E501 + """ + pass + def test_applemdms_delete(self): """Test case for applemdms_delete @@ -36,41 +42,111 @@ def test_applemdms_delete(self): """ pass - def test_applemdms_list(self): - """Test case for applemdms_list + def test_applemdms_deletedevice(self): + """Test case for applemdms_deletedevice - List Apple MDMs # noqa: E501 + Remove an Apple MDM Device's Enrollment # noqa: E501 """ pass - def test_applemdms_post(self): - """Test case for applemdms_post + def test_applemdms_depkeyget(self): + """Test case for applemdms_depkeyget - Create Apple MDM # noqa: E501 + Get Apple MDM DEP Public Key # noqa: E501 """ pass - def test_applemdms_put(self): - """Test case for applemdms_put + def test_applemdms_devices_clear_activation_lock(self): + """Test case for applemdms_devices_clear_activation_lock - Update an Apple MDM # noqa: E501 + Clears the Activation Lock for a Device # noqa: E501 + """ + pass + + def test_applemdms_devices_refresh_activation_lock_information(self): + """Test case for applemdms_devices_refresh_activation_lock_information + + Refresh activation lock information for a device # noqa: E501 """ pass - def test_enrollmentprofiles_get(self): - """Test case for enrollmentprofiles_get + def test_applemdms_deviceserase(self): + """Test case for applemdms_deviceserase + + Erase Device # noqa: E501 + """ + pass + + def test_applemdms_deviceslist(self): + """Test case for applemdms_deviceslist + + List AppleMDM Devices # noqa: E501 + """ + pass + + def test_applemdms_deviceslock(self): + """Test case for applemdms_deviceslock + + Lock Device # noqa: E501 + """ + pass + + def test_applemdms_devicesrestart(self): + """Test case for applemdms_devicesrestart + + Restart Device # noqa: E501 + """ + pass + + def test_applemdms_devicesshutdown(self): + """Test case for applemdms_devicesshutdown + + Shut Down Device # noqa: E501 + """ + pass + + def test_applemdms_enrollmentprofilesget(self): + """Test case for applemdms_enrollmentprofilesget Get an Apple MDM Enrollment Profile # noqa: E501 """ pass - def test_enrollmentprofiles_list(self): - """Test case for enrollmentprofiles_list + def test_applemdms_enrollmentprofileslist(self): + """Test case for applemdms_enrollmentprofileslist List Apple MDM Enrollment Profiles # noqa: E501 """ pass + def test_applemdms_getdevice(self): + """Test case for applemdms_getdevice + + Details of an AppleMDM Device # noqa: E501 + """ + pass + + def test_applemdms_list(self): + """Test case for applemdms_list + + List Apple MDMs # noqa: E501 + """ + pass + + def test_applemdms_put(self): + """Test case for applemdms_put + + Update an Apple MDM # noqa: E501 + """ + pass + + def test_applemdms_refreshdepdevices(self): + """Test case for applemdms_refreshdepdevices + + Refresh DEP Devices # noqa: E501 + """ + pass + if __name__ == '__main__': unittest.main() diff --git a/jcapiv2/test/test_apple_mdm_device.py b/jcapiv2/test/test_apple_mdm_device.py new file mode 100644 index 0000000..19b03a4 --- /dev/null +++ b/jcapiv2/test/test_apple_mdm_device.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.apple_mdm_device import AppleMdmDevice # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAppleMdmDevice(unittest.TestCase): + """AppleMdmDevice unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAppleMdmDevice(self): + """Test AppleMdmDevice""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.apple_mdm_device.AppleMdmDevice() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_apple_mdm_device_info.py b/jcapiv2/test/test_apple_mdm_device_info.py new file mode 100644 index 0000000..d0e1758 --- /dev/null +++ b/jcapiv2/test/test_apple_mdm_device_info.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.apple_mdm_device_info import AppleMdmDeviceInfo # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAppleMdmDeviceInfo(unittest.TestCase): + """AppleMdmDeviceInfo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAppleMdmDeviceInfo(self): + """Test AppleMdmDeviceInfo""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.apple_mdm_device_info.AppleMdmDeviceInfo() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_apple_mdm_device_security_info.py b/jcapiv2/test/test_apple_mdm_device_security_info.py new file mode 100644 index 0000000..1248636 --- /dev/null +++ b/jcapiv2/test/test_apple_mdm_device_security_info.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.apple_mdm_device_security_info import AppleMdmDeviceSecurityInfo # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAppleMdmDeviceSecurityInfo(unittest.TestCase): + """AppleMdmDeviceSecurityInfo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAppleMdmDeviceSecurityInfo(self): + """Test AppleMdmDeviceSecurityInfo""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.apple_mdm_device_security_info.AppleMdmDeviceSecurityInfo() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_apple_mdm_patch_input.py b/jcapiv2/test/test_apple_mdm_patch_input.py index fb5a2cf..9bb3f72 100644 --- a/jcapiv2/test/test_apple_mdm_patch_input.py +++ b/jcapiv2/test/test_apple_mdm_patch_input.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_apple_mdm_public_key_cert.py b/jcapiv2/test/test_apple_mdm_public_key_cert.py new file mode 100644 index 0000000..a8ac377 --- /dev/null +++ b/jcapiv2/test/test_apple_mdm_public_key_cert.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.apple_mdm_public_key_cert import AppleMdmPublicKeyCert # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAppleMdmPublicKeyCert(unittest.TestCase): + """AppleMdmPublicKeyCert unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAppleMdmPublicKeyCert(self): + """Test AppleMdmPublicKeyCert""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.apple_mdm_public_key_cert.AppleMdmPublicKeyCert() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_apple_mdm_signed_csr_plist.py b/jcapiv2/test/test_apple_mdm_signed_csr_plist.py new file mode 100644 index 0000000..9af1fcf --- /dev/null +++ b/jcapiv2/test/test_apple_mdm_signed_csr_plist.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.apple_mdm_signed_csr_plist import AppleMdmSignedCsrPlist # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAppleMdmSignedCsrPlist(unittest.TestCase): + """AppleMdmSignedCsrPlist unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAppleMdmSignedCsrPlist(self): + """Test AppleMdmSignedCsrPlist""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.apple_mdm_signed_csr_plist.AppleMdmSignedCsrPlist() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_application_id_logo_body.py b/jcapiv2/test/test_application_id_logo_body.py new file mode 100644 index 0000000..23be153 --- /dev/null +++ b/jcapiv2/test/test_application_id_logo_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.application_id_logo_body import ApplicationIdLogoBody # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestApplicationIdLogoBody(unittest.TestCase): + """ApplicationIdLogoBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApplicationIdLogoBody(self): + """Test ApplicationIdLogoBody""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.application_id_logo_body.ApplicationIdLogoBody() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_applications_api.py b/jcapiv2/test/test_applications_api.py index 21068a8..8794f2e 100644 --- a/jcapiv2/test/test_applications_api.py +++ b/jcapiv2/test/test_applications_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,11 +23,31 @@ class TestApplicationsApi(unittest.TestCase): """ApplicationsApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.applications_api.ApplicationsApi() # noqa: E501 + self.api = ApplicationsApi() # noqa: E501 def tearDown(self): pass + def test_applications_delete_logo(self): + """Test case for applications_delete_logo + + Delete application image # noqa: E501 + """ + pass + + def test_applications_get(self): + """Test case for applications_get + + Get an Application # noqa: E501 + """ + pass + + def test_applications_post_logo(self): + """Test case for applications_post_logo + + """ + pass + def test_graph_application_associations_list(self): """Test case for graph_application_associations_list @@ -57,6 +76,13 @@ def test_graph_application_traverse_user_group(self): """ pass + def test_import_users(self): + """Test case for import_users + + Get a list of users to import from an Application IdM service provider # noqa: E501 + """ + pass + if __name__ == '__main__': unittest.main() diff --git a/jcapiv2/test/test_auth_info.py b/jcapiv2/test/test_auth_info.py index 2f05a58..a5c8f17 100644 --- a/jcapiv2/test/test_auth_info.py +++ b/jcapiv2/test/test_auth_info.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_auth_input.py b/jcapiv2/test/test_auth_input.py index e241d2c..7c8f836 100644 --- a/jcapiv2/test/test_auth_input.py +++ b/jcapiv2/test/test_auth_input.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_auth_input_object.py b/jcapiv2/test/test_auth_input_object.py index 27ff537..de6e0b8 100644 --- a/jcapiv2/test/test_auth_input_object.py +++ b/jcapiv2/test/test_auth_input_object.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_authentication_policies_api.py b/jcapiv2/test/test_authentication_policies_api.py new file mode 100644 index 0000000..7c565e1 --- /dev/null +++ b/jcapiv2/test/test_authentication_policies_api.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.api.authentication_policies_api import AuthenticationPoliciesApi # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAuthenticationPoliciesApi(unittest.TestCase): + """AuthenticationPoliciesApi unit test stubs""" + + def setUp(self): + self.api = AuthenticationPoliciesApi() # noqa: E501 + + def tearDown(self): + pass + + def test_authnpolicies_delete(self): + """Test case for authnpolicies_delete + + Delete Authentication Policy # noqa: E501 + """ + pass + + def test_authnpolicies_get(self): + """Test case for authnpolicies_get + + Get an authentication policy # noqa: E501 + """ + pass + + def test_authnpolicies_list(self): + """Test case for authnpolicies_list + + List Authentication Policies # noqa: E501 + """ + pass + + def test_authnpolicies_patch(self): + """Test case for authnpolicies_patch + + Patch Authentication Policy # noqa: E501 + """ + pass + + def test_authnpolicies_post(self): + """Test case for authnpolicies_post + + Create an Authentication Policy # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_authinput_basic.py b/jcapiv2/test/test_authinput_basic.py index 574fb45..14ddb93 100644 --- a/jcapiv2/test/test_authinput_basic.py +++ b/jcapiv2/test/test_authinput_basic.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_authinput_oauth.py b/jcapiv2/test/test_authinput_oauth.py index 919ce84..87d8cba 100644 --- a/jcapiv2/test/test_authinput_oauth.py +++ b/jcapiv2/test/test_authinput_oauth.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_authn_policy.py b/jcapiv2/test/test_authn_policy.py new file mode 100644 index 0000000..901e928 --- /dev/null +++ b/jcapiv2/test/test_authn_policy.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.authn_policy import AuthnPolicy # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAuthnPolicy(unittest.TestCase): + """AuthnPolicy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAuthnPolicy(self): + """Test AuthnPolicy""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.authn_policy.AuthnPolicy() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_authn_policy_effect.py b/jcapiv2/test/test_authn_policy_effect.py new file mode 100644 index 0000000..b3620a6 --- /dev/null +++ b/jcapiv2/test/test_authn_policy_effect.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.authn_policy_effect import AuthnPolicyEffect # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAuthnPolicyEffect(unittest.TestCase): + """AuthnPolicyEffect unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAuthnPolicyEffect(self): + """Test AuthnPolicyEffect""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.authn_policy_effect.AuthnPolicyEffect() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_authn_policy_input.py b/jcapiv2/test/test_authn_policy_input.py new file mode 100644 index 0000000..333a464 --- /dev/null +++ b/jcapiv2/test/test_authn_policy_input.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.authn_policy_input import AuthnPolicyInput # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAuthnPolicyInput(unittest.TestCase): + """AuthnPolicyInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAuthnPolicyInput(self): + """Test AuthnPolicyInput""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.authn_policy_input.AuthnPolicyInput() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_authn_policy_obligations.py b/jcapiv2/test/test_authn_policy_obligations.py new file mode 100644 index 0000000..5b44e39 --- /dev/null +++ b/jcapiv2/test/test_authn_policy_obligations.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.authn_policy_obligations import AuthnPolicyObligations # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAuthnPolicyObligations(unittest.TestCase): + """AuthnPolicyObligations unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAuthnPolicyObligations(self): + """Test AuthnPolicyObligations""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.authn_policy_obligations.AuthnPolicyObligations() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_authn_policy_obligations_mfa.py b/jcapiv2/test/test_authn_policy_obligations_mfa.py new file mode 100644 index 0000000..587aef2 --- /dev/null +++ b/jcapiv2/test/test_authn_policy_obligations_mfa.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.authn_policy_obligations_mfa import AuthnPolicyObligationsMfa # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAuthnPolicyObligationsMfa(unittest.TestCase): + """AuthnPolicyObligationsMfa unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAuthnPolicyObligationsMfa(self): + """Test AuthnPolicyObligationsMfa""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.authn_policy_obligations_mfa.AuthnPolicyObligationsMfa() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_authn_policy_obligations_user_verification.py b/jcapiv2/test/test_authn_policy_obligations_user_verification.py new file mode 100644 index 0000000..1c3b7df --- /dev/null +++ b/jcapiv2/test/test_authn_policy_obligations_user_verification.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.authn_policy_obligations_user_verification import AuthnPolicyObligationsUserVerification # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAuthnPolicyObligationsUserVerification(unittest.TestCase): + """AuthnPolicyObligationsUserVerification unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAuthnPolicyObligationsUserVerification(self): + """Test AuthnPolicyObligationsUserVerification""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.authn_policy_obligations_user_verification.AuthnPolicyObligationsUserVerification() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_authn_policy_resource_target.py b/jcapiv2/test/test_authn_policy_resource_target.py new file mode 100644 index 0000000..d76851d --- /dev/null +++ b/jcapiv2/test/test_authn_policy_resource_target.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.authn_policy_resource_target import AuthnPolicyResourceTarget # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAuthnPolicyResourceTarget(unittest.TestCase): + """AuthnPolicyResourceTarget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAuthnPolicyResourceTarget(self): + """Test AuthnPolicyResourceTarget""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.authn_policy_resource_target.AuthnPolicyResourceTarget() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_authn_policy_targets.py b/jcapiv2/test/test_authn_policy_targets.py new file mode 100644 index 0000000..ff50f5f --- /dev/null +++ b/jcapiv2/test/test_authn_policy_targets.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.authn_policy_targets import AuthnPolicyTargets # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAuthnPolicyTargets(unittest.TestCase): + """AuthnPolicyTargets unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAuthnPolicyTargets(self): + """Test AuthnPolicyTargets""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.authn_policy_targets.AuthnPolicyTargets() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_authn_policy_type.py b/jcapiv2/test/test_authn_policy_type.py new file mode 100644 index 0000000..ea187d6 --- /dev/null +++ b/jcapiv2/test/test_authn_policy_type.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.authn_policy_type import AuthnPolicyType # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAuthnPolicyType(unittest.TestCase): + """AuthnPolicyType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAuthnPolicyType(self): + """Test AuthnPolicyType""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.authn_policy_type.AuthnPolicyType() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_authn_policy_user_attribute_filter.py b/jcapiv2/test/test_authn_policy_user_attribute_filter.py new file mode 100644 index 0000000..62d1e9d --- /dev/null +++ b/jcapiv2/test/test_authn_policy_user_attribute_filter.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.authn_policy_user_attribute_filter import AuthnPolicyUserAttributeFilter # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAuthnPolicyUserAttributeFilter(unittest.TestCase): + """AuthnPolicyUserAttributeFilter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAuthnPolicyUserAttributeFilter(self): + """Test AuthnPolicyUserAttributeFilter""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.authn_policy_user_attribute_filter.AuthnPolicyUserAttributeFilter() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_authn_policy_user_attribute_target.py b/jcapiv2/test/test_authn_policy_user_attribute_target.py new file mode 100644 index 0000000..9dba611 --- /dev/null +++ b/jcapiv2/test/test_authn_policy_user_attribute_target.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.authn_policy_user_attribute_target import AuthnPolicyUserAttributeTarget # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAuthnPolicyUserAttributeTarget(unittest.TestCase): + """AuthnPolicyUserAttributeTarget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAuthnPolicyUserAttributeTarget(self): + """Test AuthnPolicyUserAttributeTarget""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.authn_policy_user_attribute_target.AuthnPolicyUserAttributeTarget() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_authn_policy_user_group_target.py b/jcapiv2/test/test_authn_policy_user_group_target.py new file mode 100644 index 0000000..2bd7b2c --- /dev/null +++ b/jcapiv2/test/test_authn_policy_user_group_target.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.authn_policy_user_group_target import AuthnPolicyUserGroupTarget # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAuthnPolicyUserGroupTarget(unittest.TestCase): + """AuthnPolicyUserGroupTarget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAuthnPolicyUserGroupTarget(self): + """Test AuthnPolicyUserGroupTarget""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.authn_policy_user_group_target.AuthnPolicyUserGroupTarget() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_authn_policy_user_target.py b/jcapiv2/test/test_authn_policy_user_target.py new file mode 100644 index 0000000..8d6323d --- /dev/null +++ b/jcapiv2/test/test_authn_policy_user_target.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.authn_policy_user_target import AuthnPolicyUserTarget # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAuthnPolicyUserTarget(unittest.TestCase): + """AuthnPolicyUserTarget unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAuthnPolicyUserTarget(self): + """Test AuthnPolicyUserTarget""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.authn_policy_user_target.AuthnPolicyUserTarget() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_company.py b/jcapiv2/test/test_autotask_company.py new file mode 100644 index 0000000..f258e02 --- /dev/null +++ b/jcapiv2/test/test_autotask_company.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_company import AutotaskCompany # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskCompany(unittest.TestCase): + """AutotaskCompany unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskCompany(self): + """Test AutotaskCompany""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_company.AutotaskCompany() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_company_resp.py b/jcapiv2/test/test_autotask_company_resp.py new file mode 100644 index 0000000..3bbfe37 --- /dev/null +++ b/jcapiv2/test/test_autotask_company_resp.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_company_resp import AutotaskCompanyResp # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskCompanyResp(unittest.TestCase): + """AutotaskCompanyResp unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskCompanyResp(self): + """Test AutotaskCompanyResp""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_company_resp.AutotaskCompanyResp() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_company_type_resp.py b/jcapiv2/test/test_autotask_company_type_resp.py new file mode 100644 index 0000000..77c56c2 --- /dev/null +++ b/jcapiv2/test/test_autotask_company_type_resp.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_company_type_resp import AutotaskCompanyTypeResp # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskCompanyTypeResp(unittest.TestCase): + """AutotaskCompanyTypeResp unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskCompanyTypeResp(self): + """Test AutotaskCompanyTypeResp""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_company_type_resp.AutotaskCompanyTypeResp() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_contract.py b/jcapiv2/test/test_autotask_contract.py new file mode 100644 index 0000000..5bd44f0 --- /dev/null +++ b/jcapiv2/test/test_autotask_contract.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_contract import AutotaskContract # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskContract(unittest.TestCase): + """AutotaskContract unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskContract(self): + """Test AutotaskContract""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_contract.AutotaskContract() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_contract_field.py b/jcapiv2/test/test_autotask_contract_field.py new file mode 100644 index 0000000..f6e8624 --- /dev/null +++ b/jcapiv2/test/test_autotask_contract_field.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_contract_field import AutotaskContractField # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskContractField(unittest.TestCase): + """AutotaskContractField unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskContractField(self): + """Test AutotaskContractField""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_contract_field.AutotaskContractField() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_contract_field_values.py b/jcapiv2/test/test_autotask_contract_field_values.py new file mode 100644 index 0000000..f83de34 --- /dev/null +++ b/jcapiv2/test/test_autotask_contract_field_values.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_contract_field_values import AutotaskContractFieldValues # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskContractFieldValues(unittest.TestCase): + """AutotaskContractFieldValues unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskContractFieldValues(self): + """Test AutotaskContractFieldValues""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_contract_field_values.AutotaskContractFieldValues() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_integration.py b/jcapiv2/test/test_autotask_integration.py new file mode 100644 index 0000000..8a30abd --- /dev/null +++ b/jcapiv2/test/test_autotask_integration.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_integration import AutotaskIntegration # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskIntegration(unittest.TestCase): + """AutotaskIntegration unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskIntegration(self): + """Test AutotaskIntegration""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_integration.AutotaskIntegration() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_integration_patch_req.py b/jcapiv2/test/test_autotask_integration_patch_req.py new file mode 100644 index 0000000..6ee9f98 --- /dev/null +++ b/jcapiv2/test/test_autotask_integration_patch_req.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_integration_patch_req import AutotaskIntegrationPatchReq # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskIntegrationPatchReq(unittest.TestCase): + """AutotaskIntegrationPatchReq unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskIntegrationPatchReq(self): + """Test AutotaskIntegrationPatchReq""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_integration_patch_req.AutotaskIntegrationPatchReq() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_integration_req.py b/jcapiv2/test/test_autotask_integration_req.py new file mode 100644 index 0000000..9a5e085 --- /dev/null +++ b/jcapiv2/test/test_autotask_integration_req.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_integration_req import AutotaskIntegrationReq # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskIntegrationReq(unittest.TestCase): + """AutotaskIntegrationReq unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskIntegrationReq(self): + """Test AutotaskIntegrationReq""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_integration_req.AutotaskIntegrationReq() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_mapping_request.py b/jcapiv2/test/test_autotask_mapping_request.py new file mode 100644 index 0000000..0929278 --- /dev/null +++ b/jcapiv2/test/test_autotask_mapping_request.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_mapping_request import AutotaskMappingRequest # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskMappingRequest(unittest.TestCase): + """AutotaskMappingRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskMappingRequest(self): + """Test AutotaskMappingRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_mapping_request.AutotaskMappingRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_mapping_request_company.py b/jcapiv2/test/test_autotask_mapping_request_company.py new file mode 100644 index 0000000..bd11197 --- /dev/null +++ b/jcapiv2/test/test_autotask_mapping_request_company.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_mapping_request_company import AutotaskMappingRequestCompany # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskMappingRequestCompany(unittest.TestCase): + """AutotaskMappingRequestCompany unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskMappingRequestCompany(self): + """Test AutotaskMappingRequestCompany""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_mapping_request_company.AutotaskMappingRequestCompany() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_mapping_request_contract.py b/jcapiv2/test/test_autotask_mapping_request_contract.py new file mode 100644 index 0000000..70c4436 --- /dev/null +++ b/jcapiv2/test/test_autotask_mapping_request_contract.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_mapping_request_contract import AutotaskMappingRequestContract # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskMappingRequestContract(unittest.TestCase): + """AutotaskMappingRequestContract unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskMappingRequestContract(self): + """Test AutotaskMappingRequestContract""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_mapping_request_contract.AutotaskMappingRequestContract() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_mapping_request_data.py b/jcapiv2/test/test_autotask_mapping_request_data.py new file mode 100644 index 0000000..60114fa --- /dev/null +++ b/jcapiv2/test/test_autotask_mapping_request_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_mapping_request_data import AutotaskMappingRequestData # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskMappingRequestData(unittest.TestCase): + """AutotaskMappingRequestData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskMappingRequestData(self): + """Test AutotaskMappingRequestData""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_mapping_request_data.AutotaskMappingRequestData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_mapping_request_organization.py b/jcapiv2/test/test_autotask_mapping_request_organization.py new file mode 100644 index 0000000..1b3a3c7 --- /dev/null +++ b/jcapiv2/test/test_autotask_mapping_request_organization.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_mapping_request_organization import AutotaskMappingRequestOrganization # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskMappingRequestOrganization(unittest.TestCase): + """AutotaskMappingRequestOrganization unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskMappingRequestOrganization(self): + """Test AutotaskMappingRequestOrganization""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_mapping_request_organization.AutotaskMappingRequestOrganization() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_mapping_request_service.py b/jcapiv2/test/test_autotask_mapping_request_service.py new file mode 100644 index 0000000..e3dc8a4 --- /dev/null +++ b/jcapiv2/test/test_autotask_mapping_request_service.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_mapping_request_service import AutotaskMappingRequestService # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskMappingRequestService(unittest.TestCase): + """AutotaskMappingRequestService unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskMappingRequestService(self): + """Test AutotaskMappingRequestService""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_mapping_request_service.AutotaskMappingRequestService() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_mapping_response.py b/jcapiv2/test/test_autotask_mapping_response.py new file mode 100644 index 0000000..7819462 --- /dev/null +++ b/jcapiv2/test/test_autotask_mapping_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_mapping_response import AutotaskMappingResponse # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskMappingResponse(unittest.TestCase): + """AutotaskMappingResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskMappingResponse(self): + """Test AutotaskMappingResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_mapping_response.AutotaskMappingResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_mapping_response_company.py b/jcapiv2/test/test_autotask_mapping_response_company.py new file mode 100644 index 0000000..e427867 --- /dev/null +++ b/jcapiv2/test/test_autotask_mapping_response_company.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_mapping_response_company import AutotaskMappingResponseCompany # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskMappingResponseCompany(unittest.TestCase): + """AutotaskMappingResponseCompany unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskMappingResponseCompany(self): + """Test AutotaskMappingResponseCompany""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_mapping_response_company.AutotaskMappingResponseCompany() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_mapping_response_contract.py b/jcapiv2/test/test_autotask_mapping_response_contract.py new file mode 100644 index 0000000..b504962 --- /dev/null +++ b/jcapiv2/test/test_autotask_mapping_response_contract.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_mapping_response_contract import AutotaskMappingResponseContract # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskMappingResponseContract(unittest.TestCase): + """AutotaskMappingResponseContract unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskMappingResponseContract(self): + """Test AutotaskMappingResponseContract""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_mapping_response_contract.AutotaskMappingResponseContract() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_mapping_response_organization.py b/jcapiv2/test/test_autotask_mapping_response_organization.py new file mode 100644 index 0000000..ecdb92a --- /dev/null +++ b/jcapiv2/test/test_autotask_mapping_response_organization.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_mapping_response_organization import AutotaskMappingResponseOrganization # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskMappingResponseOrganization(unittest.TestCase): + """AutotaskMappingResponseOrganization unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskMappingResponseOrganization(self): + """Test AutotaskMappingResponseOrganization""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_mapping_response_organization.AutotaskMappingResponseOrganization() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_mapping_response_service.py b/jcapiv2/test/test_autotask_mapping_response_service.py new file mode 100644 index 0000000..e29466d --- /dev/null +++ b/jcapiv2/test/test_autotask_mapping_response_service.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_mapping_response_service import AutotaskMappingResponseService # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskMappingResponseService(unittest.TestCase): + """AutotaskMappingResponseService unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskMappingResponseService(self): + """Test AutotaskMappingResponseService""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_mapping_response_service.AutotaskMappingResponseService() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_service.py b/jcapiv2/test/test_autotask_service.py new file mode 100644 index 0000000..304b0b4 --- /dev/null +++ b/jcapiv2/test/test_autotask_service.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_service import AutotaskService # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskService(unittest.TestCase): + """AutotaskService unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskService(self): + """Test AutotaskService""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_service.AutotaskService() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_settings.py b/jcapiv2/test/test_autotask_settings.py new file mode 100644 index 0000000..98e9f27 --- /dev/null +++ b/jcapiv2/test/test_autotask_settings.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_settings import AutotaskSettings # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskSettings(unittest.TestCase): + """AutotaskSettings unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskSettings(self): + """Test AutotaskSettings""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_settings.AutotaskSettings() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_settings_patch_req.py b/jcapiv2/test/test_autotask_settings_patch_req.py new file mode 100644 index 0000000..fe7e75d --- /dev/null +++ b/jcapiv2/test/test_autotask_settings_patch_req.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_settings_patch_req import AutotaskSettingsPatchReq # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskSettingsPatchReq(unittest.TestCase): + """AutotaskSettingsPatchReq unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskSettingsPatchReq(self): + """Test AutotaskSettingsPatchReq""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_settings_patch_req.AutotaskSettingsPatchReq() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_ticketing_alert_configuration.py b/jcapiv2/test/test_autotask_ticketing_alert_configuration.py new file mode 100644 index 0000000..4dbaa7b --- /dev/null +++ b/jcapiv2/test/test_autotask_ticketing_alert_configuration.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_ticketing_alert_configuration import AutotaskTicketingAlertConfiguration # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskTicketingAlertConfiguration(unittest.TestCase): + """AutotaskTicketingAlertConfiguration unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskTicketingAlertConfiguration(self): + """Test AutotaskTicketingAlertConfiguration""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_ticketing_alert_configuration.AutotaskTicketingAlertConfiguration() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_ticketing_alert_configuration_list.py b/jcapiv2/test/test_autotask_ticketing_alert_configuration_list.py new file mode 100644 index 0000000..1ebf64f --- /dev/null +++ b/jcapiv2/test/test_autotask_ticketing_alert_configuration_list.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_ticketing_alert_configuration_list import AutotaskTicketingAlertConfigurationList # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskTicketingAlertConfigurationList(unittest.TestCase): + """AutotaskTicketingAlertConfigurationList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskTicketingAlertConfigurationList(self): + """Test AutotaskTicketingAlertConfigurationList""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_ticketing_alert_configuration_list.AutotaskTicketingAlertConfigurationList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_ticketing_alert_configuration_option.py b/jcapiv2/test/test_autotask_ticketing_alert_configuration_option.py new file mode 100644 index 0000000..fff10fd --- /dev/null +++ b/jcapiv2/test/test_autotask_ticketing_alert_configuration_option.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_ticketing_alert_configuration_option import AutotaskTicketingAlertConfigurationOption # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskTicketingAlertConfigurationOption(unittest.TestCase): + """AutotaskTicketingAlertConfigurationOption unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskTicketingAlertConfigurationOption(self): + """Test AutotaskTicketingAlertConfigurationOption""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_ticketing_alert_configuration_option.AutotaskTicketingAlertConfigurationOption() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_ticketing_alert_configuration_option_values.py b/jcapiv2/test/test_autotask_ticketing_alert_configuration_option_values.py new file mode 100644 index 0000000..c9f4884 --- /dev/null +++ b/jcapiv2/test/test_autotask_ticketing_alert_configuration_option_values.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_ticketing_alert_configuration_option_values import AutotaskTicketingAlertConfigurationOptionValues # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskTicketingAlertConfigurationOptionValues(unittest.TestCase): + """AutotaskTicketingAlertConfigurationOptionValues unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskTicketingAlertConfigurationOptionValues(self): + """Test AutotaskTicketingAlertConfigurationOptionValues""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_ticketing_alert_configuration_option_values.AutotaskTicketingAlertConfigurationOptionValues() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_ticketing_alert_configuration_options.py b/jcapiv2/test/test_autotask_ticketing_alert_configuration_options.py new file mode 100644 index 0000000..e075cf3 --- /dev/null +++ b/jcapiv2/test/test_autotask_ticketing_alert_configuration_options.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_ticketing_alert_configuration_options import AutotaskTicketingAlertConfigurationOptions # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskTicketingAlertConfigurationOptions(unittest.TestCase): + """AutotaskTicketingAlertConfigurationOptions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskTicketingAlertConfigurationOptions(self): + """Test AutotaskTicketingAlertConfigurationOptions""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_ticketing_alert_configuration_options.AutotaskTicketingAlertConfigurationOptions() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_ticketing_alert_configuration_priority.py b/jcapiv2/test/test_autotask_ticketing_alert_configuration_priority.py new file mode 100644 index 0000000..3eb25a1 --- /dev/null +++ b/jcapiv2/test/test_autotask_ticketing_alert_configuration_priority.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_ticketing_alert_configuration_priority import AutotaskTicketingAlertConfigurationPriority # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskTicketingAlertConfigurationPriority(unittest.TestCase): + """AutotaskTicketingAlertConfigurationPriority unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskTicketingAlertConfigurationPriority(self): + """Test AutotaskTicketingAlertConfigurationPriority""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_ticketing_alert_configuration_priority.AutotaskTicketingAlertConfigurationPriority() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_ticketing_alert_configuration_request.py b/jcapiv2/test/test_autotask_ticketing_alert_configuration_request.py new file mode 100644 index 0000000..d2faa27 --- /dev/null +++ b/jcapiv2/test/test_autotask_ticketing_alert_configuration_request.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_ticketing_alert_configuration_request import AutotaskTicketingAlertConfigurationRequest # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskTicketingAlertConfigurationRequest(unittest.TestCase): + """AutotaskTicketingAlertConfigurationRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskTicketingAlertConfigurationRequest(self): + """Test AutotaskTicketingAlertConfigurationRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_ticketing_alert_configuration_request.AutotaskTicketingAlertConfigurationRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_autotask_ticketing_alert_configuration_resource.py b/jcapiv2/test/test_autotask_ticketing_alert_configuration_resource.py new file mode 100644 index 0000000..f8c6f40 --- /dev/null +++ b/jcapiv2/test/test_autotask_ticketing_alert_configuration_resource.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.autotask_ticketing_alert_configuration_resource import AutotaskTicketingAlertConfigurationResource # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestAutotaskTicketingAlertConfigurationResource(unittest.TestCase): + """AutotaskTicketingAlertConfigurationResource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAutotaskTicketingAlertConfigurationResource(self): + """Test AutotaskTicketingAlertConfigurationResource""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.autotask_ticketing_alert_configuration_resource.AutotaskTicketingAlertConfigurationResource() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_billing_integration_company_type.py b/jcapiv2/test/test_billing_integration_company_type.py new file mode 100644 index 0000000..5df6500 --- /dev/null +++ b/jcapiv2/test/test_billing_integration_company_type.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.billing_integration_company_type import BillingIntegrationCompanyType # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestBillingIntegrationCompanyType(unittest.TestCase): + """BillingIntegrationCompanyType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBillingIntegrationCompanyType(self): + """Test BillingIntegrationCompanyType""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.billing_integration_company_type.BillingIntegrationCompanyType() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_body.py b/jcapiv2/test/test_body.py deleted file mode 100644 index 803b472..0000000 --- a/jcapiv2/test/test_body.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.body import Body # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestBody(unittest.TestCase): - """Body unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBody(self): - """Test Body""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.body.Body() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_body1.py b/jcapiv2/test/test_body1.py deleted file mode 100644 index 9dac109..0000000 --- a/jcapiv2/test/test_body1.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.body1 import Body1 # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestBody1(unittest.TestCase): - """Body1 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBody1(self): - """Test Body1""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.body1.Body1() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_body2.py b/jcapiv2/test/test_body2.py deleted file mode 100644 index 766beea..0000000 --- a/jcapiv2/test/test_body2.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.body2 import Body2 # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestBody2(unittest.TestCase): - """Body2 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBody2(self): - """Test Body2""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.body2.Body2() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_body3.py b/jcapiv2/test/test_body3.py deleted file mode 100644 index 5892ace..0000000 --- a/jcapiv2/test/test_body3.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.body3 import Body3 # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestBody3(unittest.TestCase): - """Body3 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testBody3(self): - """Test Body3""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.body3.Body3() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_bulk_job_requests_api.py b/jcapiv2/test/test_bulk_job_requests_api.py index d7806de..dd1e575 100644 --- a/jcapiv2/test/test_bulk_job_requests_api.py +++ b/jcapiv2/test/test_bulk_job_requests_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,11 +23,39 @@ class TestBulkJobRequestsApi(unittest.TestCase): """BulkJobRequestsApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.bulk_job_requests_api.BulkJobRequestsApi() # noqa: E501 + self.api = BulkJobRequestsApi() # noqa: E501 def tearDown(self): pass + def test_bulk_user_states_create(self): + """Test case for bulk_user_states_create + + Create Scheduled Userstate Job # noqa: E501 + """ + pass + + def test_bulk_user_states_delete(self): + """Test case for bulk_user_states_delete + + Delete Scheduled Userstate Job # noqa: E501 + """ + pass + + def test_bulk_user_states_get_next_scheduled(self): + """Test case for bulk_user_states_get_next_scheduled + + Gets the next scheduled state change for each user in a list of system users # noqa: E501 + """ + pass + + def test_bulk_user_states_list(self): + """Test case for bulk_user_states_list + + List Scheduled Userstate Change Jobs # noqa: E501 + """ + pass + def test_bulk_users_create(self): """Test case for bulk_users_create @@ -50,20 +77,6 @@ def test_bulk_users_update(self): """ pass - def test_jobs_get(self): - """Test case for jobs_get - - Get Job (incomplete) # noqa: E501 - """ - pass - - def test_jobs_results(self): - """Test case for jobs_results - - List Job Results # noqa: E501 - """ - pass - if __name__ == '__main__': unittest.main() diff --git a/jcapiv2/test/test_bulk_scheduled_statechange_create.py b/jcapiv2/test/test_bulk_scheduled_statechange_create.py new file mode 100644 index 0000000..78c68f4 --- /dev/null +++ b/jcapiv2/test/test_bulk_scheduled_statechange_create.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.bulk_scheduled_statechange_create import BulkScheduledStatechangeCreate # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestBulkScheduledStatechangeCreate(unittest.TestCase): + """BulkScheduledStatechangeCreate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBulkScheduledStatechangeCreate(self): + """Test BulkScheduledStatechangeCreate""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.bulk_scheduled_statechange_create.BulkScheduledStatechangeCreate() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_bulk_user_create.py b/jcapiv2/test/test_bulk_user_create.py index 75ca686..da23958 100644 --- a/jcapiv2/test/test_bulk_user_create.py +++ b/jcapiv2/test/test_bulk_user_create.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_bulk_user_update.py b/jcapiv2/test/test_bulk_user_update.py index 2543373..e28bb0e 100644 --- a/jcapiv2/test/test_bulk_user_update.py +++ b/jcapiv2/test/test_bulk_user_update.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_command_result_list.py b/jcapiv2/test/test_command_result_list.py new file mode 100644 index 0000000..875860a --- /dev/null +++ b/jcapiv2/test/test_command_result_list.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.command_result_list import CommandResultList # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestCommandResultList(unittest.TestCase): + """CommandResultList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCommandResultList(self): + """Test CommandResultList""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.command_result_list.CommandResultList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_command_result_list_results.py b/jcapiv2/test/test_command_result_list_results.py new file mode 100644 index 0000000..89193ae --- /dev/null +++ b/jcapiv2/test/test_command_result_list_results.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.command_result_list_results import CommandResultListResults # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestCommandResultListResults(unittest.TestCase): + """CommandResultListResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCommandResultListResults(self): + """Test CommandResultListResults""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.command_result_list_results.CommandResultListResults() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_command_results_api.py b/jcapiv2/test/test_command_results_api.py new file mode 100644 index 0000000..e3874ca --- /dev/null +++ b/jcapiv2/test/test_command_results_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.api.command_results_api import CommandResultsApi # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestCommandResultsApi(unittest.TestCase): + """CommandResultsApi unit test stubs""" + + def setUp(self): + self.api = CommandResultsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_commands_list_results_by_workflow(self): + """Test case for commands_list_results_by_workflow + + List all Command Results by Workflow # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_commands_api.py b/jcapiv2/test/test_commands_api.py index c00b3c2..640d6b9 100644 --- a/jcapiv2/test/test_commands_api.py +++ b/jcapiv2/test/test_commands_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,11 +23,25 @@ class TestCommandsApi(unittest.TestCase): """CommandsApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.commands_api.CommandsApi() # noqa: E501 + self.api = CommandsApi() # noqa: E501 def tearDown(self): pass + def test_commands_cancel_queued_commands_by_workflow_instance_id(self): + """Test case for commands_cancel_queued_commands_by_workflow_instance_id + + Cancel all queued commands for an organization by workflow instance Id # noqa: E501 + """ + pass + + def test_commands_get_queued_commands_by_workflow(self): + """Test case for commands_get_queued_commands_by_workflow + + Fetch the queued Commands for an Organization # noqa: E501 + """ + pass + def test_graph_command_associations_list(self): """Test case for graph_command_associations_list diff --git a/jcapiv2/test/test_connect_wise_mapping_request.py b/jcapiv2/test/test_connect_wise_mapping_request.py new file mode 100644 index 0000000..f2f570f --- /dev/null +++ b/jcapiv2/test/test_connect_wise_mapping_request.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connect_wise_mapping_request import ConnectWiseMappingRequest # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectWiseMappingRequest(unittest.TestCase): + """ConnectWiseMappingRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectWiseMappingRequest(self): + """Test ConnectWiseMappingRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connect_wise_mapping_request.ConnectWiseMappingRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connect_wise_mapping_request_company.py b/jcapiv2/test/test_connect_wise_mapping_request_company.py new file mode 100644 index 0000000..086a308 --- /dev/null +++ b/jcapiv2/test/test_connect_wise_mapping_request_company.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connect_wise_mapping_request_company import ConnectWiseMappingRequestCompany # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectWiseMappingRequestCompany(unittest.TestCase): + """ConnectWiseMappingRequestCompany unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectWiseMappingRequestCompany(self): + """Test ConnectWiseMappingRequestCompany""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connect_wise_mapping_request_company.ConnectWiseMappingRequestCompany() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connect_wise_mapping_request_data.py b/jcapiv2/test/test_connect_wise_mapping_request_data.py new file mode 100644 index 0000000..e4491c9 --- /dev/null +++ b/jcapiv2/test/test_connect_wise_mapping_request_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connect_wise_mapping_request_data import ConnectWiseMappingRequestData # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectWiseMappingRequestData(unittest.TestCase): + """ConnectWiseMappingRequestData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectWiseMappingRequestData(self): + """Test ConnectWiseMappingRequestData""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connect_wise_mapping_request_data.ConnectWiseMappingRequestData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connect_wise_mapping_request_organization.py b/jcapiv2/test/test_connect_wise_mapping_request_organization.py new file mode 100644 index 0000000..4724467 --- /dev/null +++ b/jcapiv2/test/test_connect_wise_mapping_request_organization.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connect_wise_mapping_request_organization import ConnectWiseMappingRequestOrganization # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectWiseMappingRequestOrganization(unittest.TestCase): + """ConnectWiseMappingRequestOrganization unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectWiseMappingRequestOrganization(self): + """Test ConnectWiseMappingRequestOrganization""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connect_wise_mapping_request_organization.ConnectWiseMappingRequestOrganization() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connect_wise_mapping_response.py b/jcapiv2/test/test_connect_wise_mapping_response.py new file mode 100644 index 0000000..8ab2045 --- /dev/null +++ b/jcapiv2/test/test_connect_wise_mapping_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connect_wise_mapping_response import ConnectWiseMappingResponse # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectWiseMappingResponse(unittest.TestCase): + """ConnectWiseMappingResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectWiseMappingResponse(self): + """Test ConnectWiseMappingResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connect_wise_mapping_response.ConnectWiseMappingResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connect_wise_mapping_response_addition.py b/jcapiv2/test/test_connect_wise_mapping_response_addition.py new file mode 100644 index 0000000..949578d --- /dev/null +++ b/jcapiv2/test/test_connect_wise_mapping_response_addition.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connect_wise_mapping_response_addition import ConnectWiseMappingResponseAddition # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectWiseMappingResponseAddition(unittest.TestCase): + """ConnectWiseMappingResponseAddition unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectWiseMappingResponseAddition(self): + """Test ConnectWiseMappingResponseAddition""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connect_wise_mapping_response_addition.ConnectWiseMappingResponseAddition() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connect_wise_settings.py b/jcapiv2/test/test_connect_wise_settings.py new file mode 100644 index 0000000..fbecebe --- /dev/null +++ b/jcapiv2/test/test_connect_wise_settings.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connect_wise_settings import ConnectWiseSettings # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectWiseSettings(unittest.TestCase): + """ConnectWiseSettings unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectWiseSettings(self): + """Test ConnectWiseSettings""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connect_wise_settings.ConnectWiseSettings() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connect_wise_settings_patch_req.py b/jcapiv2/test/test_connect_wise_settings_patch_req.py new file mode 100644 index 0000000..ed8c5e1 --- /dev/null +++ b/jcapiv2/test/test_connect_wise_settings_patch_req.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connect_wise_settings_patch_req import ConnectWiseSettingsPatchReq # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectWiseSettingsPatchReq(unittest.TestCase): + """ConnectWiseSettingsPatchReq unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectWiseSettingsPatchReq(self): + """Test ConnectWiseSettingsPatchReq""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connect_wise_settings_patch_req.ConnectWiseSettingsPatchReq() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connect_wise_ticketing_alert_configuration.py b/jcapiv2/test/test_connect_wise_ticketing_alert_configuration.py new file mode 100644 index 0000000..06961bd --- /dev/null +++ b/jcapiv2/test/test_connect_wise_ticketing_alert_configuration.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connect_wise_ticketing_alert_configuration import ConnectWiseTicketingAlertConfiguration # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectWiseTicketingAlertConfiguration(unittest.TestCase): + """ConnectWiseTicketingAlertConfiguration unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectWiseTicketingAlertConfiguration(self): + """Test ConnectWiseTicketingAlertConfiguration""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connect_wise_ticketing_alert_configuration.ConnectWiseTicketingAlertConfiguration() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connect_wise_ticketing_alert_configuration_list.py b/jcapiv2/test/test_connect_wise_ticketing_alert_configuration_list.py new file mode 100644 index 0000000..7e669cf --- /dev/null +++ b/jcapiv2/test/test_connect_wise_ticketing_alert_configuration_list.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connect_wise_ticketing_alert_configuration_list import ConnectWiseTicketingAlertConfigurationList # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectWiseTicketingAlertConfigurationList(unittest.TestCase): + """ConnectWiseTicketingAlertConfigurationList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectWiseTicketingAlertConfigurationList(self): + """Test ConnectWiseTicketingAlertConfigurationList""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connect_wise_ticketing_alert_configuration_list.ConnectWiseTicketingAlertConfigurationList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connect_wise_ticketing_alert_configuration_option.py b/jcapiv2/test/test_connect_wise_ticketing_alert_configuration_option.py new file mode 100644 index 0000000..9f513dc --- /dev/null +++ b/jcapiv2/test/test_connect_wise_ticketing_alert_configuration_option.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connect_wise_ticketing_alert_configuration_option import ConnectWiseTicketingAlertConfigurationOption # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectWiseTicketingAlertConfigurationOption(unittest.TestCase): + """ConnectWiseTicketingAlertConfigurationOption unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectWiseTicketingAlertConfigurationOption(self): + """Test ConnectWiseTicketingAlertConfigurationOption""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connect_wise_ticketing_alert_configuration_option.ConnectWiseTicketingAlertConfigurationOption() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connect_wise_ticketing_alert_configuration_options.py b/jcapiv2/test/test_connect_wise_ticketing_alert_configuration_options.py new file mode 100644 index 0000000..e7036ce --- /dev/null +++ b/jcapiv2/test/test_connect_wise_ticketing_alert_configuration_options.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connect_wise_ticketing_alert_configuration_options import ConnectWiseTicketingAlertConfigurationOptions # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectWiseTicketingAlertConfigurationOptions(unittest.TestCase): + """ConnectWiseTicketingAlertConfigurationOptions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectWiseTicketingAlertConfigurationOptions(self): + """Test ConnectWiseTicketingAlertConfigurationOptions""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connect_wise_ticketing_alert_configuration_options.ConnectWiseTicketingAlertConfigurationOptions() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connect_wise_ticketing_alert_configuration_request.py b/jcapiv2/test/test_connect_wise_ticketing_alert_configuration_request.py new file mode 100644 index 0000000..2e87a10 --- /dev/null +++ b/jcapiv2/test/test_connect_wise_ticketing_alert_configuration_request.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connect_wise_ticketing_alert_configuration_request import ConnectWiseTicketingAlertConfigurationRequest # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectWiseTicketingAlertConfigurationRequest(unittest.TestCase): + """ConnectWiseTicketingAlertConfigurationRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectWiseTicketingAlertConfigurationRequest(self): + """Test ConnectWiseTicketingAlertConfigurationRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connect_wise_ticketing_alert_configuration_request.ConnectWiseTicketingAlertConfigurationRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connectwise_addition.py b/jcapiv2/test/test_connectwise_addition.py new file mode 100644 index 0000000..bc7b8d5 --- /dev/null +++ b/jcapiv2/test/test_connectwise_addition.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connectwise_addition import ConnectwiseAddition # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectwiseAddition(unittest.TestCase): + """ConnectwiseAddition unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectwiseAddition(self): + """Test ConnectwiseAddition""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connectwise_addition.ConnectwiseAddition() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connectwise_agreement.py b/jcapiv2/test/test_connectwise_agreement.py new file mode 100644 index 0000000..fbd6822 --- /dev/null +++ b/jcapiv2/test/test_connectwise_agreement.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connectwise_agreement import ConnectwiseAgreement # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectwiseAgreement(unittest.TestCase): + """ConnectwiseAgreement unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectwiseAgreement(self): + """Test ConnectwiseAgreement""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connectwise_agreement.ConnectwiseAgreement() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connectwise_company.py b/jcapiv2/test/test_connectwise_company.py new file mode 100644 index 0000000..5eae1a1 --- /dev/null +++ b/jcapiv2/test/test_connectwise_company.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connectwise_company import ConnectwiseCompany # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectwiseCompany(unittest.TestCase): + """ConnectwiseCompany unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectwiseCompany(self): + """Test ConnectwiseCompany""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connectwise_company.ConnectwiseCompany() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connectwise_company_resp.py b/jcapiv2/test/test_connectwise_company_resp.py new file mode 100644 index 0000000..4aa0ef8 --- /dev/null +++ b/jcapiv2/test/test_connectwise_company_resp.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connectwise_company_resp import ConnectwiseCompanyResp # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectwiseCompanyResp(unittest.TestCase): + """ConnectwiseCompanyResp unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectwiseCompanyResp(self): + """Test ConnectwiseCompanyResp""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connectwise_company_resp.ConnectwiseCompanyResp() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connectwise_company_type_resp.py b/jcapiv2/test/test_connectwise_company_type_resp.py new file mode 100644 index 0000000..79260b1 --- /dev/null +++ b/jcapiv2/test/test_connectwise_company_type_resp.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connectwise_company_type_resp import ConnectwiseCompanyTypeResp # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectwiseCompanyTypeResp(unittest.TestCase): + """ConnectwiseCompanyTypeResp unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectwiseCompanyTypeResp(self): + """Test ConnectwiseCompanyTypeResp""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connectwise_company_type_resp.ConnectwiseCompanyTypeResp() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connectwise_integration.py b/jcapiv2/test/test_connectwise_integration.py new file mode 100644 index 0000000..6d8c4b4 --- /dev/null +++ b/jcapiv2/test/test_connectwise_integration.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connectwise_integration import ConnectwiseIntegration # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectwiseIntegration(unittest.TestCase): + """ConnectwiseIntegration unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectwiseIntegration(self): + """Test ConnectwiseIntegration""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connectwise_integration.ConnectwiseIntegration() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connectwise_integration_patch_req.py b/jcapiv2/test/test_connectwise_integration_patch_req.py new file mode 100644 index 0000000..0473e5d --- /dev/null +++ b/jcapiv2/test/test_connectwise_integration_patch_req.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connectwise_integration_patch_req import ConnectwiseIntegrationPatchReq # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectwiseIntegrationPatchReq(unittest.TestCase): + """ConnectwiseIntegrationPatchReq unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectwiseIntegrationPatchReq(self): + """Test ConnectwiseIntegrationPatchReq""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connectwise_integration_patch_req.ConnectwiseIntegrationPatchReq() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_connectwise_integration_req.py b/jcapiv2/test/test_connectwise_integration_req.py new file mode 100644 index 0000000..10c2368 --- /dev/null +++ b/jcapiv2/test/test_connectwise_integration_req.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.connectwise_integration_req import ConnectwiseIntegrationReq # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestConnectwiseIntegrationReq(unittest.TestCase): + """ConnectwiseIntegrationReq unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConnectwiseIntegrationReq(self): + """Test ConnectwiseIntegrationReq""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.connectwise_integration_req.ConnectwiseIntegrationReq() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_custom_email.py b/jcapiv2/test/test_custom_email.py new file mode 100644 index 0000000..eb96454 --- /dev/null +++ b/jcapiv2/test/test_custom_email.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.custom_email import CustomEmail # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestCustomEmail(unittest.TestCase): + """CustomEmail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCustomEmail(self): + """Test CustomEmail""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.custom_email.CustomEmail() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_custom_email_template.py b/jcapiv2/test/test_custom_email_template.py new file mode 100644 index 0000000..60753e5 --- /dev/null +++ b/jcapiv2/test/test_custom_email_template.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.custom_email_template import CustomEmailTemplate # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestCustomEmailTemplate(unittest.TestCase): + """CustomEmailTemplate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCustomEmailTemplate(self): + """Test CustomEmailTemplate""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.custom_email_template.CustomEmailTemplate() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_custom_email_template_field.py b/jcapiv2/test/test_custom_email_template_field.py new file mode 100644 index 0000000..bbeee60 --- /dev/null +++ b/jcapiv2/test/test_custom_email_template_field.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.custom_email_template_field import CustomEmailTemplateField # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestCustomEmailTemplateField(unittest.TestCase): + """CustomEmailTemplateField unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCustomEmailTemplateField(self): + """Test CustomEmailTemplateField""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.custom_email_template_field.CustomEmailTemplateField() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_custom_email_type.py b/jcapiv2/test/test_custom_email_type.py new file mode 100644 index 0000000..49bea66 --- /dev/null +++ b/jcapiv2/test/test_custom_email_type.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.custom_email_type import CustomEmailType # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestCustomEmailType(unittest.TestCase): + """CustomEmailType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCustomEmailType(self): + """Test CustomEmailType""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.custom_email_type.CustomEmailType() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_custom_emails_api.py b/jcapiv2/test/test_custom_emails_api.py new file mode 100644 index 0000000..5e74324 --- /dev/null +++ b/jcapiv2/test/test_custom_emails_api.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.api.custom_emails_api import CustomEmailsApi # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestCustomEmailsApi(unittest.TestCase): + """CustomEmailsApi unit test stubs""" + + def setUp(self): + self.api = CustomEmailsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_custom_emails_create(self): + """Test case for custom_emails_create + + Create custom email configuration # noqa: E501 + """ + pass + + def test_custom_emails_destroy(self): + """Test case for custom_emails_destroy + + Delete custom email configuration # noqa: E501 + """ + pass + + def test_custom_emails_get_templates(self): + """Test case for custom_emails_get_templates + + List custom email templates # noqa: E501 + """ + pass + + def test_custom_emails_read(self): + """Test case for custom_emails_read + + Get custom email configuration # noqa: E501 + """ + pass + + def test_custom_emails_update(self): + """Test case for custom_emails_update + + Update custom email configuration # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_default_api.py b/jcapiv2/test/test_default_api.py deleted file mode 100644 index 62aa47d..0000000 --- a/jcapiv2/test/test_default_api.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.api.default_api import DefaultApi # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestDefaultApi(unittest.TestCase): - """DefaultApi unit test stubs""" - - def setUp(self): - self.api = jcapiv2.api.default_api.DefaultApi() # noqa: E501 - - def tearDown(self): - pass - - def test_jc_enrollment_profiles_delete(self): - """Test case for jc_enrollment_profiles_delete - - Delete Enrollment Profile # noqa: E501 - """ - pass - - def test_jc_enrollment_profiles_get(self): - """Test case for jc_enrollment_profiles_get - - Get Enrollment Profile # noqa: E501 - """ - pass - - def test_jc_enrollment_profiles_list(self): - """Test case for jc_enrollment_profiles_list - - List Enrollment Profiles # noqa: E501 - """ - pass - - def test_jc_enrollment_profiles_post(self): - """Test case for jc_enrollment_profiles_post - - Create new Enrollment Profile # noqa: E501 - """ - pass - - def test_jc_enrollment_profiles_put(self): - """Test case for jc_enrollment_profiles_put - - Update Enrollment Profile # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_dep.py b/jcapiv2/test/test_dep.py new file mode 100644 index 0000000..a779396 --- /dev/null +++ b/jcapiv2/test/test_dep.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.dep import DEP # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestDEP(unittest.TestCase): + """DEP unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDEP(self): + """Test DEP""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.dep.DEP() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_dep_setup_assistant_option.py b/jcapiv2/test/test_dep_setup_assistant_option.py new file mode 100644 index 0000000..03275b1 --- /dev/null +++ b/jcapiv2/test/test_dep_setup_assistant_option.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.dep_setup_assistant_option import DEPSetupAssistantOption # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestDEPSetupAssistantOption(unittest.TestCase): + """DEPSetupAssistantOption unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDEPSetupAssistantOption(self): + """Test DEPSetupAssistantOption""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.dep_setup_assistant_option.DEPSetupAssistantOption() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_dep_welcome_screen.py b/jcapiv2/test/test_dep_welcome_screen.py new file mode 100644 index 0000000..4cfce0b --- /dev/null +++ b/jcapiv2/test/test_dep_welcome_screen.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.dep_welcome_screen import DEPWelcomeScreen # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestDEPWelcomeScreen(unittest.TestCase): + """DEPWelcomeScreen unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDEPWelcomeScreen(self): + """Test DEPWelcomeScreen""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.dep_welcome_screen.DEPWelcomeScreen() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_device_id_erase_body.py b/jcapiv2/test/test_device_id_erase_body.py new file mode 100644 index 0000000..84e311d --- /dev/null +++ b/jcapiv2/test/test_device_id_erase_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.device_id_erase_body import DeviceIdEraseBody # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestDeviceIdEraseBody(unittest.TestCase): + """DeviceIdEraseBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDeviceIdEraseBody(self): + """Test DeviceIdEraseBody""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.device_id_erase_body.DeviceIdEraseBody() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_device_id_lock_body.py b/jcapiv2/test/test_device_id_lock_body.py new file mode 100644 index 0000000..b6fa402 --- /dev/null +++ b/jcapiv2/test/test_device_id_lock_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.device_id_lock_body import DeviceIdLockBody # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestDeviceIdLockBody(unittest.TestCase): + """DeviceIdLockBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDeviceIdLockBody(self): + """Test DeviceIdLockBody""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.device_id_lock_body.DeviceIdLockBody() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_device_id_restart_body.py b/jcapiv2/test/test_device_id_restart_body.py new file mode 100644 index 0000000..0c30067 --- /dev/null +++ b/jcapiv2/test/test_device_id_restart_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.device_id_restart_body import DeviceIdRestartBody # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestDeviceIdRestartBody(unittest.TestCase): + """DeviceIdRestartBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDeviceIdRestartBody(self): + """Test DeviceIdRestartBody""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.device_id_restart_body.DeviceIdRestartBody() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_directories_api.py b/jcapiv2/test/test_directories_api.py index b76d0f6..8ebf30a 100644 --- a/jcapiv2/test/test_directories_api.py +++ b/jcapiv2/test/test_directories_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestDirectoriesApi(unittest.TestCase): """DirectoriesApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.directories_api.DirectoriesApi() # noqa: E501 + self.api = DirectoriesApi() # noqa: E501 def tearDown(self): pass diff --git a/jcapiv2/test/test_directory.py b/jcapiv2/test/test_directory.py index df0fc3c..3e4bd97 100644 --- a/jcapiv2/test/test_directory.py +++ b/jcapiv2/test/test_directory.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_duo_account.py b/jcapiv2/test/test_duo_account.py index ea393f7..20573c6 100644 --- a/jcapiv2/test/test_duo_account.py +++ b/jcapiv2/test/test_duo_account.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_duo_api.py b/jcapiv2/test/test_duo_api.py index 6ef1ede..e3356bb 100644 --- a/jcapiv2/test/test_duo_api.py +++ b/jcapiv2/test/test_duo_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestDuoApi(unittest.TestCase): """DuoApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.duo_api.DuoApi() # noqa: E501 + self.api = DuoApi() # noqa: E501 def tearDown(self): pass @@ -46,7 +45,7 @@ def test_duo_account_get(self): def test_duo_account_list(self): """Test case for duo_account_list - List Duo Acounts # noqa: E501 + List Duo Accounts # noqa: E501 """ pass diff --git a/jcapiv2/test/test_duo_application.py b/jcapiv2/test/test_duo_application.py index cb3a33f..832ad24 100644 --- a/jcapiv2/test/test_duo_application.py +++ b/jcapiv2/test/test_duo_application.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_duo_application_req.py b/jcapiv2/test/test_duo_application_req.py index 1316f6f..a0e2656 100644 --- a/jcapiv2/test/test_duo_application_req.py +++ b/jcapiv2/test/test_duo_application_req.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_duo_application_update_req.py b/jcapiv2/test/test_duo_application_update_req.py index 8518749..1fa4372 100644 --- a/jcapiv2/test/test_duo_application_update_req.py +++ b/jcapiv2/test/test_duo_application_update_req.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_duo_registration_application.py b/jcapiv2/test/test_duo_registration_application.py deleted file mode 100644 index 5d8762a..0000000 --- a/jcapiv2/test/test_duo_registration_application.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.duo_registration_application import DuoRegistrationApplication # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestDuoRegistrationApplication(unittest.TestCase): - """DuoRegistrationApplication unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDuoRegistrationApplication(self): - """Test DuoRegistrationApplication""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.duo_registration_application.DuoRegistrationApplication() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_duo_registration_application_req.py b/jcapiv2/test/test_duo_registration_application_req.py deleted file mode 100644 index badb25f..0000000 --- a/jcapiv2/test/test_duo_registration_application_req.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.duo_registration_application_req import DuoRegistrationApplicationReq # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestDuoRegistrationApplicationReq(unittest.TestCase): - """DuoRegistrationApplicationReq unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDuoRegistrationApplicationReq(self): - """Test DuoRegistrationApplicationReq""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.duo_registration_application_req.DuoRegistrationApplicationReq() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_emailrequest.py b/jcapiv2/test/test_emailrequest.py deleted file mode 100644 index 89e9e27..0000000 --- a/jcapiv2/test/test_emailrequest.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.emailrequest import Emailrequest # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestEmailrequest(unittest.TestCase): - """Emailrequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEmailrequest(self): - """Test Emailrequest""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.emailrequest.Emailrequest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_enrollment_profile.py b/jcapiv2/test/test_enrollment_profile.py deleted file mode 100644 index 8e5f484..0000000 --- a/jcapiv2/test/test_enrollment_profile.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.enrollment_profile import EnrollmentProfile # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestEnrollmentProfile(unittest.TestCase): - """EnrollmentProfile unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnrollmentProfile(self): - """Test EnrollmentProfile""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.enrollment_profile.EnrollmentProfile() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_error.py b/jcapiv2/test/test_error.py index 98ec505..837fd57 100644 --- a/jcapiv2/test/test_error.py +++ b/jcapiv2/test/test_error.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_error_details.py b/jcapiv2/test/test_error_details.py new file mode 100644 index 0000000..50f34f2 --- /dev/null +++ b/jcapiv2/test/test_error_details.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.error_details import ErrorDetails # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestErrorDetails(unittest.TestCase): + """ErrorDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testErrorDetails(self): + """Test ErrorDetails""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.error_details.ErrorDetails() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_errorresponse.py b/jcapiv2/test/test_errorresponse.py deleted file mode 100644 index 93de332..0000000 --- a/jcapiv2/test/test_errorresponse.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.errorresponse import Errorresponse # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestErrorresponse(unittest.TestCase): - """Errorresponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testErrorresponse(self): - """Test Errorresponse""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.errorresponse.Errorresponse() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_fde_api.py b/jcapiv2/test/test_fde_api.py index 3edf41d..1fa7c54 100644 --- a/jcapiv2/test/test_fde_api.py +++ b/jcapiv2/test/test_fde_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestFdeApi(unittest.TestCase): """FdeApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.fde_api.FdeApi() # noqa: E501 + self.api = FdeApi() # noqa: E501 def tearDown(self): pass diff --git a/jcapiv2/test/test_feature.py b/jcapiv2/test/test_feature.py new file mode 100644 index 0000000..ff8ca18 --- /dev/null +++ b/jcapiv2/test/test_feature.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.feature import Feature # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestFeature(unittest.TestCase): + """Feature unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFeature(self): + """Test Feature""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.feature.Feature() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_filter.py b/jcapiv2/test/test_filter.py new file mode 100644 index 0000000..d153a85 --- /dev/null +++ b/jcapiv2/test/test_filter.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.filter import Filter # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestFilter(unittest.TestCase): + """Filter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFilter(self): + """Test Filter""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.filter.Filter() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_filter_query.py b/jcapiv2/test/test_filter_query.py new file mode 100644 index 0000000..68ab1e3 --- /dev/null +++ b/jcapiv2/test/test_filter_query.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.filter_query import FilterQuery # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestFilterQuery(unittest.TestCase): + """FilterQuery unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFilterQuery(self): + """Test FilterQuery""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.filter_query.FilterQuery() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_g_suite_api.py b/jcapiv2/test/test_g_suite_api.py index e1d7264..7d18caf 100644 --- a/jcapiv2/test/test_g_suite_api.py +++ b/jcapiv2/test/test_g_suite_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestGSuiteApi(unittest.TestCase): """GSuiteApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.g_suite_api.GSuiteApi() # noqa: E501 + self.api = GSuiteApi() # noqa: E501 def tearDown(self): pass @@ -64,6 +63,20 @@ def test_gsuites_get(self): """ pass + def test_gsuites_list_import_jumpcloud_users(self): + """Test case for gsuites_list_import_jumpcloud_users + + Get a list of users in Jumpcloud format to import from a Google Workspace account. # noqa: E501 + """ + pass + + def test_gsuites_list_import_users(self): + """Test case for gsuites_list_import_users + + Get a list of users to import from a G Suite instance # noqa: E501 + """ + pass + def test_gsuites_patch(self): """Test case for gsuites_patch diff --git a/jcapiv2/test/test_g_suite_builtin_translation.py b/jcapiv2/test/test_g_suite_builtin_translation.py index 5318670..6d9b6d4 100644 --- a/jcapiv2/test/test_g_suite_builtin_translation.py +++ b/jcapiv2/test/test_g_suite_builtin_translation.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_g_suite_direction_translation.py b/jcapiv2/test/test_g_suite_direction_translation.py new file mode 100644 index 0000000..57c0fdf --- /dev/null +++ b/jcapiv2/test/test_g_suite_direction_translation.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.g_suite_direction_translation import GSuiteDirectionTranslation # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGSuiteDirectionTranslation(unittest.TestCase): + """GSuiteDirectionTranslation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGSuiteDirectionTranslation(self): + """Test GSuiteDirectionTranslation""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.g_suite_direction_translation.GSuiteDirectionTranslation() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_g_suite_import_api.py b/jcapiv2/test/test_g_suite_import_api.py new file mode 100644 index 0000000..d4fc5d4 --- /dev/null +++ b/jcapiv2/test/test_g_suite_import_api.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.api.g_suite_import_api import GSuiteImportApi # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGSuiteImportApi(unittest.TestCase): + """GSuiteImportApi unit test stubs""" + + def setUp(self): + self.api = GSuiteImportApi() # noqa: E501 + + def tearDown(self): + pass + + def test_gsuites_list_import_jumpcloud_users(self): + """Test case for gsuites_list_import_jumpcloud_users + + Get a list of users in Jumpcloud format to import from a Google Workspace account. # noqa: E501 + """ + pass + + def test_gsuites_list_import_users(self): + """Test case for gsuites_list_import_users + + Get a list of users to import from a G Suite instance # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_g_suite_translation_rule.py b/jcapiv2/test/test_g_suite_translation_rule.py index c6dacae..cbf7b6f 100644 --- a/jcapiv2/test/test_g_suite_translation_rule.py +++ b/jcapiv2/test/test_g_suite_translation_rule.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_g_suite_translation_rule_request.py b/jcapiv2/test/test_g_suite_translation_rule_request.py index 0aa30cd..7ed6647 100644 --- a/jcapiv2/test/test_g_suite_translation_rule_request.py +++ b/jcapiv2/test/test_g_suite_translation_rule_request.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_graph_api.py b/jcapiv2/test/test_graph_api.py index 109ba03..f3d75a2 100644 --- a/jcapiv2/test/test_graph_api.py +++ b/jcapiv2/test/test_graph_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestGraphApi(unittest.TestCase): """GraphApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.graph_api.GraphApi() # noqa: E501 + self.api = GraphApi() # noqa: E501 def tearDown(self): pass @@ -211,6 +210,62 @@ def test_graph_policy_associations_post(self): """ pass + def test_graph_policy_group_associations_list(self): + """Test case for graph_policy_group_associations_list + + List the associations of a Policy Group. # noqa: E501 + """ + pass + + def test_graph_policy_group_associations_post(self): + """Test case for graph_policy_group_associations_post + + Manage the associations of a Policy Group # noqa: E501 + """ + pass + + def test_graph_policy_group_members_list(self): + """Test case for graph_policy_group_members_list + + List the members of a Policy Group # noqa: E501 + """ + pass + + def test_graph_policy_group_members_post(self): + """Test case for graph_policy_group_members_post + + Manage the members of a Policy Group # noqa: E501 + """ + pass + + def test_graph_policy_group_membership(self): + """Test case for graph_policy_group_membership + + List the Policy Group's membership # noqa: E501 + """ + pass + + def test_graph_policy_group_traverse_system(self): + """Test case for graph_policy_group_traverse_system + + List the Systems bound to a Policy Group # noqa: E501 + """ + pass + + def test_graph_policy_group_traverse_system_group(self): + """Test case for graph_policy_group_traverse_system_group + + List the System Groups bound to Policy Groups # noqa: E501 + """ + pass + + def test_graph_policy_member_of(self): + """Test case for graph_policy_member_of + + List the parent Groups of a Policy # noqa: E501 + """ + pass + def test_graph_policy_traverse_system(self): """Test case for graph_policy_traverse_system @@ -253,6 +308,34 @@ def test_graph_radius_server_traverse_user_group(self): """ pass + def test_graph_softwareapps_associations_list(self): + """Test case for graph_softwareapps_associations_list + + List the associations of a Software Application # noqa: E501 + """ + pass + + def test_graph_softwareapps_associations_post(self): + """Test case for graph_softwareapps_associations_post + + Manage the associations of a software application. # noqa: E501 + """ + pass + + def test_graph_softwareapps_traverse_system(self): + """Test case for graph_softwareapps_traverse_system + + List the Systems bound to a Software App. # noqa: E501 + """ + pass + + def test_graph_softwareapps_traverse_system_group(self): + """Test case for graph_softwareapps_traverse_system_group + + List the System Groups bound to a Software App. # noqa: E501 + """ + pass + def test_graph_system_associations_list(self): """Test case for graph_system_associations_list @@ -281,13 +364,6 @@ def test_graph_system_group_associations_post(self): """ pass - def test_graph_system_group_member_of(self): - """Test case for graph_system_group_member_of - - List the System Group's parents # noqa: E501 - """ - pass - def test_graph_system_group_members_list(self): """Test case for graph_system_group_members_list @@ -323,6 +399,13 @@ def test_graph_system_group_traverse_policy(self): """ pass + def test_graph_system_group_traverse_policy_group(self): + """Test case for graph_system_group_traverse_policy_group + + List the Policy Groups bound to a System Group # noqa: E501 + """ + pass + def test_graph_system_group_traverse_user(self): """Test case for graph_system_group_traverse_user @@ -358,6 +441,13 @@ def test_graph_system_traverse_policy(self): """ pass + def test_graph_system_traverse_policy_group(self): + """Test case for graph_system_traverse_policy_group + + List the Policy Groups bound to a System # noqa: E501 + """ + pass + def test_graph_system_traverse_user(self): """Test case for graph_system_traverse_user @@ -400,13 +490,6 @@ def test_graph_user_group_associations_post(self): """ pass - def test_graph_user_group_member_of(self): - """Test case for graph_user_group_member_of - - List the User Group's parents # noqa: E501 - """ - pass - def test_graph_user_group_members_list(self): """Test case for graph_user_group_members_list @@ -561,8 +644,8 @@ def test_graph_user_traverse_system_group(self): """ pass - def test_policystatuses_list(self): - """Test case for policystatuses_list + def test_policystatuses_systems_list(self): + """Test case for policystatuses_systems_list List the policy statuses for a system # noqa: E501 """ diff --git a/jcapiv2/test/test_graph_attribute_ldap_groups.py b/jcapiv2/test/test_graph_attribute_ldap_groups.py new file mode 100644 index 0000000..fc4c6e2 --- /dev/null +++ b/jcapiv2/test/test_graph_attribute_ldap_groups.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_attribute_ldap_groups import GraphAttributeLdapGroups # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphAttributeLdapGroups(unittest.TestCase): + """GraphAttributeLdapGroups unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphAttributeLdapGroups(self): + """Test GraphAttributeLdapGroups""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_attribute_ldap_groups.GraphAttributeLdapGroups() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_attribute_posix_groups.py b/jcapiv2/test/test_graph_attribute_posix_groups.py new file mode 100644 index 0000000..a9c7d65 --- /dev/null +++ b/jcapiv2/test/test_graph_attribute_posix_groups.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_attribute_posix_groups import GraphAttributePosixGroups # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphAttributePosixGroups(unittest.TestCase): + """GraphAttributePosixGroups unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphAttributePosixGroups(self): + """Test GraphAttributePosixGroups""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_attribute_posix_groups.GraphAttributePosixGroups() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_attribute_posix_groups_posix_groups.py b/jcapiv2/test/test_graph_attribute_posix_groups_posix_groups.py new file mode 100644 index 0000000..55e3b6c --- /dev/null +++ b/jcapiv2/test/test_graph_attribute_posix_groups_posix_groups.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_attribute_posix_groups_posix_groups import GraphAttributePosixGroupsPosixGroups # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphAttributePosixGroupsPosixGroups(unittest.TestCase): + """GraphAttributePosixGroupsPosixGroups unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphAttributePosixGroupsPosixGroups(self): + """Test GraphAttributePosixGroupsPosixGroups""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_attribute_posix_groups_posix_groups.GraphAttributePosixGroupsPosixGroups() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_attribute_radius.py b/jcapiv2/test/test_graph_attribute_radius.py new file mode 100644 index 0000000..4aaef5d --- /dev/null +++ b/jcapiv2/test/test_graph_attribute_radius.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_attribute_radius import GraphAttributeRadius # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphAttributeRadius(unittest.TestCase): + """GraphAttributeRadius unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphAttributeRadius(self): + """Test GraphAttributeRadius""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_attribute_radius.GraphAttributeRadius() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_attribute_radius_radius.py b/jcapiv2/test/test_graph_attribute_radius_radius.py new file mode 100644 index 0000000..9d5961d --- /dev/null +++ b/jcapiv2/test/test_graph_attribute_radius_radius.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_attribute_radius_radius import GraphAttributeRadiusRadius # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphAttributeRadiusRadius(unittest.TestCase): + """GraphAttributeRadiusRadius unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphAttributeRadiusRadius(self): + """Test GraphAttributeRadiusRadius""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_attribute_radius_radius.GraphAttributeRadiusRadius() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_attribute_radius_radius_reply.py b/jcapiv2/test/test_graph_attribute_radius_radius_reply.py new file mode 100644 index 0000000..343693e --- /dev/null +++ b/jcapiv2/test/test_graph_attribute_radius_radius_reply.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_attribute_radius_radius_reply import GraphAttributeRadiusRadiusReply # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphAttributeRadiusRadiusReply(unittest.TestCase): + """GraphAttributeRadiusRadiusReply unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphAttributeRadiusRadiusReply(self): + """Test GraphAttributeRadiusRadiusReply""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_attribute_radius_radius_reply.GraphAttributeRadiusRadiusReply() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_attribute_samba_enabled.py b/jcapiv2/test/test_graph_attribute_samba_enabled.py new file mode 100644 index 0000000..6641be6 --- /dev/null +++ b/jcapiv2/test/test_graph_attribute_samba_enabled.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_attribute_samba_enabled import GraphAttributeSambaEnabled # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphAttributeSambaEnabled(unittest.TestCase): + """GraphAttributeSambaEnabled unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphAttributeSambaEnabled(self): + """Test GraphAttributeSambaEnabled""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_attribute_samba_enabled.GraphAttributeSambaEnabled() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_attribute_sudo.py b/jcapiv2/test/test_graph_attribute_sudo.py new file mode 100644 index 0000000..bd5d28a --- /dev/null +++ b/jcapiv2/test/test_graph_attribute_sudo.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_attribute_sudo import GraphAttributeSudo # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphAttributeSudo(unittest.TestCase): + """GraphAttributeSudo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphAttributeSudo(self): + """Test GraphAttributeSudo""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_attribute_sudo.GraphAttributeSudo() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_attribute_sudo_sudo.py b/jcapiv2/test/test_graph_attribute_sudo_sudo.py new file mode 100644 index 0000000..d262d0e --- /dev/null +++ b/jcapiv2/test/test_graph_attribute_sudo_sudo.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_attribute_sudo_sudo import GraphAttributeSudoSudo # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphAttributeSudoSudo(unittest.TestCase): + """GraphAttributeSudoSudo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphAttributeSudoSudo(self): + """Test GraphAttributeSudoSudo""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_attribute_sudo_sudo.GraphAttributeSudoSudo() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_attributes.py b/jcapiv2/test/test_graph_attributes.py new file mode 100644 index 0000000..d5557ef --- /dev/null +++ b/jcapiv2/test/test_graph_attributes.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_attributes import GraphAttributes # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphAttributes(unittest.TestCase): + """GraphAttributes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphAttributes(self): + """Test GraphAttributes""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_attributes.GraphAttributes() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_connection.py b/jcapiv2/test/test_graph_connection.py index 1b179ba..54606d6 100644 --- a/jcapiv2/test/test_graph_connection.py +++ b/jcapiv2/test/test_graph_connection.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_graph_management_req.py b/jcapiv2/test/test_graph_management_req.py deleted file mode 100644 index 17da995..0000000 --- a/jcapiv2/test/test_graph_management_req.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.graph_management_req import GraphManagementReq # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestGraphManagementReq(unittest.TestCase): - """GraphManagementReq unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testGraphManagementReq(self): - """Test GraphManagementReq""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.graph_management_req.GraphManagementReq() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_graph_object.py b/jcapiv2/test/test_graph_object.py index 585f520..1574d75 100644 --- a/jcapiv2/test/test_graph_object.py +++ b/jcapiv2/test/test_graph_object.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_graph_object_with_paths.py b/jcapiv2/test/test_graph_object_with_paths.py index b829cde..637f953 100644 --- a/jcapiv2/test/test_graph_object_with_paths.py +++ b/jcapiv2/test/test_graph_object_with_paths.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_graph_operation.py b/jcapiv2/test/test_graph_operation.py new file mode 100644 index 0000000..81f37ce --- /dev/null +++ b/jcapiv2/test/test_graph_operation.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation import GraphOperation # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperation(unittest.TestCase): + """GraphOperation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperation(self): + """Test GraphOperation""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation.GraphOperation() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_operation_active_directory.py b/jcapiv2/test/test_graph_operation_active_directory.py new file mode 100644 index 0000000..49a579e --- /dev/null +++ b/jcapiv2/test/test_graph_operation_active_directory.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation_active_directory import GraphOperationActiveDirectory # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperationActiveDirectory(unittest.TestCase): + """GraphOperationActiveDirectory unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperationActiveDirectory(self): + """Test GraphOperationActiveDirectory""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation_active_directory.GraphOperationActiveDirectory() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_operation_application.py b/jcapiv2/test/test_graph_operation_application.py new file mode 100644 index 0000000..efc3be5 --- /dev/null +++ b/jcapiv2/test/test_graph_operation_application.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation_application import GraphOperationApplication # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperationApplication(unittest.TestCase): + """GraphOperationApplication unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperationApplication(self): + """Test GraphOperationApplication""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation_application.GraphOperationApplication() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_operation_command.py b/jcapiv2/test/test_graph_operation_command.py new file mode 100644 index 0000000..c62dd8a --- /dev/null +++ b/jcapiv2/test/test_graph_operation_command.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation_command import GraphOperationCommand # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperationCommand(unittest.TestCase): + """GraphOperationCommand unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperationCommand(self): + """Test GraphOperationCommand""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation_command.GraphOperationCommand() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_operation_g_suite.py b/jcapiv2/test/test_graph_operation_g_suite.py new file mode 100644 index 0000000..1d9f4cb --- /dev/null +++ b/jcapiv2/test/test_graph_operation_g_suite.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation_g_suite import GraphOperationGSuite # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperationGSuite(unittest.TestCase): + """GraphOperationGSuite unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperationGSuite(self): + """Test GraphOperationGSuite""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation_g_suite.GraphOperationGSuite() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_operation_ldap_server.py b/jcapiv2/test/test_graph_operation_ldap_server.py new file mode 100644 index 0000000..9b0f3cb --- /dev/null +++ b/jcapiv2/test/test_graph_operation_ldap_server.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation_ldap_server import GraphOperationLdapServer # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperationLdapServer(unittest.TestCase): + """GraphOperationLdapServer unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperationLdapServer(self): + """Test GraphOperationLdapServer""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation_ldap_server.GraphOperationLdapServer() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_operation_office365.py b/jcapiv2/test/test_graph_operation_office365.py new file mode 100644 index 0000000..d585da8 --- /dev/null +++ b/jcapiv2/test/test_graph_operation_office365.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation_office365 import GraphOperationOffice365 # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperationOffice365(unittest.TestCase): + """GraphOperationOffice365 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperationOffice365(self): + """Test GraphOperationOffice365""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation_office365.GraphOperationOffice365() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_operation_policy.py b/jcapiv2/test/test_graph_operation_policy.py new file mode 100644 index 0000000..2d80bad --- /dev/null +++ b/jcapiv2/test/test_graph_operation_policy.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation_policy import GraphOperationPolicy # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperationPolicy(unittest.TestCase): + """GraphOperationPolicy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperationPolicy(self): + """Test GraphOperationPolicy""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation_policy.GraphOperationPolicy() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_operation_policy_group.py b/jcapiv2/test/test_graph_operation_policy_group.py new file mode 100644 index 0000000..bd07f3f --- /dev/null +++ b/jcapiv2/test/test_graph_operation_policy_group.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation_policy_group import GraphOperationPolicyGroup # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperationPolicyGroup(unittest.TestCase): + """GraphOperationPolicyGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperationPolicyGroup(self): + """Test GraphOperationPolicyGroup""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation_policy_group.GraphOperationPolicyGroup() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_operation_policy_group_member.py b/jcapiv2/test/test_graph_operation_policy_group_member.py new file mode 100644 index 0000000..1406e4a --- /dev/null +++ b/jcapiv2/test/test_graph_operation_policy_group_member.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation_policy_group_member import GraphOperationPolicyGroupMember # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperationPolicyGroupMember(unittest.TestCase): + """GraphOperationPolicyGroupMember unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperationPolicyGroupMember(self): + """Test GraphOperationPolicyGroupMember""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation_policy_group_member.GraphOperationPolicyGroupMember() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_operation_radius_server.py b/jcapiv2/test/test_graph_operation_radius_server.py new file mode 100644 index 0000000..016c5d3 --- /dev/null +++ b/jcapiv2/test/test_graph_operation_radius_server.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation_radius_server import GraphOperationRadiusServer # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperationRadiusServer(unittest.TestCase): + """GraphOperationRadiusServer unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperationRadiusServer(self): + """Test GraphOperationRadiusServer""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation_radius_server.GraphOperationRadiusServer() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_operation_software_app.py b/jcapiv2/test/test_graph_operation_software_app.py new file mode 100644 index 0000000..e439725 --- /dev/null +++ b/jcapiv2/test/test_graph_operation_software_app.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation_software_app import GraphOperationSoftwareApp # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperationSoftwareApp(unittest.TestCase): + """GraphOperationSoftwareApp unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperationSoftwareApp(self): + """Test GraphOperationSoftwareApp""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation_software_app.GraphOperationSoftwareApp() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_operation_system.py b/jcapiv2/test/test_graph_operation_system.py new file mode 100644 index 0000000..6ee60d3 --- /dev/null +++ b/jcapiv2/test/test_graph_operation_system.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation_system import GraphOperationSystem # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperationSystem(unittest.TestCase): + """GraphOperationSystem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperationSystem(self): + """Test GraphOperationSystem""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation_system.GraphOperationSystem() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_operation_system_group.py b/jcapiv2/test/test_graph_operation_system_group.py new file mode 100644 index 0000000..bcb2a8d --- /dev/null +++ b/jcapiv2/test/test_graph_operation_system_group.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation_system_group import GraphOperationSystemGroup # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperationSystemGroup(unittest.TestCase): + """GraphOperationSystemGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperationSystemGroup(self): + """Test GraphOperationSystemGroup""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation_system_group.GraphOperationSystemGroup() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_operation_system_group_member.py b/jcapiv2/test/test_graph_operation_system_group_member.py new file mode 100644 index 0000000..7d6f154 --- /dev/null +++ b/jcapiv2/test/test_graph_operation_system_group_member.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation_system_group_member import GraphOperationSystemGroupMember # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperationSystemGroupMember(unittest.TestCase): + """GraphOperationSystemGroupMember unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperationSystemGroupMember(self): + """Test GraphOperationSystemGroupMember""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation_system_group_member.GraphOperationSystemGroupMember() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_operation_user.py b/jcapiv2/test/test_graph_operation_user.py new file mode 100644 index 0000000..11a27dc --- /dev/null +++ b/jcapiv2/test/test_graph_operation_user.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation_user import GraphOperationUser # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperationUser(unittest.TestCase): + """GraphOperationUser unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperationUser(self): + """Test GraphOperationUser""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation_user.GraphOperationUser() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_operation_user_group.py b/jcapiv2/test/test_graph_operation_user_group.py new file mode 100644 index 0000000..06fef40 --- /dev/null +++ b/jcapiv2/test/test_graph_operation_user_group.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation_user_group import GraphOperationUserGroup # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperationUserGroup(unittest.TestCase): + """GraphOperationUserGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperationUserGroup(self): + """Test GraphOperationUserGroup""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation_user_group.GraphOperationUserGroup() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_operation_user_group_member.py b/jcapiv2/test/test_graph_operation_user_group_member.py new file mode 100644 index 0000000..0e58978 --- /dev/null +++ b/jcapiv2/test/test_graph_operation_user_group_member.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.graph_operation_user_group_member import GraphOperationUserGroupMember # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGraphOperationUserGroupMember(unittest.TestCase): + """GraphOperationUserGroupMember unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGraphOperationUserGroupMember(self): + """Test GraphOperationUserGroupMember""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.graph_operation_user_group_member.GraphOperationUserGroupMember() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_graph_type.py b/jcapiv2/test/test_graph_type.py index 75947f6..6871a3d 100644 --- a/jcapiv2/test/test_graph_type.py +++ b/jcapiv2/test/test_graph_type.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_group.py b/jcapiv2/test/test_group.py index c68ce89..40fcd98 100644 --- a/jcapiv2/test/test_group.py +++ b/jcapiv2/test/test_group.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_group_attributes_user_group.py b/jcapiv2/test/test_group_attributes_user_group.py new file mode 100644 index 0000000..7332a2c --- /dev/null +++ b/jcapiv2/test/test_group_attributes_user_group.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.group_attributes_user_group import GroupAttributesUserGroup # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGroupAttributesUserGroup(unittest.TestCase): + """GroupAttributesUserGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGroupAttributesUserGroup(self): + """Test GroupAttributesUserGroup""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.group_attributes_user_group.GroupAttributesUserGroup() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_group_id_suggestions_body.py b/jcapiv2/test/test_group_id_suggestions_body.py new file mode 100644 index 0000000..1410b5b --- /dev/null +++ b/jcapiv2/test/test_group_id_suggestions_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.group_id_suggestions_body import GroupIdSuggestionsBody # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestGroupIdSuggestionsBody(unittest.TestCase): + """GroupIdSuggestionsBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGroupIdSuggestionsBody(self): + """Test GroupIdSuggestionsBody""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.group_id_suggestions_body.GroupIdSuggestionsBody() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_group_type.py b/jcapiv2/test/test_group_type.py index 7ea010f..b42f0d6 100644 --- a/jcapiv2/test/test_group_type.py +++ b/jcapiv2/test/test_group_type.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_groups_api.py b/jcapiv2/test/test_groups_api.py index 35644b1..e6729ee 100644 --- a/jcapiv2/test/test_groups_api.py +++ b/jcapiv2/test/test_groups_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestGroupsApi(unittest.TestCase): """GroupsApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.groups_api.GroupsApi() # noqa: E501 + self.api = GroupsApi() # noqa: E501 def tearDown(self): pass diff --git a/jcapiv2/test/test_gsuite_output.py b/jcapiv2/test/test_gsuite_output.py index b9aa916..5cf2fa6 100644 --- a/jcapiv2/test/test_gsuite_output.py +++ b/jcapiv2/test/test_gsuite_output.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_gsuite_patch_input.py b/jcapiv2/test/test_gsuite_patch_input.py index 2a137d7..fcb9aaf 100644 --- a/jcapiv2/test/test_gsuite_patch_input.py +++ b/jcapiv2/test/test_gsuite_patch_input.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_image_api.py b/jcapiv2/test/test_image_api.py new file mode 100644 index 0000000..61aee74 --- /dev/null +++ b/jcapiv2/test/test_image_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.api.image_api import ImageApi # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestImageApi(unittest.TestCase): + """ImageApi unit test stubs""" + + def setUp(self): + self.api = ImageApi() # noqa: E501 + + def tearDown(self): + pass + + def test_applications_delete_logo(self): + """Test case for applications_delete_logo + + Delete application image # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_import_user.py b/jcapiv2/test/test_import_user.py new file mode 100644 index 0000000..df25922 --- /dev/null +++ b/jcapiv2/test/test_import_user.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.import_user import ImportUser # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestImportUser(unittest.TestCase): + """ImportUser unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testImportUser(self): + """Test ImportUser""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.import_user.ImportUser() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_import_user_address.py b/jcapiv2/test/test_import_user_address.py new file mode 100644 index 0000000..38f73f7 --- /dev/null +++ b/jcapiv2/test/test_import_user_address.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.import_user_address import ImportUserAddress # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestImportUserAddress(unittest.TestCase): + """ImportUserAddress unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testImportUserAddress(self): + """Test ImportUserAddress""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.import_user_address.ImportUserAddress() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_import_user_phone_number.py b/jcapiv2/test/test_import_user_phone_number.py new file mode 100644 index 0000000..738fb6d --- /dev/null +++ b/jcapiv2/test/test_import_user_phone_number.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.import_user_phone_number import ImportUserPhoneNumber # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestImportUserPhoneNumber(unittest.TestCase): + """ImportUserPhoneNumber unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testImportUserPhoneNumber(self): + """Test ImportUserPhoneNumber""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.import_user_phone_number.ImportUserPhoneNumber() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_import_users_response.py b/jcapiv2/test/test_import_users_response.py new file mode 100644 index 0000000..80d60af --- /dev/null +++ b/jcapiv2/test/test_import_users_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.import_users_response import ImportUsersResponse # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestImportUsersResponse(unittest.TestCase): + """ImportUsersResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testImportUsersResponse(self): + """Test ImportUsersResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.import_users_response.ImportUsersResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_inline_response200.py b/jcapiv2/test/test_inline_response200.py index 628367a..0ac5213 100644 --- a/jcapiv2/test/test_inline_response200.py +++ b/jcapiv2/test/test_inline_response200.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_inline_response2001.py b/jcapiv2/test/test_inline_response2001.py index 66c2804..acef717 100644 --- a/jcapiv2/test/test_inline_response2001.py +++ b/jcapiv2/test/test_inline_response2001.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_inline_response20010.py b/jcapiv2/test/test_inline_response20010.py new file mode 100644 index 0000000..0bf70a6 --- /dev/null +++ b/jcapiv2/test/test_inline_response20010.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.inline_response20010 import InlineResponse20010 # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestInlineResponse20010(unittest.TestCase): + """InlineResponse20010 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse20010(self): + """Test InlineResponse20010""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.inline_response20010.InlineResponse20010() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_inline_response20011.py b/jcapiv2/test/test_inline_response20011.py new file mode 100644 index 0000000..d8cb296 --- /dev/null +++ b/jcapiv2/test/test_inline_response20011.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.inline_response20011 import InlineResponse20011 # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestInlineResponse20011(unittest.TestCase): + """InlineResponse20011 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse20011(self): + """Test InlineResponse20011""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.inline_response20011.InlineResponse20011() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_inline_response20011_users.py b/jcapiv2/test/test_inline_response20011_users.py new file mode 100644 index 0000000..53423c4 --- /dev/null +++ b/jcapiv2/test/test_inline_response20011_users.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.inline_response20011_users import InlineResponse20011Users # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestInlineResponse20011Users(unittest.TestCase): + """InlineResponse20011Users unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse20011Users(self): + """Test InlineResponse20011Users""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.inline_response20011_users.InlineResponse20011Users() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_inline_response20012.py b/jcapiv2/test/test_inline_response20012.py new file mode 100644 index 0000000..58a8767 --- /dev/null +++ b/jcapiv2/test/test_inline_response20012.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.inline_response20012 import InlineResponse20012 # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestInlineResponse20012(unittest.TestCase): + """InlineResponse20012 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse20012(self): + """Test InlineResponse20012""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.inline_response20012.InlineResponse20012() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_inline_response20013.py b/jcapiv2/test/test_inline_response20013.py new file mode 100644 index 0000000..600f2f1 --- /dev/null +++ b/jcapiv2/test/test_inline_response20013.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.inline_response20013 import InlineResponse20013 # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestInlineResponse20013(unittest.TestCase): + """InlineResponse20013 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse20013(self): + """Test InlineResponse20013""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.inline_response20013.InlineResponse20013() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_inline_response2002.py b/jcapiv2/test/test_inline_response2002.py new file mode 100644 index 0000000..e40aca1 --- /dev/null +++ b/jcapiv2/test/test_inline_response2002.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.inline_response2002 import InlineResponse2002 # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestInlineResponse2002(unittest.TestCase): + """InlineResponse2002 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse2002(self): + """Test InlineResponse2002""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.inline_response2002.InlineResponse2002() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_inline_response2002_users.py b/jcapiv2/test/test_inline_response2002_users.py new file mode 100644 index 0000000..dbeea04 --- /dev/null +++ b/jcapiv2/test/test_inline_response2002_users.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.inline_response2002_users import InlineResponse2002Users # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestInlineResponse2002Users(unittest.TestCase): + """InlineResponse2002Users unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse2002Users(self): + """Test InlineResponse2002Users""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.inline_response2002_users.InlineResponse2002Users() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_inline_response2003.py b/jcapiv2/test/test_inline_response2003.py new file mode 100644 index 0000000..7fa20b0 --- /dev/null +++ b/jcapiv2/test/test_inline_response2003.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.inline_response2003 import InlineResponse2003 # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestInlineResponse2003(unittest.TestCase): + """InlineResponse2003 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse2003(self): + """Test InlineResponse2003""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.inline_response2003.InlineResponse2003() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_inline_response2004.py b/jcapiv2/test/test_inline_response2004.py new file mode 100644 index 0000000..52ea91e --- /dev/null +++ b/jcapiv2/test/test_inline_response2004.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.inline_response2004 import InlineResponse2004 # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestInlineResponse2004(unittest.TestCase): + """InlineResponse2004 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse2004(self): + """Test InlineResponse2004""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.inline_response2004.InlineResponse2004() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_inline_response2005.py b/jcapiv2/test/test_inline_response2005.py new file mode 100644 index 0000000..c7e0cb9 --- /dev/null +++ b/jcapiv2/test/test_inline_response2005.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.inline_response2005 import InlineResponse2005 # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestInlineResponse2005(unittest.TestCase): + """InlineResponse2005 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse2005(self): + """Test InlineResponse2005""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.inline_response2005.InlineResponse2005() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_inline_response2006.py b/jcapiv2/test/test_inline_response2006.py new file mode 100644 index 0000000..a19bb8e --- /dev/null +++ b/jcapiv2/test/test_inline_response2006.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.inline_response2006 import InlineResponse2006 # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestInlineResponse2006(unittest.TestCase): + """InlineResponse2006 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse2006(self): + """Test InlineResponse2006""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.inline_response2006.InlineResponse2006() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_inline_response2007.py b/jcapiv2/test/test_inline_response2007.py new file mode 100644 index 0000000..4fc8145 --- /dev/null +++ b/jcapiv2/test/test_inline_response2007.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.inline_response2007 import InlineResponse2007 # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestInlineResponse2007(unittest.TestCase): + """InlineResponse2007 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse2007(self): + """Test InlineResponse2007""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.inline_response2007.InlineResponse2007() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_inline_response2008.py b/jcapiv2/test/test_inline_response2008.py new file mode 100644 index 0000000..074a8d6 --- /dev/null +++ b/jcapiv2/test/test_inline_response2008.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.inline_response2008 import InlineResponse2008 # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestInlineResponse2008(unittest.TestCase): + """InlineResponse2008 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse2008(self): + """Test InlineResponse2008""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.inline_response2008.InlineResponse2008() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_inline_response2009.py b/jcapiv2/test/test_inline_response2009.py new file mode 100644 index 0000000..e2c3752 --- /dev/null +++ b/jcapiv2/test/test_inline_response2009.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.inline_response2009 import InlineResponse2009 # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestInlineResponse2009(unittest.TestCase): + """InlineResponse2009 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse2009(self): + """Test InlineResponse2009""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.inline_response2009.InlineResponse2009() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_inline_response201.py b/jcapiv2/test/test_inline_response201.py index e91c3bc..02a1fac 100644 --- a/jcapiv2/test/test_inline_response201.py +++ b/jcapiv2/test/test_inline_response201.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_inline_response400.py b/jcapiv2/test/test_inline_response400.py index 4fedaa8..010e909 100644 --- a/jcapiv2/test/test_inline_response400.py +++ b/jcapiv2/test/test_inline_response400.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_integration.py b/jcapiv2/test/test_integration.py new file mode 100644 index 0000000..d939129 --- /dev/null +++ b/jcapiv2/test/test_integration.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.integration import Integration # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestIntegration(unittest.TestCase): + """Integration unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testIntegration(self): + """Test Integration""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.integration.Integration() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_integration_sync_error.py b/jcapiv2/test/test_integration_sync_error.py new file mode 100644 index 0000000..80e7d13 --- /dev/null +++ b/jcapiv2/test/test_integration_sync_error.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.integration_sync_error import IntegrationSyncError # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestIntegrationSyncError(unittest.TestCase): + """IntegrationSyncError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testIntegrationSyncError(self): + """Test IntegrationSyncError""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.integration_sync_error.IntegrationSyncError() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_integration_sync_error_resp.py b/jcapiv2/test/test_integration_sync_error_resp.py new file mode 100644 index 0000000..e3d954e --- /dev/null +++ b/jcapiv2/test/test_integration_sync_error_resp.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.integration_sync_error_resp import IntegrationSyncErrorResp # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestIntegrationSyncErrorResp(unittest.TestCase): + """IntegrationSyncErrorResp unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testIntegrationSyncErrorResp(self): + """Test IntegrationSyncErrorResp""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.integration_sync_error_resp.IntegrationSyncErrorResp() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_integration_type.py b/jcapiv2/test/test_integration_type.py new file mode 100644 index 0000000..3d42afe --- /dev/null +++ b/jcapiv2/test/test_integration_type.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.integration_type import IntegrationType # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestIntegrationType(unittest.TestCase): + """IntegrationType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testIntegrationType(self): + """Test IntegrationType""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.integration_type.IntegrationType() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_integrations_response.py b/jcapiv2/test/test_integrations_response.py new file mode 100644 index 0000000..45dd3b3 --- /dev/null +++ b/jcapiv2/test/test_integrations_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.integrations_response import IntegrationsResponse # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestIntegrationsResponse(unittest.TestCase): + """IntegrationsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testIntegrationsResponse(self): + """Test IntegrationsResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.integrations_response.IntegrationsResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_ip_list.py b/jcapiv2/test/test_ip_list.py new file mode 100644 index 0000000..3dd2155 --- /dev/null +++ b/jcapiv2/test/test_ip_list.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.ip_list import IPList # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestIPList(unittest.TestCase): + """IPList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testIPList(self): + """Test IPList""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.ip_list.IPList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_ip_list_request.py b/jcapiv2/test/test_ip_list_request.py new file mode 100644 index 0000000..a641b3b --- /dev/null +++ b/jcapiv2/test/test_ip_list_request.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.ip_list_request import IPListRequest # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestIPListRequest(unittest.TestCase): + """IPListRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testIPListRequest(self): + """Test IPListRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.ip_list_request.IPListRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_ip_lists_api.py b/jcapiv2/test/test_ip_lists_api.py new file mode 100644 index 0000000..6f85c59 --- /dev/null +++ b/jcapiv2/test/test_ip_lists_api.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.api.ip_lists_api import IPListsApi # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestIPListsApi(unittest.TestCase): + """IPListsApi unit test stubs""" + + def setUp(self): + self.api = IPListsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_iplists_delete(self): + """Test case for iplists_delete + + Delete an IP list # noqa: E501 + """ + pass + + def test_iplists_get(self): + """Test case for iplists_get + + Get an IP list # noqa: E501 + """ + pass + + def test_iplists_list(self): + """Test case for iplists_list + + List IP Lists # noqa: E501 + """ + pass + + def test_iplists_patch(self): + """Test case for iplists_patch + + Update an IP list # noqa: E501 + """ + pass + + def test_iplists_post(self): + """Test case for iplists_post + + Create IP List # noqa: E501 + """ + pass + + def test_iplists_put(self): + """Test case for iplists_put + + Replace an IP list # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_jc_enrollment_profile.py b/jcapiv2/test/test_jc_enrollment_profile.py deleted file mode 100644 index bd4ad19..0000000 --- a/jcapiv2/test/test_jc_enrollment_profile.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.jc_enrollment_profile import JcEnrollmentProfile # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestJcEnrollmentProfile(unittest.TestCase): - """JcEnrollmentProfile unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testJcEnrollmentProfile(self): - """Test JcEnrollmentProfile""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.jc_enrollment_profile.JcEnrollmentProfile() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_job_details.py b/jcapiv2/test/test_job_details.py deleted file mode 100644 index 8ac174b..0000000 --- a/jcapiv2/test/test_job_details.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.job_details import JobDetails # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestJobDetails(unittest.TestCase): - """JobDetails unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testJobDetails(self): - """Test JobDetails""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.job_details.JobDetails() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_job_id.py b/jcapiv2/test/test_job_id.py index d033fba..52b364b 100644 --- a/jcapiv2/test/test_job_id.py +++ b/jcapiv2/test/test_job_id.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_job_workresult.py b/jcapiv2/test/test_job_workresult.py index 6531a54..93bfb03 100644 --- a/jcapiv2/test/test_job_workresult.py +++ b/jcapiv2/test/test_job_workresult.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_knowledge_api.py b/jcapiv2/test/test_knowledge_api.py deleted file mode 100644 index 1381b57..0000000 --- a/jcapiv2/test/test_knowledge_api.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.api.knowledge_api import KnowledgeApi # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestKnowledgeApi(unittest.TestCase): - """KnowledgeApi unit test stubs""" - - def setUp(self): - self.api = jcapiv2.api.knowledge_api.KnowledgeApi() # noqa: E501 - - def tearDown(self): - pass - - def test_knowledge_salesforce_list(self): - """Test case for knowledge_salesforce_list - - List Knowledge Articles # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_ldap_group.py b/jcapiv2/test/test_ldap_group.py new file mode 100644 index 0000000..0853cc9 --- /dev/null +++ b/jcapiv2/test/test_ldap_group.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.ldap_group import LdapGroup # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestLdapGroup(unittest.TestCase): + """LdapGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testLdapGroup(self): + """Test LdapGroup""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.ldap_group.LdapGroup() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_ldap_server_action.py b/jcapiv2/test/test_ldap_server_action.py index 9b06f40..ab1ef14 100644 --- a/jcapiv2/test/test_ldap_server_action.py +++ b/jcapiv2/test/test_ldap_server_action.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_ldap_server_input.py b/jcapiv2/test/test_ldap_server_input.py index 9b14da2..44bc694 100644 --- a/jcapiv2/test/test_ldap_server_input.py +++ b/jcapiv2/test/test_ldap_server_input.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_ldap_server_output.py b/jcapiv2/test/test_ldap_server_output.py index 9e465ae..2d06794 100644 --- a/jcapiv2/test/test_ldap_server_output.py +++ b/jcapiv2/test/test_ldap_server_output.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_ldap_servers_api.py b/jcapiv2/test/test_ldap_servers_api.py index 0875028..8f9e156 100644 --- a/jcapiv2/test/test_ldap_servers_api.py +++ b/jcapiv2/test/test_ldap_servers_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestLDAPServersApi(unittest.TestCase): """LDAPServersApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.ldap_servers_api.LDAPServersApi() # noqa: E501 + self.api = LDAPServersApi() # noqa: E501 def tearDown(self): pass diff --git a/jcapiv2/test/test_ldapservers_id_body.py b/jcapiv2/test/test_ldapservers_id_body.py new file mode 100644 index 0000000..258a000 --- /dev/null +++ b/jcapiv2/test/test_ldapservers_id_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.ldapservers_id_body import LdapserversIdBody # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestLdapserversIdBody(unittest.TestCase): + """LdapserversIdBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testLdapserversIdBody(self): + """Test LdapserversIdBody""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.ldapservers_id_body.LdapserversIdBody() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_logos_api.py b/jcapiv2/test/test_logos_api.py new file mode 100644 index 0000000..71b5665 --- /dev/null +++ b/jcapiv2/test/test_logos_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.api.logos_api import LogosApi # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestLogosApi(unittest.TestCase): + """LogosApi unit test stubs""" + + def setUp(self): + self.api = LogosApi() # noqa: E501 + + def tearDown(self): + pass + + def test_logos_get(self): + """Test case for logos_get + + Get the logo associated with the specified id # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_managed_service_provider_api.py b/jcapiv2/test/test_managed_service_provider_api.py new file mode 100644 index 0000000..f3aea5e --- /dev/null +++ b/jcapiv2/test/test_managed_service_provider_api.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.api.managed_service_provider_api import ManagedServiceProviderApi # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestManagedServiceProviderApi(unittest.TestCase): + """ManagedServiceProviderApi unit test stubs""" + + def setUp(self): + self.api = ManagedServiceProviderApi() # noqa: E501 + + def tearDown(self): + pass + + def test_administrator_organizations_create_by_administrator(self): + """Test case for administrator_organizations_create_by_administrator + + Allow Adminstrator access to an Organization. # noqa: E501 + """ + pass + + def test_administrator_organizations_list_by_administrator(self): + """Test case for administrator_organizations_list_by_administrator + + List the association links between an Administrator and Organizations. # noqa: E501 + """ + pass + + def test_administrator_organizations_list_by_organization(self): + """Test case for administrator_organizations_list_by_organization + + List the association links between an Organization and Administrators. # noqa: E501 + """ + pass + + def test_administrator_organizations_remove_by_administrator(self): + """Test case for administrator_organizations_remove_by_administrator + + Remove association between an Administrator and an Organization. # noqa: E501 + """ + pass + + def test_provider_organizations_update_org(self): + """Test case for provider_organizations_update_org + + Update Provider Organization # noqa: E501 + """ + pass + + def test_providers_get_provider(self): + """Test case for providers_get_provider + + Retrieve Provider # noqa: E501 + """ + pass + + def test_providers_list_administrators(self): + """Test case for providers_list_administrators + + List Provider Administrators # noqa: E501 + """ + pass + + def test_providers_list_organizations(self): + """Test case for providers_list_organizations + + List Provider Organizations # noqa: E501 + """ + pass + + def test_providers_post_admins(self): + """Test case for providers_post_admins + + Create a new Provider Administrator # noqa: E501 + """ + pass + + def test_providers_retrieve_invoice(self): + """Test case for providers_retrieve_invoice + + Download a provider's invoice. # noqa: E501 + """ + pass + + def test_providers_retrieve_invoices(self): + """Test case for providers_retrieve_invoices + + List a provider's invoices. # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_member_suggestion.py b/jcapiv2/test/test_member_suggestion.py new file mode 100644 index 0000000..35951e4 --- /dev/null +++ b/jcapiv2/test/test_member_suggestion.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.member_suggestion import MemberSuggestion # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestMemberSuggestion(unittest.TestCase): + """MemberSuggestion unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMemberSuggestion(self): + """Test MemberSuggestion""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.member_suggestion.MemberSuggestion() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_member_suggestions_post_result.py b/jcapiv2/test/test_member_suggestions_post_result.py new file mode 100644 index 0000000..4b3da1d --- /dev/null +++ b/jcapiv2/test/test_member_suggestions_post_result.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.member_suggestions_post_result import MemberSuggestionsPostResult # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestMemberSuggestionsPostResult(unittest.TestCase): + """MemberSuggestionsPostResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMemberSuggestionsPostResult(self): + """Test MemberSuggestionsPostResult""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.member_suggestions_post_result.MemberSuggestionsPostResult() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_mfa.py b/jcapiv2/test/test_mfa.py deleted file mode 100644 index 6979aa6..0000000 --- a/jcapiv2/test/test_mfa.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.mfa import Mfa # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestMfa(unittest.TestCase): - """Mfa unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMfa(self): - """Test Mfa""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.mfa.Mfa() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_mobileconfig.py b/jcapiv2/test/test_mobileconfig.py index d607881..5450fe4 100644 --- a/jcapiv2/test/test_mobileconfig.py +++ b/jcapiv2/test/test_mobileconfig.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_oauth_code_input.py b/jcapiv2/test/test_oauth_code_input.py deleted file mode 100644 index b0f30a5..0000000 --- a/jcapiv2/test/test_oauth_code_input.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.oauth_code_input import OauthCodeInput # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestOauthCodeInput(unittest.TestCase): - """OauthCodeInput unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOauthCodeInput(self): - """Test OauthCodeInput""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.oauth_code_input.OauthCodeInput() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_office365_builtin_translation.py b/jcapiv2/test/test_office365_builtin_translation.py index 1fbf8fc..78e5784 100644 --- a/jcapiv2/test/test_office365_builtin_translation.py +++ b/jcapiv2/test/test_office365_builtin_translation.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_office365_direction_translation.py b/jcapiv2/test/test_office365_direction_translation.py new file mode 100644 index 0000000..f32a27a --- /dev/null +++ b/jcapiv2/test/test_office365_direction_translation.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.office365_direction_translation import Office365DirectionTranslation # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestOffice365DirectionTranslation(unittest.TestCase): + """Office365DirectionTranslation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOffice365DirectionTranslation(self): + """Test Office365DirectionTranslation""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.office365_direction_translation.Office365DirectionTranslation() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_office365_output.py b/jcapiv2/test/test_office365_output.py new file mode 100644 index 0000000..390c70f --- /dev/null +++ b/jcapiv2/test/test_office365_output.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.office365_output import Office365Output # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestOffice365Output(unittest.TestCase): + """Office365Output unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOffice365Output(self): + """Test Office365Output""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.office365_output.Office365Output() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_office365_patch_input.py b/jcapiv2/test/test_office365_patch_input.py new file mode 100644 index 0000000..8d6fbf4 --- /dev/null +++ b/jcapiv2/test/test_office365_patch_input.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.office365_patch_input import Office365PatchInput # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestOffice365PatchInput(unittest.TestCase): + """Office365PatchInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOffice365PatchInput(self): + """Test Office365PatchInput""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.office365_patch_input.Office365PatchInput() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_office365_translation_rule.py b/jcapiv2/test/test_office365_translation_rule.py index eb9a648..64b3c32 100644 --- a/jcapiv2/test/test_office365_translation_rule.py +++ b/jcapiv2/test/test_office365_translation_rule.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_office365_translation_rule_request.py b/jcapiv2/test/test_office365_translation_rule_request.py index dbcda28..dc0651d 100644 --- a/jcapiv2/test/test_office365_translation_rule_request.py +++ b/jcapiv2/test/test_office365_translation_rule_request.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_office_365_api.py b/jcapiv2/test/test_office_365_api.py index bc36489..25206e6 100644 --- a/jcapiv2/test/test_office_365_api.py +++ b/jcapiv2/test/test_office_365_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestOffice365Api(unittest.TestCase): """Office365Api unit test stubs""" def setUp(self): - self.api = jcapiv2.api.office_365_api.Office365Api() # noqa: E501 + self.api = Office365Api() # noqa: E501 def tearDown(self): pass @@ -57,6 +56,27 @@ def test_graph_office365_traverse_user_group(self): """ pass + def test_office365s_get(self): + """Test case for office365s_get + + Get Office 365 instance # noqa: E501 + """ + pass + + def test_office365s_list_import_users(self): + """Test case for office365s_list_import_users + + Get a list of users to import from an Office 365 instance # noqa: E501 + """ + pass + + def test_office365s_patch(self): + """Test case for office365s_patch + + Update existing Office 365 instance. # noqa: E501 + """ + pass + def test_translation_rules_office365_delete(self): """Test case for translation_rules_office365_delete diff --git a/jcapiv2/test/test_office_365_import_api.py b/jcapiv2/test/test_office_365_import_api.py new file mode 100644 index 0000000..c2f9ef0 --- /dev/null +++ b/jcapiv2/test/test_office_365_import_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.api.office_365_import_api import Office365ImportApi # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestOffice365ImportApi(unittest.TestCase): + """Office365ImportApi unit test stubs""" + + def setUp(self): + self.api = Office365ImportApi() # noqa: E501 + + def tearDown(self): + pass + + def test_office365s_list_import_users(self): + """Test case for office365s_list_import_users + + Get a list of users to import from an Office 365 instance # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_org_crypto_settings.py b/jcapiv2/test/test_org_crypto_settings.py deleted file mode 100644 index d771dec..0000000 --- a/jcapiv2/test/test_org_crypto_settings.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.org_crypto_settings import OrgCryptoSettings # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestOrgCryptoSettings(unittest.TestCase): - """OrgCryptoSettings unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOrgCryptoSettings(self): - """Test OrgCryptoSettings""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.org_crypto_settings.OrgCryptoSettings() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_organization.py b/jcapiv2/test/test_organization.py new file mode 100644 index 0000000..2eadb6b --- /dev/null +++ b/jcapiv2/test/test_organization.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.organization import Organization # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestOrganization(unittest.TestCase): + """Organization unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganization(self): + """Test Organization""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.organization.Organization() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_organization_case.py b/jcapiv2/test/test_organization_case.py new file mode 100644 index 0000000..ecd35a7 --- /dev/null +++ b/jcapiv2/test/test_organization_case.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.organization_case import OrganizationCase # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestOrganizationCase(unittest.TestCase): + """OrganizationCase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationCase(self): + """Test OrganizationCase""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.organization_case.OrganizationCase() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_organization_cases_response.py b/jcapiv2/test/test_organization_cases_response.py new file mode 100644 index 0000000..58469f2 --- /dev/null +++ b/jcapiv2/test/test_organization_cases_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.organization_cases_response import OrganizationCasesResponse # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestOrganizationCasesResponse(unittest.TestCase): + """OrganizationCasesResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrganizationCasesResponse(self): + """Test OrganizationCasesResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.organization_cases_response.OrganizationCasesResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_organizations_api.py b/jcapiv2/test/test_organizations_api.py index b383fb7..feb471d 100644 --- a/jcapiv2/test/test_organizations_api.py +++ b/jcapiv2/test/test_organizations_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,22 +23,43 @@ class TestOrganizationsApi(unittest.TestCase): """OrganizationsApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.organizations_api.OrganizationsApi() # noqa: E501 + self.api = OrganizationsApi() # noqa: E501 def tearDown(self): pass - def test_org_crypto_get(self): - """Test case for org_crypto_get + def test_administrator_organizations_create_by_administrator(self): + """Test case for administrator_organizations_create_by_administrator + + Allow Adminstrator access to an Organization. # noqa: E501 + """ + pass + + def test_administrator_organizations_list_by_administrator(self): + """Test case for administrator_organizations_list_by_administrator + + List the association links between an Administrator and Organizations. # noqa: E501 + """ + pass + + def test_administrator_organizations_list_by_organization(self): + """Test case for administrator_organizations_list_by_organization + + List the association links between an Organization and Administrators. # noqa: E501 + """ + pass + + def test_administrator_organizations_remove_by_administrator(self): + """Test case for administrator_organizations_remove_by_administrator - Get Crypto Settings # noqa: E501 + Remove association between an Administrator and an Organization. # noqa: E501 """ pass - def test_org_crypto_put(self): - """Test case for org_crypto_put + def test_organizations_list_cases(self): + """Test case for organizations_list_cases - Edit Crypto Settings # noqa: E501 + Get all cases (Support/Feature requests) for organization # noqa: E501 """ pass diff --git a/jcapiv2/test/test_orgcryptosettings_ssh_keys.py b/jcapiv2/test/test_orgcryptosettings_ssh_keys.py deleted file mode 100644 index f19878a..0000000 --- a/jcapiv2/test/test_orgcryptosettings_ssh_keys.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.orgcryptosettings_ssh_keys import OrgcryptosettingsSshKeys # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestOrgcryptosettingsSshKeys(unittest.TestCase): - """OrgcryptosettingsSshKeys unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOrgcryptosettingsSshKeys(self): - """Test OrgcryptosettingsSshKeys""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.orgcryptosettings_ssh_keys.OrgcryptosettingsSshKeys() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_os_restriction.py b/jcapiv2/test/test_os_restriction.py new file mode 100644 index 0000000..bf82209 --- /dev/null +++ b/jcapiv2/test/test_os_restriction.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.os_restriction import OSRestriction # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestOSRestriction(unittest.TestCase): + """OSRestriction unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOSRestriction(self): + """Test OSRestriction""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.os_restriction.OSRestriction() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_os_restriction_apple_restrictions.py b/jcapiv2/test/test_os_restriction_apple_restrictions.py new file mode 100644 index 0000000..57da2b3 --- /dev/null +++ b/jcapiv2/test/test_os_restriction_apple_restrictions.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.os_restriction_apple_restrictions import OSRestrictionAppleRestrictions # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestOSRestrictionAppleRestrictions(unittest.TestCase): + """OSRestrictionAppleRestrictions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOSRestrictionAppleRestrictions(self): + """Test OSRestrictionAppleRestrictions""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.os_restriction_apple_restrictions.OSRestrictionAppleRestrictions() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_phone_number.py b/jcapiv2/test/test_phone_number.py new file mode 100644 index 0000000..5d2b797 --- /dev/null +++ b/jcapiv2/test/test_phone_number.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.phone_number import PhoneNumber # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestPhoneNumber(unittest.TestCase): + """PhoneNumber unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPhoneNumber(self): + """Test PhoneNumber""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.phone_number.PhoneNumber() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_policies_api.py b/jcapiv2/test/test_policies_api.py index a6cbbf0..672d685 100644 --- a/jcapiv2/test/test_policies_api.py +++ b/jcapiv2/test/test_policies_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestPoliciesApi(unittest.TestCase): """PoliciesApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.policies_api.PoliciesApi() # noqa: E501 + self.api = PoliciesApi() # noqa: E501 def tearDown(self): pass @@ -43,6 +42,13 @@ def test_graph_policy_associations_post(self): """ pass + def test_graph_policy_member_of(self): + """Test case for graph_policy_member_of + + List the parent Groups of a Policy # noqa: E501 + """ + pass + def test_graph_policy_traverse_system(self): """Test case for graph_policy_traverse_system @@ -109,19 +115,19 @@ def test_policyresults_list(self): def test_policyresults_org_list(self): """Test case for policyresults_org_list - Lists all the policy results for an organization. # noqa: E501 + Lists all of the policy results for an organization. # noqa: E501 """ pass - def test_policystatuses_list(self): - """Test case for policystatuses_list + def test_policystatuses_policies_list(self): + """Test case for policystatuses_policies_list Lists the latest policy results of a policy. # noqa: E501 """ pass - def test_policystatuses_list_0(self): - """Test case for policystatuses_list_0 + def test_policystatuses_systems_list(self): + """Test case for policystatuses_systems_list List the policy statuses for a system # noqa: E501 """ diff --git a/jcapiv2/test/test_policy.py b/jcapiv2/test/test_policy.py index 941d021..e184fc3 100644 --- a/jcapiv2/test/test_policy.py +++ b/jcapiv2/test/test_policy.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_policy_group.py b/jcapiv2/test/test_policy_group.py new file mode 100644 index 0000000..5d2f452 --- /dev/null +++ b/jcapiv2/test/test_policy_group.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.policy_group import PolicyGroup # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestPolicyGroup(unittest.TestCase): + """PolicyGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPolicyGroup(self): + """Test PolicyGroup""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.policy_group.PolicyGroup() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_policy_group_associations_api.py b/jcapiv2/test/test_policy_group_associations_api.py new file mode 100644 index 0000000..f70c67e --- /dev/null +++ b/jcapiv2/test/test_policy_group_associations_api.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.api.policy_group_associations_api import PolicyGroupAssociationsApi # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestPolicyGroupAssociationsApi(unittest.TestCase): + """PolicyGroupAssociationsApi unit test stubs""" + + def setUp(self): + self.api = PolicyGroupAssociationsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_graph_policy_group_associations_list(self): + """Test case for graph_policy_group_associations_list + + List the associations of a Policy Group. # noqa: E501 + """ + pass + + def test_graph_policy_group_associations_post(self): + """Test case for graph_policy_group_associations_post + + Manage the associations of a Policy Group # noqa: E501 + """ + pass + + def test_graph_policy_group_traverse_system(self): + """Test case for graph_policy_group_traverse_system + + List the Systems bound to a Policy Group # noqa: E501 + """ + pass + + def test_graph_policy_group_traverse_system_group(self): + """Test case for graph_policy_group_traverse_system_group + + List the System Groups bound to Policy Groups # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_policy_group_data.py b/jcapiv2/test/test_policy_group_data.py new file mode 100644 index 0000000..ba29eac --- /dev/null +++ b/jcapiv2/test/test_policy_group_data.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.policy_group_data import PolicyGroupData # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestPolicyGroupData(unittest.TestCase): + """PolicyGroupData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPolicyGroupData(self): + """Test PolicyGroupData""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.policy_group_data.PolicyGroupData() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_policy_group_members__membership_api.py b/jcapiv2/test/test_policy_group_members__membership_api.py new file mode 100644 index 0000000..a948c05 --- /dev/null +++ b/jcapiv2/test/test_policy_group_members__membership_api.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.api.policy_group_members__membership_api import PolicyGroupMembersMembershipApi # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestPolicyGroupMembersMembershipApi(unittest.TestCase): + """PolicyGroupMembersMembershipApi unit test stubs""" + + def setUp(self): + self.api = PolicyGroupMembersMembershipApi() # noqa: E501 + + def tearDown(self): + pass + + def test_graph_policy_group_members_list(self): + """Test case for graph_policy_group_members_list + + List the members of a Policy Group # noqa: E501 + """ + pass + + def test_graph_policy_group_members_post(self): + """Test case for graph_policy_group_members_post + + Manage the members of a Policy Group # noqa: E501 + """ + pass + + def test_graph_policy_group_membership(self): + """Test case for graph_policy_group_membership + + List the Policy Group's membership # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_policy_groups_api.py b/jcapiv2/test/test_policy_groups_api.py new file mode 100644 index 0000000..1bf7525 --- /dev/null +++ b/jcapiv2/test/test_policy_groups_api.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.api.policy_groups_api import PolicyGroupsApi # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestPolicyGroupsApi(unittest.TestCase): + """PolicyGroupsApi unit test stubs""" + + def setUp(self): + self.api = PolicyGroupsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_graph_policy_group_associations_list(self): + """Test case for graph_policy_group_associations_list + + List the associations of a Policy Group. # noqa: E501 + """ + pass + + def test_graph_policy_group_associations_post(self): + """Test case for graph_policy_group_associations_post + + Manage the associations of a Policy Group # noqa: E501 + """ + pass + + def test_graph_policy_group_members_list(self): + """Test case for graph_policy_group_members_list + + List the members of a Policy Group # noqa: E501 + """ + pass + + def test_graph_policy_group_members_post(self): + """Test case for graph_policy_group_members_post + + Manage the members of a Policy Group # noqa: E501 + """ + pass + + def test_graph_policy_group_membership(self): + """Test case for graph_policy_group_membership + + List the Policy Group's membership # noqa: E501 + """ + pass + + def test_graph_policy_group_traverse_system(self): + """Test case for graph_policy_group_traverse_system + + List the Systems bound to a Policy Group # noqa: E501 + """ + pass + + def test_graph_policy_group_traverse_system_group(self): + """Test case for graph_policy_group_traverse_system_group + + List the System Groups bound to Policy Groups # noqa: E501 + """ + pass + + def test_groups_policy_delete(self): + """Test case for groups_policy_delete + + Delete a Policy Group # noqa: E501 + """ + pass + + def test_groups_policy_get(self): + """Test case for groups_policy_get + + View an individual Policy Group details # noqa: E501 + """ + pass + + def test_groups_policy_list(self): + """Test case for groups_policy_list + + List all Policy Groups # noqa: E501 + """ + pass + + def test_groups_policy_post(self): + """Test case for groups_policy_post + + Create a new Policy Group # noqa: E501 + """ + pass + + def test_groups_policy_put(self): + """Test case for groups_policy_put + + Update a Policy Group # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_policy_request.py b/jcapiv2/test/test_policy_request.py index 4a48c8f..7e55698 100644 --- a/jcapiv2/test/test_policy_request.py +++ b/jcapiv2/test/test_policy_request.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_policy_request_template.py b/jcapiv2/test/test_policy_request_template.py index 9328b6a..0601b79 100644 --- a/jcapiv2/test/test_policy_request_template.py +++ b/jcapiv2/test/test_policy_request_template.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_policy_result.py b/jcapiv2/test/test_policy_result.py index d7f2de6..5d638e3 100644 --- a/jcapiv2/test/test_policy_result.py +++ b/jcapiv2/test/test_policy_result.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_policy_template.py b/jcapiv2/test/test_policy_template.py index ce57b42..e2f8f2e 100644 --- a/jcapiv2/test/test_policy_template.py +++ b/jcapiv2/test/test_policy_template.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_policy_template_config_field.py b/jcapiv2/test/test_policy_template_config_field.py index dd1d493..867e32b 100644 --- a/jcapiv2/test/test_policy_template_config_field.py +++ b/jcapiv2/test/test_policy_template_config_field.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_policy_template_config_field_tooltip.py b/jcapiv2/test/test_policy_template_config_field_tooltip.py index 403e17f..58a9be2 100644 --- a/jcapiv2/test/test_policy_template_config_field_tooltip.py +++ b/jcapiv2/test/test_policy_template_config_field_tooltip.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_policy_template_config_field_tooltip_variables.py b/jcapiv2/test/test_policy_template_config_field_tooltip_variables.py index 20840ef..51da1f6 100644 --- a/jcapiv2/test/test_policy_template_config_field_tooltip_variables.py +++ b/jcapiv2/test/test_policy_template_config_field_tooltip_variables.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_policy_template_with_details.py b/jcapiv2/test/test_policy_template_with_details.py index 7afd61a..7c4129f 100644 --- a/jcapiv2/test/test_policy_template_with_details.py +++ b/jcapiv2/test/test_policy_template_with_details.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_policy_value.py b/jcapiv2/test/test_policy_value.py index f1ff359..42231de 100644 --- a/jcapiv2/test/test_policy_value.py +++ b/jcapiv2/test/test_policy_value.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_policy_with_details.py b/jcapiv2/test/test_policy_with_details.py index 901eca5..0ffc468 100644 --- a/jcapiv2/test/test_policy_with_details.py +++ b/jcapiv2/test/test_policy_with_details.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_policytemplates_api.py b/jcapiv2/test/test_policytemplates_api.py index 6dd09b0..607fec8 100644 --- a/jcapiv2/test/test_policytemplates_api.py +++ b/jcapiv2/test/test_policytemplates_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestPolicytemplatesApi(unittest.TestCase): """PolicytemplatesApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.policytemplates_api.PolicytemplatesApi() # noqa: E501 + self.api = PolicytemplatesApi() # noqa: E501 def tearDown(self): pass diff --git a/jcapiv2/test/test_provider.py b/jcapiv2/test/test_provider.py index 97f023d..10fe25a 100644 --- a/jcapiv2/test/test_provider.py +++ b/jcapiv2/test/test_provider.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_provider_admin_req.py b/jcapiv2/test/test_provider_admin_req.py index c9f0bad..ce2e79f 100644 --- a/jcapiv2/test/test_provider_admin_req.py +++ b/jcapiv2/test/test_provider_admin_req.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_provider_contact.py b/jcapiv2/test/test_provider_contact.py deleted file mode 100644 index 49c6f79..0000000 --- a/jcapiv2/test/test_provider_contact.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.provider_contact import ProviderContact # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestProviderContact(unittest.TestCase): - """ProviderContact unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testProviderContact(self): - """Test ProviderContact""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.provider_contact.ProviderContact() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_provider_invoice.py b/jcapiv2/test/test_provider_invoice.py new file mode 100644 index 0000000..f34e84e --- /dev/null +++ b/jcapiv2/test/test_provider_invoice.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.provider_invoice import ProviderInvoice # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestProviderInvoice(unittest.TestCase): + """ProviderInvoice unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testProviderInvoice(self): + """Test ProviderInvoice""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.provider_invoice.ProviderInvoice() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_provider_invoice_response.py b/jcapiv2/test/test_provider_invoice_response.py new file mode 100644 index 0000000..04035f2 --- /dev/null +++ b/jcapiv2/test/test_provider_invoice_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.provider_invoice_response import ProviderInvoiceResponse # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestProviderInvoiceResponse(unittest.TestCase): + """ProviderInvoiceResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testProviderInvoiceResponse(self): + """Test ProviderInvoiceResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.provider_invoice_response.ProviderInvoiceResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_providers_api.py b/jcapiv2/test/test_providers_api.py index a9fe202..9ecfcaf 100644 --- a/jcapiv2/test/test_providers_api.py +++ b/jcapiv2/test/test_providers_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,11 +23,256 @@ class TestProvidersApi(unittest.TestCase): """ProvidersApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.providers_api.ProvidersApi() # noqa: E501 + self.api = ProvidersApi() # noqa: E501 def tearDown(self): pass + def test_autotask_create_configuration(self): + """Test case for autotask_create_configuration + + Creates a new Autotask integration for the provider # noqa: E501 + """ + pass + + def test_autotask_delete_configuration(self): + """Test case for autotask_delete_configuration + + Delete Autotask Integration # noqa: E501 + """ + pass + + def test_autotask_get_configuration(self): + """Test case for autotask_get_configuration + + Retrieve Autotask Integration Configuration # noqa: E501 + """ + pass + + def test_autotask_patch_mappings(self): + """Test case for autotask_patch_mappings + + Create, edit, and/or delete Autotask Mappings # noqa: E501 + """ + pass + + def test_autotask_patch_settings(self): + """Test case for autotask_patch_settings + + Create, edit, and/or delete Autotask Integration settings # noqa: E501 + """ + pass + + def test_autotask_retrieve_all_alert_configuration_options(self): + """Test case for autotask_retrieve_all_alert_configuration_options + + Get all Autotask ticketing alert configuration options for a provider # noqa: E501 + """ + pass + + def test_autotask_retrieve_all_alert_configurations(self): + """Test case for autotask_retrieve_all_alert_configurations + + Get all Autotask ticketing alert configurations for a provider # noqa: E501 + """ + pass + + def test_autotask_retrieve_companies(self): + """Test case for autotask_retrieve_companies + + Retrieve Autotask Companies # noqa: E501 + """ + pass + + def test_autotask_retrieve_company_types(self): + """Test case for autotask_retrieve_company_types + + Retrieve Autotask Company Types # noqa: E501 + """ + pass + + def test_autotask_retrieve_contracts(self): + """Test case for autotask_retrieve_contracts + + Retrieve Autotask Contracts # noqa: E501 + """ + pass + + def test_autotask_retrieve_contracts_fields(self): + """Test case for autotask_retrieve_contracts_fields + + Retrieve Autotask Contract Fields # noqa: E501 + """ + pass + + def test_autotask_retrieve_mappings(self): + """Test case for autotask_retrieve_mappings + + Retrieve Autotask mappings # noqa: E501 + """ + pass + + def test_autotask_retrieve_services(self): + """Test case for autotask_retrieve_services + + Retrieve Autotask Contract Services # noqa: E501 + """ + pass + + def test_autotask_retrieve_settings(self): + """Test case for autotask_retrieve_settings + + Retrieve Autotask Integration settings # noqa: E501 + """ + pass + + def test_autotask_update_alert_configuration(self): + """Test case for autotask_update_alert_configuration + + Update an Autotask ticketing alert's configuration # noqa: E501 + """ + pass + + def test_autotask_update_configuration(self): + """Test case for autotask_update_configuration + + Update Autotask Integration configuration # noqa: E501 + """ + pass + + def test_connectwise_create_configuration(self): + """Test case for connectwise_create_configuration + + Creates a new ConnectWise integration for the provider # noqa: E501 + """ + pass + + def test_connectwise_delete_configuration(self): + """Test case for connectwise_delete_configuration + + Delete ConnectWise Integration # noqa: E501 + """ + pass + + def test_connectwise_get_configuration(self): + """Test case for connectwise_get_configuration + + Retrieve ConnectWise Integration Configuration # noqa: E501 + """ + pass + + def test_connectwise_patch_mappings(self): + """Test case for connectwise_patch_mappings + + Create, edit, and/or delete ConnectWise Mappings # noqa: E501 + """ + pass + + def test_connectwise_patch_settings(self): + """Test case for connectwise_patch_settings + + Create, edit, and/or delete ConnectWise Integration settings # noqa: E501 + """ + pass + + def test_connectwise_retrieve_additions(self): + """Test case for connectwise_retrieve_additions + + Retrieve ConnectWise Additions # noqa: E501 + """ + pass + + def test_connectwise_retrieve_agreements(self): + """Test case for connectwise_retrieve_agreements + + Retrieve ConnectWise Agreements # noqa: E501 + """ + pass + + def test_connectwise_retrieve_all_alert_configuration_options(self): + """Test case for connectwise_retrieve_all_alert_configuration_options + + Get all ConnectWise ticketing alert configuration options for a provider # noqa: E501 + """ + pass + + def test_connectwise_retrieve_all_alert_configurations(self): + """Test case for connectwise_retrieve_all_alert_configurations + + Get all ConnectWise ticketing alert configurations for a provider # noqa: E501 + """ + pass + + def test_connectwise_retrieve_companies(self): + """Test case for connectwise_retrieve_companies + + Retrieve ConnectWise Companies # noqa: E501 + """ + pass + + def test_connectwise_retrieve_company_types(self): + """Test case for connectwise_retrieve_company_types + + Retrieve ConnectWise Company Types # noqa: E501 + """ + pass + + def test_connectwise_retrieve_mappings(self): + """Test case for connectwise_retrieve_mappings + + Retrieve ConnectWise mappings # noqa: E501 + """ + pass + + def test_connectwise_retrieve_settings(self): + """Test case for connectwise_retrieve_settings + + Retrieve ConnectWise Integration settings # noqa: E501 + """ + pass + + def test_connectwise_update_alert_configuration(self): + """Test case for connectwise_update_alert_configuration + + Update a ConnectWise ticketing alert's configuration # noqa: E501 + """ + pass + + def test_connectwise_update_configuration(self): + """Test case for connectwise_update_configuration + + Update ConnectWise Integration configuration # noqa: E501 + """ + pass + + def test_mtp_integration_retrieve_alerts(self): + """Test case for mtp_integration_retrieve_alerts + + Get all ticketing alerts available for a provider's ticketing integration. # noqa: E501 + """ + pass + + def test_mtp_integration_retrieve_sync_errors(self): + """Test case for mtp_integration_retrieve_sync_errors + + Retrieve Recent Integration Sync Errors # noqa: E501 + """ + pass + + def test_provider_organizations_update_org(self): + """Test case for provider_organizations_update_org + + Update Provider Organization # noqa: E501 + """ + pass + + def test_providers_get_provider(self): + """Test case for providers_get_provider + + Retrieve Provider # noqa: E501 + """ + pass + def test_providers_list_administrators(self): """Test case for providers_list_administrators @@ -36,6 +280,13 @@ def test_providers_list_administrators(self): """ pass + def test_providers_list_organizations(self): + """Test case for providers_list_organizations + + List Provider Organizations # noqa: E501 + """ + pass + def test_providers_post_admins(self): """Test case for providers_post_admins @@ -43,6 +294,34 @@ def test_providers_post_admins(self): """ pass + def test_providers_remove_administrator(self): + """Test case for providers_remove_administrator + + Delete Provider Administrator # noqa: E501 + """ + pass + + def test_providers_retrieve_integrations(self): + """Test case for providers_retrieve_integrations + + Retrieve Integrations for Provider # noqa: E501 + """ + pass + + def test_providers_retrieve_invoice(self): + """Test case for providers_retrieve_invoice + + Download a provider's invoice. # noqa: E501 + """ + pass + + def test_providers_retrieve_invoices(self): + """Test case for providers_retrieve_invoices + + List a provider's invoices. # noqa: E501 + """ + pass + if __name__ == '__main__': unittest.main() diff --git a/jcapiv2/test/test_push_endpoint_response.py b/jcapiv2/test/test_push_endpoint_response.py new file mode 100644 index 0000000..87e1268 --- /dev/null +++ b/jcapiv2/test/test_push_endpoint_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.push_endpoint_response import PushEndpointResponse # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestPushEndpointResponse(unittest.TestCase): + """PushEndpointResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPushEndpointResponse(self): + """Test PushEndpointResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.push_endpoint_response.PushEndpointResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_push_endpoint_response_device.py b/jcapiv2/test/test_push_endpoint_response_device.py new file mode 100644 index 0000000..32ef017 --- /dev/null +++ b/jcapiv2/test/test_push_endpoint_response_device.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.push_endpoint_response_device import PushEndpointResponseDevice # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestPushEndpointResponseDevice(unittest.TestCase): + """PushEndpointResponseDevice unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPushEndpointResponseDevice(self): + """Test PushEndpointResponseDevice""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.push_endpoint_response_device.PushEndpointResponseDevice() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_pushendpoints_push_endpoint_id_body.py b/jcapiv2/test/test_pushendpoints_push_endpoint_id_body.py new file mode 100644 index 0000000..7d7f0db --- /dev/null +++ b/jcapiv2/test/test_pushendpoints_push_endpoint_id_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.pushendpoints_push_endpoint_id_body import PushendpointsPushEndpointIdBody # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestPushendpointsPushEndpointIdBody(unittest.TestCase): + """PushendpointsPushEndpointIdBody unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPushendpointsPushEndpointIdBody(self): + """Test PushendpointsPushEndpointIdBody""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.pushendpoints_push_endpoint_id_body.PushendpointsPushEndpointIdBody() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_pwm_all_users.py b/jcapiv2/test/test_pwm_all_users.py new file mode 100644 index 0000000..c40b9d2 --- /dev/null +++ b/jcapiv2/test/test_pwm_all_users.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.pwm_all_users import PwmAllUsers # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestPwmAllUsers(unittest.TestCase): + """PwmAllUsers unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPwmAllUsers(self): + """Test PwmAllUsers""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.pwm_all_users.PwmAllUsers() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_pwm_all_users_groups.py b/jcapiv2/test/test_pwm_all_users_groups.py new file mode 100644 index 0000000..ca5b045 --- /dev/null +++ b/jcapiv2/test/test_pwm_all_users_groups.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.pwm_all_users_groups import PwmAllUsersGroups # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestPwmAllUsersGroups(unittest.TestCase): + """PwmAllUsersGroups unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPwmAllUsersGroups(self): + """Test PwmAllUsersGroups""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.pwm_all_users_groups.PwmAllUsersGroups() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_pwm_all_users_results.py b/jcapiv2/test/test_pwm_all_users_results.py new file mode 100644 index 0000000..0436d40 --- /dev/null +++ b/jcapiv2/test/test_pwm_all_users_results.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.pwm_all_users_results import PwmAllUsersResults # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestPwmAllUsersResults(unittest.TestCase): + """PwmAllUsersResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPwmAllUsersResults(self): + """Test PwmAllUsersResults""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.pwm_all_users_results.PwmAllUsersResults() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_pwm_overview_app_versions.py b/jcapiv2/test/test_pwm_overview_app_versions.py new file mode 100644 index 0000000..a0ace09 --- /dev/null +++ b/jcapiv2/test/test_pwm_overview_app_versions.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.pwm_overview_app_versions import PwmOverviewAppVersions # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestPwmOverviewAppVersions(unittest.TestCase): + """PwmOverviewAppVersions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPwmOverviewAppVersions(self): + """Test PwmOverviewAppVersions""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.pwm_overview_app_versions.PwmOverviewAppVersions() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_pwm_overview_app_versions_results.py b/jcapiv2/test/test_pwm_overview_app_versions_results.py new file mode 100644 index 0000000..3827443 --- /dev/null +++ b/jcapiv2/test/test_pwm_overview_app_versions_results.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.pwm_overview_app_versions_results import PwmOverviewAppVersionsResults # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestPwmOverviewAppVersionsResults(unittest.TestCase): + """PwmOverviewAppVersionsResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPwmOverviewAppVersionsResults(self): + """Test PwmOverviewAppVersionsResults""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.pwm_overview_app_versions_results.PwmOverviewAppVersionsResults() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_pwm_overview_main.py b/jcapiv2/test/test_pwm_overview_main.py new file mode 100644 index 0000000..e64fad0 --- /dev/null +++ b/jcapiv2/test/test_pwm_overview_main.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.pwm_overview_main import PwmOverviewMain # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestPwmOverviewMain(unittest.TestCase): + """PwmOverviewMain unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPwmOverviewMain(self): + """Test PwmOverviewMain""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.pwm_overview_main.PwmOverviewMain() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_pwm_overview_main_devices.py b/jcapiv2/test/test_pwm_overview_main_devices.py new file mode 100644 index 0000000..4ebc119 --- /dev/null +++ b/jcapiv2/test/test_pwm_overview_main_devices.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.pwm_overview_main_devices import PwmOverviewMainDevices # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestPwmOverviewMainDevices(unittest.TestCase): + """PwmOverviewMainDevices unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPwmOverviewMainDevices(self): + """Test PwmOverviewMainDevices""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.pwm_overview_main_devices.PwmOverviewMainDevices() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_query.py b/jcapiv2/test/test_query.py new file mode 100644 index 0000000..f0477f2 --- /dev/null +++ b/jcapiv2/test/test_query.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.query import Query # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestQuery(unittest.TestCase): + """Query unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testQuery(self): + """Test Query""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.query.Query() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_queued_command_list.py b/jcapiv2/test/test_queued_command_list.py new file mode 100644 index 0000000..e181bac --- /dev/null +++ b/jcapiv2/test/test_queued_command_list.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.queued_command_list import QueuedCommandList # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestQueuedCommandList(unittest.TestCase): + """QueuedCommandList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testQueuedCommandList(self): + """Test QueuedCommandList""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.queued_command_list.QueuedCommandList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_queued_command_list_results.py b/jcapiv2/test/test_queued_command_list_results.py new file mode 100644 index 0000000..c0bb7e0 --- /dev/null +++ b/jcapiv2/test/test_queued_command_list_results.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.queued_command_list_results import QueuedCommandListResults # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestQueuedCommandListResults(unittest.TestCase): + """QueuedCommandListResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testQueuedCommandListResults(self): + """Test QueuedCommandListResults""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.queued_command_list_results.QueuedCommandListResults() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_radius_servers_api.py b/jcapiv2/test/test_radius_servers_api.py index f56d213..3724b8d 100644 --- a/jcapiv2/test/test_radius_servers_api.py +++ b/jcapiv2/test/test_radius_servers_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestRADIUSServersApi(unittest.TestCase): """RADIUSServersApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.radius_servers_api.RADIUSServersApi() # noqa: E501 + self.api = RADIUSServersApi() # noqa: E501 def tearDown(self): pass diff --git a/jcapiv2/test/test_salesforce_knowledge_list_output.py b/jcapiv2/test/test_salesforce_knowledge_list_output.py deleted file mode 100644 index f337654..0000000 --- a/jcapiv2/test/test_salesforce_knowledge_list_output.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.salesforce_knowledge_list_output import SalesforceKnowledgeListOutput # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestSalesforceKnowledgeListOutput(unittest.TestCase): - """SalesforceKnowledgeListOutput unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSalesforceKnowledgeListOutput(self): - """Test SalesforceKnowledgeListOutput""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.salesforce_knowledge_list_output.SalesforceKnowledgeListOutput() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_salesforceknowledgelistoutput_inner.py b/jcapiv2/test/test_salesforceknowledgelistoutput_inner.py deleted file mode 100644 index 605b768..0000000 --- a/jcapiv2/test/test_salesforceknowledgelistoutput_inner.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.salesforceknowledgelistoutput_inner import SalesforceknowledgelistoutputInner # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestSalesforceknowledgelistoutputInner(unittest.TestCase): - """SalesforceknowledgelistoutputInner unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSalesforceknowledgelistoutputInner(self): - """Test SalesforceknowledgelistoutputInner""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.salesforceknowledgelistoutput_inner.SalesforceknowledgelistoutputInner() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_samba_domain_input.py b/jcapiv2/test/test_samba_domain_input.py index a9a5ee0..132ebf1 100644 --- a/jcapiv2/test/test_samba_domain_input.py +++ b/jcapiv2/test/test_samba_domain_input.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_samba_domain_output.py b/jcapiv2/test/test_samba_domain_output.py index 9d8e826..af32687 100644 --- a/jcapiv2/test/test_samba_domain_output.py +++ b/jcapiv2/test/test_samba_domain_output.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_samba_domains_api.py b/jcapiv2/test/test_samba_domains_api.py index c6161e2..9a74b39 100644 --- a/jcapiv2/test/test_samba_domains_api.py +++ b/jcapiv2/test/test_samba_domains_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestSambaDomainsApi(unittest.TestCase): """SambaDomainsApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.samba_domains_api.SambaDomainsApi() # noqa: E501 + self.api = SambaDomainsApi() # noqa: E501 def tearDown(self): pass diff --git a/jcapiv2/test/test_scheduled_userstate_result.py b/jcapiv2/test/test_scheduled_userstate_result.py new file mode 100644 index 0000000..97b0427 --- /dev/null +++ b/jcapiv2/test/test_scheduled_userstate_result.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.scheduled_userstate_result import ScheduledUserstateResult # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestScheduledUserstateResult(unittest.TestCase): + """ScheduledUserstateResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testScheduledUserstateResult(self): + """Test ScheduledUserstateResult""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.scheduled_userstate_result.ScheduledUserstateResult() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_scim_import_api.py b/jcapiv2/test/test_scim_import_api.py new file mode 100644 index 0000000..a0aceb2 --- /dev/null +++ b/jcapiv2/test/test_scim_import_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.api.scim_import_api import SCIMImportApi # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSCIMImportApi(unittest.TestCase): + """SCIMImportApi unit test stubs""" + + def setUp(self): + self.api = SCIMImportApi() # noqa: E501 + + def tearDown(self): + pass + + def test_import_users(self): + """Test case for import_users + + Get a list of users to import from an Application IdM service provider # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_setup_assistant_option.py b/jcapiv2/test/test_setup_assistant_option.py new file mode 100644 index 0000000..ff7c4df --- /dev/null +++ b/jcapiv2/test/test_setup_assistant_option.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.setup_assistant_option import SetupAssistantOption # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSetupAssistantOption(unittest.TestCase): + """SetupAssistantOption unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSetupAssistantOption(self): + """Test SetupAssistantOption""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.setup_assistant_option.SetupAssistantOption() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_shared_folder_access_levels.py b/jcapiv2/test/test_shared_folder_access_levels.py new file mode 100644 index 0000000..5a40937 --- /dev/null +++ b/jcapiv2/test/test_shared_folder_access_levels.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.shared_folder_access_levels import SharedFolderAccessLevels # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSharedFolderAccessLevels(unittest.TestCase): + """SharedFolderAccessLevels unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSharedFolderAccessLevels(self): + """Test SharedFolderAccessLevels""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.shared_folder_access_levels.SharedFolderAccessLevels() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_shared_folder_access_levels_results.py b/jcapiv2/test/test_shared_folder_access_levels_results.py new file mode 100644 index 0000000..66251b6 --- /dev/null +++ b/jcapiv2/test/test_shared_folder_access_levels_results.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.shared_folder_access_levels_results import SharedFolderAccessLevelsResults # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSharedFolderAccessLevelsResults(unittest.TestCase): + """SharedFolderAccessLevelsResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSharedFolderAccessLevelsResults(self): + """Test SharedFolderAccessLevelsResults""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.shared_folder_access_levels_results.SharedFolderAccessLevelsResults() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_shared_folder_details.py b/jcapiv2/test/test_shared_folder_details.py new file mode 100644 index 0000000..447fb1f --- /dev/null +++ b/jcapiv2/test/test_shared_folder_details.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.shared_folder_details import SharedFolderDetails # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSharedFolderDetails(unittest.TestCase): + """SharedFolderDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSharedFolderDetails(self): + """Test SharedFolderDetails""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.shared_folder_details.SharedFolderDetails() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_shared_folder_users.py b/jcapiv2/test/test_shared_folder_users.py new file mode 100644 index 0000000..6926bbc --- /dev/null +++ b/jcapiv2/test/test_shared_folder_users.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.shared_folder_users import SharedFolderUsers # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSharedFolderUsers(unittest.TestCase): + """SharedFolderUsers unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSharedFolderUsers(self): + """Test SharedFolderUsers""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.shared_folder_users.SharedFolderUsers() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_shared_folder_users_results.py b/jcapiv2/test/test_shared_folder_users_results.py new file mode 100644 index 0000000..ef2ddd9 --- /dev/null +++ b/jcapiv2/test/test_shared_folder_users_results.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.shared_folder_users_results import SharedFolderUsersResults # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSharedFolderUsersResults(unittest.TestCase): + """SharedFolderUsersResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSharedFolderUsersResults(self): + """Test SharedFolderUsersResults""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.shared_folder_users_results.SharedFolderUsersResults() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_shared_folders_list.py b/jcapiv2/test/test_shared_folders_list.py new file mode 100644 index 0000000..383ddab --- /dev/null +++ b/jcapiv2/test/test_shared_folders_list.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.shared_folders_list import SharedFoldersList # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSharedFoldersList(unittest.TestCase): + """SharedFoldersList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSharedFoldersList(self): + """Test SharedFoldersList""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.shared_folders_list.SharedFoldersList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_shared_folders_list_results.py b/jcapiv2/test/test_shared_folders_list_results.py new file mode 100644 index 0000000..52e9948 --- /dev/null +++ b/jcapiv2/test/test_shared_folders_list_results.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.shared_folders_list_results import SharedFoldersListResults # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSharedFoldersListResults(unittest.TestCase): + """SharedFoldersListResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSharedFoldersListResults(self): + """Test SharedFoldersListResults""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.shared_folders_list_results.SharedFoldersListResults() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_software_app.py b/jcapiv2/test/test_software_app.py new file mode 100644 index 0000000..5cf919e --- /dev/null +++ b/jcapiv2/test/test_software_app.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.software_app import SoftwareApp # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSoftwareApp(unittest.TestCase): + """SoftwareApp unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSoftwareApp(self): + """Test SoftwareApp""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.software_app.SoftwareApp() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_software_app_apple_vpp.py b/jcapiv2/test/test_software_app_apple_vpp.py new file mode 100644 index 0000000..2af1ffa --- /dev/null +++ b/jcapiv2/test/test_software_app_apple_vpp.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.software_app_apple_vpp import SoftwareAppAppleVpp # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSoftwareAppAppleVpp(unittest.TestCase): + """SoftwareAppAppleVpp unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSoftwareAppAppleVpp(self): + """Test SoftwareAppAppleVpp""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.software_app_apple_vpp.SoftwareAppAppleVpp() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_software_app_reclaim_licenses.py b/jcapiv2/test/test_software_app_reclaim_licenses.py new file mode 100644 index 0000000..8ff173d --- /dev/null +++ b/jcapiv2/test/test_software_app_reclaim_licenses.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.software_app_reclaim_licenses import SoftwareAppReclaimLicenses # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSoftwareAppReclaimLicenses(unittest.TestCase): + """SoftwareAppReclaimLicenses unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSoftwareAppReclaimLicenses(self): + """Test SoftwareAppReclaimLicenses""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.software_app_reclaim_licenses.SoftwareAppReclaimLicenses() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_software_app_settings.py b/jcapiv2/test/test_software_app_settings.py new file mode 100644 index 0000000..9e4274c --- /dev/null +++ b/jcapiv2/test/test_software_app_settings.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.software_app_settings import SoftwareAppSettings # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSoftwareAppSettings(unittest.TestCase): + """SoftwareAppSettings unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSoftwareAppSettings(self): + """Test SoftwareAppSettings""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.software_app_settings.SoftwareAppSettings() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_software_app_status.py b/jcapiv2/test/test_software_app_status.py new file mode 100644 index 0000000..9bdff15 --- /dev/null +++ b/jcapiv2/test/test_software_app_status.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.software_app_status import SoftwareAppStatus # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSoftwareAppStatus(unittest.TestCase): + """SoftwareAppStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSoftwareAppStatus(self): + """Test SoftwareAppStatus""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.software_app_status.SoftwareAppStatus() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_software_app_with_status.py b/jcapiv2/test/test_software_app_with_status.py new file mode 100644 index 0000000..78c95c9 --- /dev/null +++ b/jcapiv2/test/test_software_app_with_status.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.software_app_with_status import SoftwareAppWithStatus # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSoftwareAppWithStatus(unittest.TestCase): + """SoftwareAppWithStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSoftwareAppWithStatus(self): + """Test SoftwareAppWithStatus""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.software_app_with_status.SoftwareAppWithStatus() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_software_apps_api.py b/jcapiv2/test/test_software_apps_api.py new file mode 100644 index 0000000..9230e49 --- /dev/null +++ b/jcapiv2/test/test_software_apps_api.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.api.software_apps_api import SoftwareAppsApi # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSoftwareAppsApi(unittest.TestCase): + """SoftwareAppsApi unit test stubs""" + + def setUp(self): + self.api = SoftwareAppsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_graph_softwareapps_associations_list(self): + """Test case for graph_softwareapps_associations_list + + List the associations of a Software Application # noqa: E501 + """ + pass + + def test_graph_softwareapps_associations_post(self): + """Test case for graph_softwareapps_associations_post + + Manage the associations of a software application. # noqa: E501 + """ + pass + + def test_graph_softwareapps_traverse_system(self): + """Test case for graph_softwareapps_traverse_system + + List the Systems bound to a Software App. # noqa: E501 + """ + pass + + def test_graph_softwareapps_traverse_system_group(self): + """Test case for graph_softwareapps_traverse_system_group + + List the System Groups bound to a Software App. # noqa: E501 + """ + pass + + def test_software_app_statuses_list(self): + """Test case for software_app_statuses_list + + Get the status of the provided Software Application # noqa: E501 + """ + pass + + def test_software_apps_delete(self): + """Test case for software_apps_delete + + Delete a configured Software Application # noqa: E501 + """ + pass + + def test_software_apps_get(self): + """Test case for software_apps_get + + Retrieve a configured Software Application. # noqa: E501 + """ + pass + + def test_software_apps_list(self): + """Test case for software_apps_list + + Get all configured Software Applications. # noqa: E501 + """ + pass + + def test_software_apps_post(self): + """Test case for software_apps_post + + Create a Software Application that will be managed by JumpCloud. # noqa: E501 + """ + pass + + def test_software_apps_reclaim_licenses(self): + """Test case for software_apps_reclaim_licenses + + Reclaim Licenses for a Software Application. # noqa: E501 + """ + pass + + def test_software_apps_retry_installation(self): + """Test case for software_apps_retry_installation + + Retry Installation for a Software Application # noqa: E501 + """ + pass + + def test_software_apps_update(self): + """Test case for software_apps_update + + Update a Software Application Configuration. # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_software_apps_retry_installation_request.py b/jcapiv2/test/test_software_apps_retry_installation_request.py new file mode 100644 index 0000000..654166b --- /dev/null +++ b/jcapiv2/test/test_software_apps_retry_installation_request.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.software_apps_retry_installation_request import SoftwareAppsRetryInstallationRequest # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSoftwareAppsRetryInstallationRequest(unittest.TestCase): + """SoftwareAppsRetryInstallationRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSoftwareAppsRetryInstallationRequest(self): + """Test SoftwareAppsRetryInstallationRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.software_apps_retry_installation_request.SoftwareAppsRetryInstallationRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_sshkeylist.py b/jcapiv2/test/test_sshkeylist.py deleted file mode 100644 index 84b4e54..0000000 --- a/jcapiv2/test/test_sshkeylist.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.sshkeylist import Sshkeylist # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestSshkeylist(unittest.TestCase): - """Sshkeylist unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSshkeylist(self): - """Test Sshkeylist""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.sshkeylist.Sshkeylist() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_subscription.py b/jcapiv2/test/test_subscription.py new file mode 100644 index 0000000..d98584e --- /dev/null +++ b/jcapiv2/test/test_subscription.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.subscription import Subscription # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSubscription(unittest.TestCase): + """Subscription unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSubscription(self): + """Test Subscription""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.subscription.Subscription() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_subscriptions_api.py b/jcapiv2/test/test_subscriptions_api.py new file mode 100644 index 0000000..5eeb25b --- /dev/null +++ b/jcapiv2/test/test_subscriptions_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.api.subscriptions_api import SubscriptionsApi # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSubscriptionsApi(unittest.TestCase): + """SubscriptionsApi unit test stubs""" + + def setUp(self): + self.api = SubscriptionsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_subscriptions_get(self): + """Test case for subscriptions_get + + Lists all the Pricing & Packaging Subscriptions # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_suggestion_counts.py b/jcapiv2/test/test_suggestion_counts.py new file mode 100644 index 0000000..b8f8ef4 --- /dev/null +++ b/jcapiv2/test/test_suggestion_counts.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.suggestion_counts import SuggestionCounts # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSuggestionCounts(unittest.TestCase): + """SuggestionCounts unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSuggestionCounts(self): + """Test SuggestionCounts""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.suggestion_counts.SuggestionCounts() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_graph_management_req.py b/jcapiv2/test/test_system_graph_management_req.py deleted file mode 100644 index ea0e5da..0000000 --- a/jcapiv2/test/test_system_graph_management_req.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.system_graph_management_req import SystemGraphManagementReq # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestSystemGraphManagementReq(unittest.TestCase): - """SystemGraphManagementReq unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSystemGraphManagementReq(self): - """Test SystemGraphManagementReq""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.system_graph_management_req.SystemGraphManagementReq() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_system_graph_management_req_attributes.py b/jcapiv2/test/test_system_graph_management_req_attributes.py deleted file mode 100644 index 0b4106d..0000000 --- a/jcapiv2/test/test_system_graph_management_req_attributes.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.system_graph_management_req_attributes import SystemGraphManagementReqAttributes # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestSystemGraphManagementReqAttributes(unittest.TestCase): - """SystemGraphManagementReqAttributes unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSystemGraphManagementReqAttributes(self): - """Test SystemGraphManagementReqAttributes""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.system_graph_management_req_attributes.SystemGraphManagementReqAttributes() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_system_graph_management_req_attributes_sudo.py b/jcapiv2/test/test_system_graph_management_req_attributes_sudo.py deleted file mode 100644 index 4267f2b..0000000 --- a/jcapiv2/test/test_system_graph_management_req_attributes_sudo.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.system_graph_management_req_attributes_sudo import SystemGraphManagementReqAttributesSudo # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestSystemGraphManagementReqAttributesSudo(unittest.TestCase): - """SystemGraphManagementReqAttributesSudo unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSystemGraphManagementReqAttributesSudo(self): - """Test SystemGraphManagementReqAttributesSudo""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.system_graph_management_req_attributes_sudo.SystemGraphManagementReqAttributesSudo() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_system_group.py b/jcapiv2/test/test_system_group.py index 0287174..cc26511 100644 --- a/jcapiv2/test/test_system_group.py +++ b/jcapiv2/test/test_system_group.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_group_associations_api.py b/jcapiv2/test/test_system_group_associations_api.py index f07fc30..dc5e115 100644 --- a/jcapiv2/test/test_system_group_associations_api.py +++ b/jcapiv2/test/test_system_group_associations_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestSystemGroupAssociationsApi(unittest.TestCase): """SystemGroupAssociationsApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.system_group_associations_api.SystemGroupAssociationsApi() # noqa: E501 + self.api = SystemGroupAssociationsApi() # noqa: E501 def tearDown(self): pass @@ -57,6 +56,13 @@ def test_graph_system_group_traverse_policy(self): """ pass + def test_graph_system_group_traverse_policy_group(self): + """Test case for graph_system_group_traverse_policy_group + + List the Policy Groups bound to a System Group # noqa: E501 + """ + pass + def test_graph_system_group_traverse_user(self): """Test case for graph_system_group_traverse_user diff --git a/jcapiv2/test/test_system_group_data.py b/jcapiv2/test/test_system_group_data.py index 8cc0925..96d01d4 100644 --- a/jcapiv2/test/test_system_group_data.py +++ b/jcapiv2/test/test_system_group_data.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_group_graph_management_req.py b/jcapiv2/test/test_system_group_graph_management_req.py deleted file mode 100644 index 9a500a6..0000000 --- a/jcapiv2/test/test_system_group_graph_management_req.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.system_group_graph_management_req import SystemGroupGraphManagementReq # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestSystemGroupGraphManagementReq(unittest.TestCase): - """SystemGroupGraphManagementReq unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSystemGroupGraphManagementReq(self): - """Test SystemGroupGraphManagementReq""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.system_group_graph_management_req.SystemGroupGraphManagementReq() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_system_group_members__membership_api.py b/jcapiv2/test/test_system_group_members__membership_api.py index f6b3ce2..2cfb07c 100644 --- a/jcapiv2/test/test_system_group_members__membership_api.py +++ b/jcapiv2/test/test_system_group_members__membership_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,18 +23,11 @@ class TestSystemGroupMembersMembershipApi(unittest.TestCase): """SystemGroupMembersMembershipApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.system_group_members__membership_api.SystemGroupMembersMembershipApi() # noqa: E501 + self.api = SystemGroupMembersMembershipApi() # noqa: E501 def tearDown(self): pass - def test_graph_system_group_member_of(self): - """Test case for graph_system_group_member_of - - List the System Group's parents # noqa: E501 - """ - pass - def test_graph_system_group_members_list(self): """Test case for graph_system_group_members_list diff --git a/jcapiv2/test/test_system_group_members_req.py b/jcapiv2/test/test_system_group_members_req.py deleted file mode 100644 index 1772c3c..0000000 --- a/jcapiv2/test/test_system_group_members_req.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.system_group_members_req import SystemGroupMembersReq # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestSystemGroupMembersReq(unittest.TestCase): - """SystemGroupMembersReq unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSystemGroupMembersReq(self): - """Test SystemGroupMembersReq""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.system_group_members_req.SystemGroupMembersReq() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_system_groups_api.py b/jcapiv2/test/test_system_groups_api.py index aa1c71f..78dadc0 100644 --- a/jcapiv2/test/test_system_groups_api.py +++ b/jcapiv2/test/test_system_groups_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestSystemGroupsApi(unittest.TestCase): """SystemGroupsApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.system_groups_api.SystemGroupsApi() # noqa: E501 + self.api = SystemGroupsApi() # noqa: E501 def tearDown(self): pass @@ -43,13 +42,6 @@ def test_graph_system_group_associations_post(self): """ pass - def test_graph_system_group_member_of(self): - """Test case for graph_system_group_member_of - - List the System Group's parents # noqa: E501 - """ - pass - def test_graph_system_group_members_list(self): """Test case for graph_system_group_members_list @@ -78,6 +70,13 @@ def test_graph_system_group_traverse_policy(self): """ pass + def test_graph_system_group_traverse_policy_group(self): + """Test case for graph_system_group_traverse_policy_group + + List the Policy Groups bound to a System Group # noqa: E501 + """ + pass + def test_graph_system_group_traverse_user(self): """Test case for graph_system_group_traverse_user @@ -113,13 +112,6 @@ def test_groups_system_list(self): """ pass - def test_groups_system_patch(self): - """Test case for groups_system_patch - - Partial update a System Group # noqa: E501 - """ - pass - def test_groups_system_post(self): """Test case for groups_system_post diff --git a/jcapiv2/test/test_system_insights_alf.py b/jcapiv2/test/test_system_insights_alf.py new file mode 100644 index 0000000..99418c8 --- /dev/null +++ b/jcapiv2/test/test_system_insights_alf.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_alf import SystemInsightsAlf # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsAlf(unittest.TestCase): + """SystemInsightsAlf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsAlf(self): + """Test SystemInsightsAlf""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_alf.SystemInsightsAlf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_alf_exceptions.py b/jcapiv2/test/test_system_insights_alf_exceptions.py new file mode 100644 index 0000000..32d561e --- /dev/null +++ b/jcapiv2/test/test_system_insights_alf_exceptions.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_alf_exceptions import SystemInsightsAlfExceptions # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsAlfExceptions(unittest.TestCase): + """SystemInsightsAlfExceptions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsAlfExceptions(self): + """Test SystemInsightsAlfExceptions""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_alf_exceptions.SystemInsightsAlfExceptions() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_alf_explicit_auths.py b/jcapiv2/test/test_system_insights_alf_explicit_auths.py new file mode 100644 index 0000000..d4fb325 --- /dev/null +++ b/jcapiv2/test/test_system_insights_alf_explicit_auths.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_alf_explicit_auths import SystemInsightsAlfExplicitAuths # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsAlfExplicitAuths(unittest.TestCase): + """SystemInsightsAlfExplicitAuths unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsAlfExplicitAuths(self): + """Test SystemInsightsAlfExplicitAuths""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_alf_explicit_auths.SystemInsightsAlfExplicitAuths() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_api.py b/jcapiv2/test/test_system_insights_api.py index 1415b2d..a8316d9 100644 --- a/jcapiv2/test/test_system_insights_api.py +++ b/jcapiv2/test/test_system_insights_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,11 +23,39 @@ class TestSystemInsightsApi(unittest.TestCase): """SystemInsightsApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.system_insights_api.SystemInsightsApi() # noqa: E501 + self.api = SystemInsightsApi() # noqa: E501 def tearDown(self): pass + def test_systeminsights_list_alf(self): + """Test case for systeminsights_list_alf + + List System Insights ALF # noqa: E501 + """ + pass + + def test_systeminsights_list_alf_exceptions(self): + """Test case for systeminsights_list_alf_exceptions + + List System Insights ALF Exceptions # noqa: E501 + """ + pass + + def test_systeminsights_list_alf_explicit_auths(self): + """Test case for systeminsights_list_alf_explicit_auths + + List System Insights ALF Explicit Authentications # noqa: E501 + """ + pass + + def test_systeminsights_list_appcompat_shims(self): + """Test case for systeminsights_list_appcompat_shims + + List System Insights Application Compatibility Shims # noqa: E501 + """ + pass + def test_systeminsights_list_apps(self): """Test case for systeminsights_list_apps @@ -36,6 +63,27 @@ def test_systeminsights_list_apps(self): """ pass + def test_systeminsights_list_authorized_keys(self): + """Test case for systeminsights_list_authorized_keys + + List System Insights Authorized Keys # noqa: E501 + """ + pass + + def test_systeminsights_list_azure_instance_metadata(self): + """Test case for systeminsights_list_azure_instance_metadata + + List System Insights Azure Instance Metadata # noqa: E501 + """ + pass + + def test_systeminsights_list_azure_instance_tags(self): + """Test case for systeminsights_list_azure_instance_tags + + List System Insights Azure Instance Tags # noqa: E501 + """ + pass + def test_systeminsights_list_battery(self): """Test case for systeminsights_list_battery @@ -57,6 +105,20 @@ def test_systeminsights_list_browser_plugins(self): """ pass + def test_systeminsights_list_certificates(self): + """Test case for systeminsights_list_certificates + + List System Insights Certificates # noqa: E501 + """ + pass + + def test_systeminsights_list_chassis_info(self): + """Test case for systeminsights_list_chassis_info + + List System Insights Chassis Info # noqa: E501 + """ + pass + def test_systeminsights_list_chrome_extensions(self): """Test case for systeminsights_list_chrome_extensions @@ -64,6 +126,13 @@ def test_systeminsights_list_chrome_extensions(self): """ pass + def test_systeminsights_list_connectivity(self): + """Test case for systeminsights_list_connectivity + + List System Insights Connectivity # noqa: E501 + """ + pass + def test_systeminsights_list_crashes(self): """Test case for systeminsights_list_crashes @@ -71,6 +140,13 @@ def test_systeminsights_list_crashes(self): """ pass + def test_systeminsights_list_cups_destinations(self): + """Test case for systeminsights_list_cups_destinations + + List System Insights CUPS Destinations # noqa: E501 + """ + pass + def test_systeminsights_list_disk_encryption(self): """Test case for systeminsights_list_disk_encryption @@ -85,6 +161,13 @@ def test_systeminsights_list_disk_info(self): """ pass + def test_systeminsights_list_dns_resolvers(self): + """Test case for systeminsights_list_dns_resolvers + + List System Insights DNS Resolvers # noqa: E501 + """ + pass + def test_systeminsights_list_etc_hosts(self): """Test case for systeminsights_list_etc_hosts @@ -120,6 +203,13 @@ def test_systeminsights_list_interface_addresses(self): """ pass + def test_systeminsights_list_interface_details(self): + """Test case for systeminsights_list_interface_details + + List System Insights Interface Details # noqa: E501 + """ + pass + def test_systeminsights_list_kernel_info(self): """Test case for systeminsights_list_kernel_info @@ -134,6 +224,13 @@ def test_systeminsights_list_launchd(self): """ pass + def test_systeminsights_list_linux_packages(self): + """Test case for systeminsights_list_linux_packages + + List System Insights Linux Packages # noqa: E501 + """ + pass + def test_systeminsights_list_logged_in_users(self): """Test case for systeminsights_list_logged_in_users @@ -148,6 +245,13 @@ def test_systeminsights_list_logical_drives(self): """ pass + def test_systeminsights_list_managed_policies(self): + """Test case for systeminsights_list_managed_policies + + List System Insights Managed Policies # noqa: E501 + """ + pass + def test_systeminsights_list_mounts(self): """Test case for systeminsights_list_mounts @@ -176,6 +280,13 @@ def test_systeminsights_list_programs(self): """ pass + def test_systeminsights_list_python_packages(self): + """Test case for systeminsights_list_python_packages + + List System Insights Python Packages # noqa: E501 + """ + pass + def test_systeminsights_list_safari_extensions(self): """Test case for systeminsights_list_safari_extensions @@ -183,73 +294,73 @@ def test_systeminsights_list_safari_extensions(self): """ pass - def test_systeminsights_list_system_apps(self): - """Test case for systeminsights_list_system_apps + def test_systeminsights_list_scheduled_tasks(self): + """Test case for systeminsights_list_scheduled_tasks - List System Insights System Apps # noqa: E501 + List System Insights Scheduled Tasks # noqa: E501 """ pass - def test_systeminsights_list_system_bitlocker_info(self): - """Test case for systeminsights_list_system_bitlocker_info + def test_systeminsights_list_secureboot(self): + """Test case for systeminsights_list_secureboot - List System Insights System Bitlocker Info # noqa: E501 + List System Insights Secure Boot # noqa: E501 """ pass - def test_systeminsights_list_system_browser_plugins(self): - """Test case for systeminsights_list_system_browser_plugins + def test_systeminsights_list_services(self): + """Test case for systeminsights_list_services - List System Insights System Browser Plugins # noqa: E501 + List System Insights Services # noqa: E501 """ pass - def test_systeminsights_list_system_chrome_extensions(self): - """Test case for systeminsights_list_system_chrome_extensions + def test_systeminsights_list_shadow(self): + """Test case for systeminsights_list_shadow - List System Insights System Chrome Extensions # noqa: E501 + LIst System Insights Shadow # noqa: E501 """ pass - def test_systeminsights_list_system_controls(self): - """Test case for systeminsights_list_system_controls + def test_systeminsights_list_shared_folders(self): + """Test case for systeminsights_list_shared_folders - List System Insights System Control # noqa: E501 + List System Insights Shared Folders # noqa: E501 """ pass - def test_systeminsights_list_system_disk_encryption(self): - """Test case for systeminsights_list_system_disk_encryption + def test_systeminsights_list_shared_resources(self): + """Test case for systeminsights_list_shared_resources - List System Insights System Disk Encryption # noqa: E501 + List System Insights Shared Resources # noqa: E501 """ pass - def test_systeminsights_list_system_disk_info(self): - """Test case for systeminsights_list_system_disk_info + def test_systeminsights_list_sharing_preferences(self): + """Test case for systeminsights_list_sharing_preferences - List System Insights System Disk Info # noqa: E501 + List System Insights Sharing Preferences # noqa: E501 """ pass - def test_systeminsights_list_system_etc_hosts(self): - """Test case for systeminsights_list_system_etc_hosts + def test_systeminsights_list_sip_config(self): + """Test case for systeminsights_list_sip_config - List System Insights System Etc Hosts # noqa: E501 + List System Insights SIP Config # noqa: E501 """ pass - def test_systeminsights_list_system_firefox_addons(self): - """Test case for systeminsights_list_system_firefox_addons + def test_systeminsights_list_startup_items(self): + """Test case for systeminsights_list_startup_items - List System Insights System Firefox Addons # noqa: E501 + List System Insights Startup Items # noqa: E501 """ pass - def test_systeminsights_list_system_groups(self): - """Test case for systeminsights_list_system_groups + def test_systeminsights_list_system_controls(self): + """Test case for systeminsights_list_system_controls - List System Insights System Groups # noqa: E501 + List System Insights System Control # noqa: E501 """ pass @@ -260,122 +371,80 @@ def test_systeminsights_list_system_info(self): """ pass - def test_systeminsights_list_system_interface_addresses(self): - """Test case for systeminsights_list_system_interface_addresses - - List System Insights System Interface Addresses # noqa: E501 - """ - pass - - def test_systeminsights_list_system_kernel_info(self): - """Test case for systeminsights_list_system_kernel_info + def test_systeminsights_list_tpm_info(self): + """Test case for systeminsights_list_tpm_info - List System Insights System Kernel Info # noqa: E501 + List System Insights TPM Info # noqa: E501 """ pass - def test_systeminsights_list_system_logical_drives(self): - """Test case for systeminsights_list_system_logical_drives - - List System Insights System Logical Drives # noqa: E501 - """ - pass - - def test_systeminsights_list_system_mounts(self): - """Test case for systeminsights_list_system_mounts - - List System Insights System Mounts # noqa: E501 - """ - pass - - def test_systeminsights_list_system_os_version(self): - """Test case for systeminsights_list_system_os_version - - List System Insights System OS Version # noqa: E501 - """ - pass - - def test_systeminsights_list_system_patches(self): - """Test case for systeminsights_list_system_patches - - List System Insights System Patches # noqa: E501 - """ - pass - - def test_systeminsights_list_system_programs(self): - """Test case for systeminsights_list_system_programs - - List System Insights System Programs # noqa: E501 - """ - pass - - def test_systeminsights_list_system_safari_extensions(self): - """Test case for systeminsights_list_system_safari_extensions + def test_systeminsights_list_uptime(self): + """Test case for systeminsights_list_uptime - List System Insights System Safari Extensions # noqa: E501 + List System Insights Uptime # noqa: E501 """ pass - def test_systeminsights_list_system_system_controls(self): - """Test case for systeminsights_list_system_system_controls + def test_systeminsights_list_usb_devices(self): + """Test case for systeminsights_list_usb_devices - List System Insights System System Controls # noqa: E501 + List System Insights USB Devices # noqa: E501 """ pass - def test_systeminsights_list_system_system_info(self): - """Test case for systeminsights_list_system_system_info + def test_systeminsights_list_user_groups(self): + """Test case for systeminsights_list_user_groups - List System Insights System System Info # noqa: E501 + List System Insights User Groups # noqa: E501 """ pass - def test_systeminsights_list_system_uptime(self): - """Test case for systeminsights_list_system_uptime + def test_systeminsights_list_user_ssh_keys(self): + """Test case for systeminsights_list_user_ssh_keys - List System Insights System Uptime # noqa: E501 + List System Insights User SSH Keys # noqa: E501 """ pass - def test_systeminsights_list_system_users(self): - """Test case for systeminsights_list_system_users + def test_systeminsights_list_userassist(self): + """Test case for systeminsights_list_userassist - List System Insights System Users # noqa: E501 + List System Insights User Assist # noqa: E501 """ pass - def test_systeminsights_list_uptime(self): - """Test case for systeminsights_list_uptime + def test_systeminsights_list_users(self): + """Test case for systeminsights_list_users - List System Insights Uptime # noqa: E501 + List System Insights Users # noqa: E501 """ pass - def test_systeminsights_list_usb_devices(self): - """Test case for systeminsights_list_usb_devices + def test_systeminsights_list_wifi_networks(self): + """Test case for systeminsights_list_wifi_networks - List System Insights USB Devices # noqa: E501 + List System Insights WiFi Networks # noqa: E501 """ pass - def test_systeminsights_list_user_groups(self): - """Test case for systeminsights_list_user_groups + def test_systeminsights_list_wifi_status(self): + """Test case for systeminsights_list_wifi_status - List System Insights User Groups # noqa: E501 + List System Insights WiFi Status # noqa: E501 """ pass - def test_systeminsights_list_users(self): - """Test case for systeminsights_list_users + def test_systeminsights_list_windows_security_center(self): + """Test case for systeminsights_list_windows_security_center - List System Insights Users # noqa: E501 + List System Insights Windows Security Center # noqa: E501 """ pass - def test_systeminsights_list_windows_crashes(self): - """Test case for systeminsights_list_windows_crashes + def test_systeminsights_list_windows_security_products(self): + """Test case for systeminsights_list_windows_security_products - List System Insights Windows Crashes # noqa: E501 + List System Insights Windows Security Products # noqa: E501 """ pass diff --git a/jcapiv2/test/test_system_insights_appcompat_shims.py b/jcapiv2/test/test_system_insights_appcompat_shims.py new file mode 100644 index 0000000..fbf8bc5 --- /dev/null +++ b/jcapiv2/test/test_system_insights_appcompat_shims.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_appcompat_shims import SystemInsightsAppcompatShims # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsAppcompatShims(unittest.TestCase): + """SystemInsightsAppcompatShims unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsAppcompatShims(self): + """Test SystemInsightsAppcompatShims""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_appcompat_shims.SystemInsightsAppcompatShims() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_apps.py b/jcapiv2/test/test_system_insights_apps.py index 15c7be7..d9bea8c 100644 --- a/jcapiv2/test/test_system_insights_apps.py +++ b/jcapiv2/test/test_system_insights_apps.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_authorized_keys.py b/jcapiv2/test/test_system_insights_authorized_keys.py new file mode 100644 index 0000000..435206d --- /dev/null +++ b/jcapiv2/test/test_system_insights_authorized_keys.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_authorized_keys import SystemInsightsAuthorizedKeys # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsAuthorizedKeys(unittest.TestCase): + """SystemInsightsAuthorizedKeys unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsAuthorizedKeys(self): + """Test SystemInsightsAuthorizedKeys""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_authorized_keys.SystemInsightsAuthorizedKeys() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_azure_instance_metadata.py b/jcapiv2/test/test_system_insights_azure_instance_metadata.py new file mode 100644 index 0000000..dddb5d6 --- /dev/null +++ b/jcapiv2/test/test_system_insights_azure_instance_metadata.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_azure_instance_metadata import SystemInsightsAzureInstanceMetadata # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsAzureInstanceMetadata(unittest.TestCase): + """SystemInsightsAzureInstanceMetadata unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsAzureInstanceMetadata(self): + """Test SystemInsightsAzureInstanceMetadata""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_azure_instance_metadata.SystemInsightsAzureInstanceMetadata() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_azure_instance_tags.py b/jcapiv2/test/test_system_insights_azure_instance_tags.py new file mode 100644 index 0000000..e4890fe --- /dev/null +++ b/jcapiv2/test/test_system_insights_azure_instance_tags.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_azure_instance_tags import SystemInsightsAzureInstanceTags # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsAzureInstanceTags(unittest.TestCase): + """SystemInsightsAzureInstanceTags unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsAzureInstanceTags(self): + """Test SystemInsightsAzureInstanceTags""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_azure_instance_tags.SystemInsightsAzureInstanceTags() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_battery.py b/jcapiv2/test/test_system_insights_battery.py index 016781d..d9d6cef 100644 --- a/jcapiv2/test/test_system_insights_battery.py +++ b/jcapiv2/test/test_system_insights_battery.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_bitlocker_info.py b/jcapiv2/test/test_system_insights_bitlocker_info.py index ccd06fb..692733c 100644 --- a/jcapiv2/test/test_system_insights_bitlocker_info.py +++ b/jcapiv2/test/test_system_insights_bitlocker_info.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_browser_plugins.py b/jcapiv2/test/test_system_insights_browser_plugins.py index 1d1fdd6..2b8465b 100644 --- a/jcapiv2/test/test_system_insights_browser_plugins.py +++ b/jcapiv2/test/test_system_insights_browser_plugins.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_certificates.py b/jcapiv2/test/test_system_insights_certificates.py new file mode 100644 index 0000000..9fc718c --- /dev/null +++ b/jcapiv2/test/test_system_insights_certificates.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_certificates import SystemInsightsCertificates # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsCertificates(unittest.TestCase): + """SystemInsightsCertificates unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsCertificates(self): + """Test SystemInsightsCertificates""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_certificates.SystemInsightsCertificates() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_chassis_info.py b/jcapiv2/test/test_system_insights_chassis_info.py new file mode 100644 index 0000000..c20c016 --- /dev/null +++ b/jcapiv2/test/test_system_insights_chassis_info.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_chassis_info import SystemInsightsChassisInfo # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsChassisInfo(unittest.TestCase): + """SystemInsightsChassisInfo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsChassisInfo(self): + """Test SystemInsightsChassisInfo""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_chassis_info.SystemInsightsChassisInfo() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_chrome_extensions.py b/jcapiv2/test/test_system_insights_chrome_extensions.py index 8077e94..bb8686d 100644 --- a/jcapiv2/test/test_system_insights_chrome_extensions.py +++ b/jcapiv2/test/test_system_insights_chrome_extensions.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_connectivity.py b/jcapiv2/test/test_system_insights_connectivity.py new file mode 100644 index 0000000..569f7ec --- /dev/null +++ b/jcapiv2/test/test_system_insights_connectivity.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_connectivity import SystemInsightsConnectivity # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsConnectivity(unittest.TestCase): + """SystemInsightsConnectivity unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsConnectivity(self): + """Test SystemInsightsConnectivity""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_connectivity.SystemInsightsConnectivity() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_crashes.py b/jcapiv2/test/test_system_insights_crashes.py index f8b8b8d..a73c893 100644 --- a/jcapiv2/test/test_system_insights_crashes.py +++ b/jcapiv2/test/test_system_insights_crashes.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_cups_destinations.py b/jcapiv2/test/test_system_insights_cups_destinations.py new file mode 100644 index 0000000..9736d52 --- /dev/null +++ b/jcapiv2/test/test_system_insights_cups_destinations.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_cups_destinations import SystemInsightsCupsDestinations # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsCupsDestinations(unittest.TestCase): + """SystemInsightsCupsDestinations unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsCupsDestinations(self): + """Test SystemInsightsCupsDestinations""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_cups_destinations.SystemInsightsCupsDestinations() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_disk_encryption.py b/jcapiv2/test/test_system_insights_disk_encryption.py index fdc4547..db0ab35 100644 --- a/jcapiv2/test/test_system_insights_disk_encryption.py +++ b/jcapiv2/test/test_system_insights_disk_encryption.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_disk_info.py b/jcapiv2/test/test_system_insights_disk_info.py index 3575ed3..6337f12 100644 --- a/jcapiv2/test/test_system_insights_disk_info.py +++ b/jcapiv2/test/test_system_insights_disk_info.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_dns_resolvers.py b/jcapiv2/test/test_system_insights_dns_resolvers.py new file mode 100644 index 0000000..a92f83d --- /dev/null +++ b/jcapiv2/test/test_system_insights_dns_resolvers.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_dns_resolvers import SystemInsightsDnsResolvers # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsDnsResolvers(unittest.TestCase): + """SystemInsightsDnsResolvers unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsDnsResolvers(self): + """Test SystemInsightsDnsResolvers""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_dns_resolvers.SystemInsightsDnsResolvers() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_etc_hosts.py b/jcapiv2/test/test_system_insights_etc_hosts.py index 92a23ef..c6497a8 100644 --- a/jcapiv2/test/test_system_insights_etc_hosts.py +++ b/jcapiv2/test/test_system_insights_etc_hosts.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_firefox_addons.py b/jcapiv2/test/test_system_insights_firefox_addons.py index e1bc3c4..2930ad7 100644 --- a/jcapiv2/test/test_system_insights_firefox_addons.py +++ b/jcapiv2/test/test_system_insights_firefox_addons.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_groups.py b/jcapiv2/test/test_system_insights_groups.py index 064f093..5a9e25d 100644 --- a/jcapiv2/test/test_system_insights_groups.py +++ b/jcapiv2/test/test_system_insights_groups.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_ie_extensions.py b/jcapiv2/test/test_system_insights_ie_extensions.py index ca9ce1a..78bce45 100644 --- a/jcapiv2/test/test_system_insights_ie_extensions.py +++ b/jcapiv2/test/test_system_insights_ie_extensions.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_interface_addresses.py b/jcapiv2/test/test_system_insights_interface_addresses.py index 15a3903..e033d95 100644 --- a/jcapiv2/test/test_system_insights_interface_addresses.py +++ b/jcapiv2/test/test_system_insights_interface_addresses.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_interface_details.py b/jcapiv2/test/test_system_insights_interface_details.py new file mode 100644 index 0000000..34b161c --- /dev/null +++ b/jcapiv2/test/test_system_insights_interface_details.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_interface_details import SystemInsightsInterfaceDetails # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsInterfaceDetails(unittest.TestCase): + """SystemInsightsInterfaceDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsInterfaceDetails(self): + """Test SystemInsightsInterfaceDetails""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_interface_details.SystemInsightsInterfaceDetails() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_kernel_info.py b/jcapiv2/test/test_system_insights_kernel_info.py index 1f179d5..8914d44 100644 --- a/jcapiv2/test/test_system_insights_kernel_info.py +++ b/jcapiv2/test/test_system_insights_kernel_info.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_launchd.py b/jcapiv2/test/test_system_insights_launchd.py index e5cf5e0..dc67142 100644 --- a/jcapiv2/test/test_system_insights_launchd.py +++ b/jcapiv2/test/test_system_insights_launchd.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_linux_packages.py b/jcapiv2/test/test_system_insights_linux_packages.py new file mode 100644 index 0000000..f33ede0 --- /dev/null +++ b/jcapiv2/test/test_system_insights_linux_packages.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_linux_packages import SystemInsightsLinuxPackages # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsLinuxPackages(unittest.TestCase): + """SystemInsightsLinuxPackages unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsLinuxPackages(self): + """Test SystemInsightsLinuxPackages""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_linux_packages.SystemInsightsLinuxPackages() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_logged_in_users.py b/jcapiv2/test/test_system_insights_logged_in_users.py index 5969a44..2a4cf57 100644 --- a/jcapiv2/test/test_system_insights_logged_in_users.py +++ b/jcapiv2/test/test_system_insights_logged_in_users.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_logical_drives.py b/jcapiv2/test/test_system_insights_logical_drives.py new file mode 100644 index 0000000..18fbaa0 --- /dev/null +++ b/jcapiv2/test/test_system_insights_logical_drives.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_logical_drives import SystemInsightsLogicalDrives # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsLogicalDrives(unittest.TestCase): + """SystemInsightsLogicalDrives unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsLogicalDrives(self): + """Test SystemInsightsLogicalDrives""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_logical_drives.SystemInsightsLogicalDrives() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_logical_drvies.py b/jcapiv2/test/test_system_insights_logical_drvies.py deleted file mode 100644 index f0ee592..0000000 --- a/jcapiv2/test/test_system_insights_logical_drvies.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.system_insights_logical_drvies import SystemInsightsLogicalDrvies # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestSystemInsightsLogicalDrvies(unittest.TestCase): - """SystemInsightsLogicalDrvies unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSystemInsightsLogicalDrvies(self): - """Test SystemInsightsLogicalDrvies""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.system_insights_logical_drvies.SystemInsightsLogicalDrvies() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_system_insights_managed_policies.py b/jcapiv2/test/test_system_insights_managed_policies.py new file mode 100644 index 0000000..1445893 --- /dev/null +++ b/jcapiv2/test/test_system_insights_managed_policies.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_managed_policies import SystemInsightsManagedPolicies # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsManagedPolicies(unittest.TestCase): + """SystemInsightsManagedPolicies unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsManagedPolicies(self): + """Test SystemInsightsManagedPolicies""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_managed_policies.SystemInsightsManagedPolicies() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_mounts.py b/jcapiv2/test/test_system_insights_mounts.py index c58fb51..5d3e090 100644 --- a/jcapiv2/test/test_system_insights_mounts.py +++ b/jcapiv2/test/test_system_insights_mounts.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_os_version.py b/jcapiv2/test/test_system_insights_os_version.py index 58bc218..91ee66d 100644 --- a/jcapiv2/test/test_system_insights_os_version.py +++ b/jcapiv2/test/test_system_insights_os_version.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_patches.py b/jcapiv2/test/test_system_insights_patches.py index f2b3d51..0bfd883 100644 --- a/jcapiv2/test/test_system_insights_patches.py +++ b/jcapiv2/test/test_system_insights_patches.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_programs.py b/jcapiv2/test/test_system_insights_programs.py index 59a7d35..365c01d 100644 --- a/jcapiv2/test/test_system_insights_programs.py +++ b/jcapiv2/test/test_system_insights_programs.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_python_packages.py b/jcapiv2/test/test_system_insights_python_packages.py new file mode 100644 index 0000000..7badf22 --- /dev/null +++ b/jcapiv2/test/test_system_insights_python_packages.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_python_packages import SystemInsightsPythonPackages # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsPythonPackages(unittest.TestCase): + """SystemInsightsPythonPackages unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsPythonPackages(self): + """Test SystemInsightsPythonPackages""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_python_packages.SystemInsightsPythonPackages() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_safari_extensions.py b/jcapiv2/test/test_system_insights_safari_extensions.py index e806830..9ef426d 100644 --- a/jcapiv2/test/test_system_insights_safari_extensions.py +++ b/jcapiv2/test/test_system_insights_safari_extensions.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_scheduled_tasks.py b/jcapiv2/test/test_system_insights_scheduled_tasks.py new file mode 100644 index 0000000..bed0d97 --- /dev/null +++ b/jcapiv2/test/test_system_insights_scheduled_tasks.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_scheduled_tasks import SystemInsightsScheduledTasks # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsScheduledTasks(unittest.TestCase): + """SystemInsightsScheduledTasks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsScheduledTasks(self): + """Test SystemInsightsScheduledTasks""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_scheduled_tasks.SystemInsightsScheduledTasks() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_secureboot.py b/jcapiv2/test/test_system_insights_secureboot.py new file mode 100644 index 0000000..f99ce6a --- /dev/null +++ b/jcapiv2/test/test_system_insights_secureboot.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_secureboot import SystemInsightsSecureboot # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsSecureboot(unittest.TestCase): + """SystemInsightsSecureboot unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsSecureboot(self): + """Test SystemInsightsSecureboot""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_secureboot.SystemInsightsSecureboot() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_services.py b/jcapiv2/test/test_system_insights_services.py new file mode 100644 index 0000000..ec1e553 --- /dev/null +++ b/jcapiv2/test/test_system_insights_services.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_services import SystemInsightsServices # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsServices(unittest.TestCase): + """SystemInsightsServices unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsServices(self): + """Test SystemInsightsServices""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_services.SystemInsightsServices() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_shadow.py b/jcapiv2/test/test_system_insights_shadow.py new file mode 100644 index 0000000..0d29928 --- /dev/null +++ b/jcapiv2/test/test_system_insights_shadow.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_shadow import SystemInsightsShadow # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsShadow(unittest.TestCase): + """SystemInsightsShadow unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsShadow(self): + """Test SystemInsightsShadow""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_shadow.SystemInsightsShadow() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_shared_folders.py b/jcapiv2/test/test_system_insights_shared_folders.py new file mode 100644 index 0000000..11f64e7 --- /dev/null +++ b/jcapiv2/test/test_system_insights_shared_folders.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_shared_folders import SystemInsightsSharedFolders # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsSharedFolders(unittest.TestCase): + """SystemInsightsSharedFolders unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsSharedFolders(self): + """Test SystemInsightsSharedFolders""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_shared_folders.SystemInsightsSharedFolders() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_shared_resources.py b/jcapiv2/test/test_system_insights_shared_resources.py new file mode 100644 index 0000000..65fff55 --- /dev/null +++ b/jcapiv2/test/test_system_insights_shared_resources.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_shared_resources import SystemInsightsSharedResources # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsSharedResources(unittest.TestCase): + """SystemInsightsSharedResources unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsSharedResources(self): + """Test SystemInsightsSharedResources""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_shared_resources.SystemInsightsSharedResources() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_sharing_preferences.py b/jcapiv2/test/test_system_insights_sharing_preferences.py new file mode 100644 index 0000000..8104fde --- /dev/null +++ b/jcapiv2/test/test_system_insights_sharing_preferences.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_sharing_preferences import SystemInsightsSharingPreferences # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsSharingPreferences(unittest.TestCase): + """SystemInsightsSharingPreferences unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsSharingPreferences(self): + """Test SystemInsightsSharingPreferences""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_sharing_preferences.SystemInsightsSharingPreferences() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_sip_config.py b/jcapiv2/test/test_system_insights_sip_config.py new file mode 100644 index 0000000..f7b3cdb --- /dev/null +++ b/jcapiv2/test/test_system_insights_sip_config.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_sip_config import SystemInsightsSipConfig # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsSipConfig(unittest.TestCase): + """SystemInsightsSipConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsSipConfig(self): + """Test SystemInsightsSipConfig""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_sip_config.SystemInsightsSipConfig() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_startup_items.py b/jcapiv2/test/test_system_insights_startup_items.py new file mode 100644 index 0000000..edddc43 --- /dev/null +++ b/jcapiv2/test/test_system_insights_startup_items.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_startup_items import SystemInsightsStartupItems # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsStartupItems(unittest.TestCase): + """SystemInsightsStartupItems unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsStartupItems(self): + """Test SystemInsightsStartupItems""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_startup_items.SystemInsightsStartupItems() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_system_controls.py b/jcapiv2/test/test_system_insights_system_controls.py index fa9907d..a263b0c 100644 --- a/jcapiv2/test/test_system_insights_system_controls.py +++ b/jcapiv2/test/test_system_insights_system_controls.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_system_info.py b/jcapiv2/test/test_system_insights_system_info.py index a52590d..87c3bbb 100644 --- a/jcapiv2/test/test_system_insights_system_info.py +++ b/jcapiv2/test/test_system_insights_system_info.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_tpm_info.py b/jcapiv2/test/test_system_insights_tpm_info.py new file mode 100644 index 0000000..8182756 --- /dev/null +++ b/jcapiv2/test/test_system_insights_tpm_info.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_tpm_info import SystemInsightsTpmInfo # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsTpmInfo(unittest.TestCase): + """SystemInsightsTpmInfo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsTpmInfo(self): + """Test SystemInsightsTpmInfo""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_tpm_info.SystemInsightsTpmInfo() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_uptime.py b/jcapiv2/test/test_system_insights_uptime.py index e6617f6..8e04965 100644 --- a/jcapiv2/test/test_system_insights_uptime.py +++ b/jcapiv2/test/test_system_insights_uptime.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_usb_devices.py b/jcapiv2/test/test_system_insights_usb_devices.py index 22b0c09..1253c2f 100644 --- a/jcapiv2/test/test_system_insights_usb_devices.py +++ b/jcapiv2/test/test_system_insights_usb_devices.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_user_groups.py b/jcapiv2/test/test_system_insights_user_groups.py index a20bf83..46e2467 100644 --- a/jcapiv2/test/test_system_insights_user_groups.py +++ b/jcapiv2/test/test_system_insights_user_groups.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_user_ssh_keys.py b/jcapiv2/test/test_system_insights_user_ssh_keys.py new file mode 100644 index 0000000..d1bb54a --- /dev/null +++ b/jcapiv2/test/test_system_insights_user_ssh_keys.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_user_ssh_keys import SystemInsightsUserSshKeys # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsUserSshKeys(unittest.TestCase): + """SystemInsightsUserSshKeys unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsUserSshKeys(self): + """Test SystemInsightsUserSshKeys""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_user_ssh_keys.SystemInsightsUserSshKeys() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_userassist.py b/jcapiv2/test/test_system_insights_userassist.py new file mode 100644 index 0000000..efaffcf --- /dev/null +++ b/jcapiv2/test/test_system_insights_userassist.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_userassist import SystemInsightsUserassist # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsUserassist(unittest.TestCase): + """SystemInsightsUserassist unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsUserassist(self): + """Test SystemInsightsUserassist""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_userassist.SystemInsightsUserassist() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_users.py b/jcapiv2/test/test_system_insights_users.py index 7e780ca..cdb4ed3 100644 --- a/jcapiv2/test/test_system_insights_users.py +++ b/jcapiv2/test/test_system_insights_users.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_system_insights_wifi_networks.py b/jcapiv2/test/test_system_insights_wifi_networks.py new file mode 100644 index 0000000..af8176d --- /dev/null +++ b/jcapiv2/test/test_system_insights_wifi_networks.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_wifi_networks import SystemInsightsWifiNetworks # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsWifiNetworks(unittest.TestCase): + """SystemInsightsWifiNetworks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsWifiNetworks(self): + """Test SystemInsightsWifiNetworks""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_wifi_networks.SystemInsightsWifiNetworks() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_wifi_status.py b/jcapiv2/test/test_system_insights_wifi_status.py new file mode 100644 index 0000000..127a0b1 --- /dev/null +++ b/jcapiv2/test/test_system_insights_wifi_status.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_wifi_status import SystemInsightsWifiStatus # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsWifiStatus(unittest.TestCase): + """SystemInsightsWifiStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsWifiStatus(self): + """Test SystemInsightsWifiStatus""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_wifi_status.SystemInsightsWifiStatus() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_windows_crashes.py b/jcapiv2/test/test_system_insights_windows_crashes.py deleted file mode 100644 index ce4dd60..0000000 --- a/jcapiv2/test/test_system_insights_windows_crashes.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.system_insights_windows_crashes import SystemInsightsWindowsCrashes # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestSystemInsightsWindowsCrashes(unittest.TestCase): - """SystemInsightsWindowsCrashes unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSystemInsightsWindowsCrashes(self): - """Test SystemInsightsWindowsCrashes""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.system_insights_windows_crashes.SystemInsightsWindowsCrashes() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_system_insights_windows_security_center.py b/jcapiv2/test/test_system_insights_windows_security_center.py new file mode 100644 index 0000000..f8f7f9f --- /dev/null +++ b/jcapiv2/test/test_system_insights_windows_security_center.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_windows_security_center import SystemInsightsWindowsSecurityCenter # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsWindowsSecurityCenter(unittest.TestCase): + """SystemInsightsWindowsSecurityCenter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsWindowsSecurityCenter(self): + """Test SystemInsightsWindowsSecurityCenter""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_windows_security_center.SystemInsightsWindowsSecurityCenter() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_system_insights_windows_security_products.py b/jcapiv2/test/test_system_insights_windows_security_products.py new file mode 100644 index 0000000..c2b8430 --- /dev/null +++ b/jcapiv2/test/test_system_insights_windows_security_products.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.system_insights_windows_security_products import SystemInsightsWindowsSecurityProducts # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestSystemInsightsWindowsSecurityProducts(unittest.TestCase): + """SystemInsightsWindowsSecurityProducts unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSystemInsightsWindowsSecurityProducts(self): + """Test SystemInsightsWindowsSecurityProducts""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.system_insights_windows_security_products.SystemInsightsWindowsSecurityProducts() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_systemfdekey.py b/jcapiv2/test/test_systemfdekey.py index 68b0467..e5c0bda 100644 --- a/jcapiv2/test/test_systemfdekey.py +++ b/jcapiv2/test/test_systemfdekey.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_systems_api.py b/jcapiv2/test/test_systems_api.py index 3d86483..138372b 100644 --- a/jcapiv2/test/test_systems_api.py +++ b/jcapiv2/test/test_systems_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestSystemsApi(unittest.TestCase): """SystemsApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.systems_api.SystemsApi() # noqa: E501 + self.api = SystemsApi() # noqa: E501 def tearDown(self): pass @@ -64,6 +63,13 @@ def test_graph_system_traverse_policy(self): """ pass + def test_graph_system_traverse_policy_group(self): + """Test case for graph_system_traverse_policy_group + + List the Policy Groups bound to a System # noqa: E501 + """ + pass + def test_graph_system_traverse_user(self): """Test case for graph_system_traverse_user @@ -85,6 +91,13 @@ def test_systems_get_fde_key(self): """ pass + def test_systems_list_software_apps_with_statuses(self): + """Test case for systems_list_software_apps_with_statuses + + List the associated Software Application Statuses of a System # noqa: E501 + """ + pass + if __name__ == '__main__': unittest.main() diff --git a/jcapiv2/test/test_systemuser.py b/jcapiv2/test/test_systemuser.py deleted file mode 100644 index 3650cae..0000000 --- a/jcapiv2/test/test_systemuser.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.systemuser import Systemuser # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestSystemuser(unittest.TestCase): - """Systemuser unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSystemuser(self): - """Test Systemuser""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.systemuser.Systemuser() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_systemuserputpost.py b/jcapiv2/test/test_systemuserputpost.py deleted file mode 100644 index d1832b6..0000000 --- a/jcapiv2/test/test_systemuserputpost.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.systemuserputpost import Systemuserputpost # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestSystemuserputpost(unittest.TestCase): - """Systemuserputpost unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSystemuserputpost(self): - """Test Systemuserputpost""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.systemuserputpost.Systemuserputpost() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_systemuserputpost_addresses.py b/jcapiv2/test/test_systemuserputpost_addresses.py deleted file mode 100644 index 2c4cef9..0000000 --- a/jcapiv2/test/test_systemuserputpost_addresses.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.systemuserputpost_addresses import SystemuserputpostAddresses # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestSystemuserputpostAddresses(unittest.TestCase): - """SystemuserputpostAddresses unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSystemuserputpostAddresses(self): - """Test SystemuserputpostAddresses""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.systemuserputpost_addresses.SystemuserputpostAddresses() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_systemuserputpost_phone_numbers.py b/jcapiv2/test/test_systemuserputpost_phone_numbers.py deleted file mode 100644 index d3d3b6e..0000000 --- a/jcapiv2/test/test_systemuserputpost_phone_numbers.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.systemuserputpost_phone_numbers import SystemuserputpostPhoneNumbers # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestSystemuserputpostPhoneNumbers(unittest.TestCase): - """SystemuserputpostPhoneNumbers unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSystemuserputpostPhoneNumbers(self): - """Test SystemuserputpostPhoneNumbers""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.systemuserputpost_phone_numbers.SystemuserputpostPhoneNumbers() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_ticketing_integration_alert.py b/jcapiv2/test/test_ticketing_integration_alert.py new file mode 100644 index 0000000..666344a --- /dev/null +++ b/jcapiv2/test/test_ticketing_integration_alert.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.ticketing_integration_alert import TicketingIntegrationAlert # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestTicketingIntegrationAlert(unittest.TestCase): + """TicketingIntegrationAlert unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTicketingIntegrationAlert(self): + """Test TicketingIntegrationAlert""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.ticketing_integration_alert.TicketingIntegrationAlert() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_ticketing_integration_alerts_resp.py b/jcapiv2/test/test_ticketing_integration_alerts_resp.py new file mode 100644 index 0000000..161c1ca --- /dev/null +++ b/jcapiv2/test/test_ticketing_integration_alerts_resp.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.ticketing_integration_alerts_resp import TicketingIntegrationAlertsResp # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestTicketingIntegrationAlertsResp(unittest.TestCase): + """TicketingIntegrationAlertsResp unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTicketingIntegrationAlertsResp(self): + """Test TicketingIntegrationAlertsResp""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.ticketing_integration_alerts_resp.TicketingIntegrationAlertsResp() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_user.py b/jcapiv2/test/test_user.py new file mode 100644 index 0000000..58ea947 --- /dev/null +++ b/jcapiv2/test/test_user.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + JumpCloud API + + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 + + OpenAPI spec version: 2.0 + Contact: support@jumpcloud.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import jcapiv2 +from jcapiv2.models.user import User # noqa: E501 +from jcapiv2.rest import ApiException + + +class TestUser(unittest.TestCase): + """User unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUser(self): + """Test User""" + # FIXME: construct object with mandatory attributes with example values + # model = jcapiv2.models.user.User() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/jcapiv2/test/test_user_graph_management_req.py b/jcapiv2/test/test_user_graph_management_req.py deleted file mode 100644 index 4aa0ee4..0000000 --- a/jcapiv2/test/test_user_graph_management_req.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.user_graph_management_req import UserGraphManagementReq # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestUserGraphManagementReq(unittest.TestCase): - """UserGraphManagementReq unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUserGraphManagementReq(self): - """Test UserGraphManagementReq""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.user_graph_management_req.UserGraphManagementReq() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_user_group.py b/jcapiv2/test/test_user_group.py index ce1bd48..470c049 100644 --- a/jcapiv2/test/test_user_group.py +++ b/jcapiv2/test/test_user_group.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_user_group_associations_api.py b/jcapiv2/test/test_user_group_associations_api.py index 75ca67b..4550d15 100644 --- a/jcapiv2/test/test_user_group_associations_api.py +++ b/jcapiv2/test/test_user_group_associations_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestUserGroupAssociationsApi(unittest.TestCase): """UserGroupAssociationsApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.user_group_associations_api.UserGroupAssociationsApi() # noqa: E501 + self.api = UserGroupAssociationsApi() # noqa: E501 def tearDown(self): pass diff --git a/jcapiv2/test/test_user_group_attributes.py b/jcapiv2/test/test_user_group_attributes.py deleted file mode 100644 index e6ca8ae..0000000 --- a/jcapiv2/test/test_user_group_attributes.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.user_group_attributes import UserGroupAttributes # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestUserGroupAttributes(unittest.TestCase): - """UserGroupAttributes unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUserGroupAttributes(self): - """Test UserGroupAttributes""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.user_group_attributes.UserGroupAttributes() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_user_group_attributes_posix_groups.py b/jcapiv2/test/test_user_group_attributes_posix_groups.py deleted file mode 100644 index 43bcb42..0000000 --- a/jcapiv2/test/test_user_group_attributes_posix_groups.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.user_group_attributes_posix_groups import UserGroupAttributesPosixGroups # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestUserGroupAttributesPosixGroups(unittest.TestCase): - """UserGroupAttributesPosixGroups unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUserGroupAttributesPosixGroups(self): - """Test UserGroupAttributesPosixGroups""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.user_group_attributes_posix_groups.UserGroupAttributesPosixGroups() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_user_group_graph_management_req.py b/jcapiv2/test/test_user_group_graph_management_req.py deleted file mode 100644 index 264e3f3..0000000 --- a/jcapiv2/test/test_user_group_graph_management_req.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.user_group_graph_management_req import UserGroupGraphManagementReq # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestUserGroupGraphManagementReq(unittest.TestCase): - """UserGroupGraphManagementReq unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUserGroupGraphManagementReq(self): - """Test UserGroupGraphManagementReq""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.user_group_graph_management_req.UserGroupGraphManagementReq() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_user_group_members__membership_api.py b/jcapiv2/test/test_user_group_members__membership_api.py index 967e3ed..f4d6ba7 100644 --- a/jcapiv2/test/test_user_group_members__membership_api.py +++ b/jcapiv2/test/test_user_group_members__membership_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,18 +23,11 @@ class TestUserGroupMembersMembershipApi(unittest.TestCase): """UserGroupMembersMembershipApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.user_group_members__membership_api.UserGroupMembersMembershipApi() # noqa: E501 + self.api = UserGroupMembersMembershipApi() # noqa: E501 def tearDown(self): pass - def test_graph_user_group_member_of(self): - """Test case for graph_user_group_member_of - - List the User Group's parents # noqa: E501 - """ - pass - def test_graph_user_group_members_list(self): """Test case for graph_user_group_members_list diff --git a/jcapiv2/test/test_user_group_members_req.py b/jcapiv2/test/test_user_group_members_req.py deleted file mode 100644 index 4815679..0000000 --- a/jcapiv2/test/test_user_group_members_req.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.user_group_members_req import UserGroupMembersReq # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestUserGroupMembersReq(unittest.TestCase): - """UserGroupMembersReq unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUserGroupMembersReq(self): - """Test UserGroupMembersReq""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.user_group_members_req.UserGroupMembersReq() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_user_group_post.py b/jcapiv2/test/test_user_group_post.py index d71a90c..3ee0870 100644 --- a/jcapiv2/test/test_user_group_post.py +++ b/jcapiv2/test/test_user_group_post.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_user_group_put.py b/jcapiv2/test/test_user_group_put.py index cf449cd..e5f4578 100644 --- a/jcapiv2/test/test_user_group_put.py +++ b/jcapiv2/test/test_user_group_put.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_user_groups_api.py b/jcapiv2/test/test_user_groups_api.py index 750a7c0..1d403a1 100644 --- a/jcapiv2/test/test_user_groups_api.py +++ b/jcapiv2/test/test_user_groups_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestUserGroupsApi(unittest.TestCase): """UserGroupsApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.user_groups_api.UserGroupsApi() # noqa: E501 + self.api = UserGroupsApi() # noqa: E501 def tearDown(self): pass @@ -43,13 +42,6 @@ def test_graph_user_group_associations_post(self): """ pass - def test_graph_user_group_member_of(self): - """Test case for graph_user_group_member_of - - List the User Group's parents # noqa: E501 - """ - pass - def test_graph_user_group_members_list(self): """Test case for graph_user_group_members_list @@ -134,6 +126,20 @@ def test_graph_user_group_traverse_system_group(self): """ pass + def test_groups_suggestions_get(self): + """Test case for groups_suggestions_get + + List Suggestions for a User Group # noqa: E501 + """ + pass + + def test_groups_suggestions_post(self): + """Test case for groups_suggestions_post + + List Suggestions for a User Group # noqa: E501 + """ + pass + def test_groups_user_delete(self): """Test case for groups_user_delete @@ -155,13 +161,6 @@ def test_groups_user_list(self): """ pass - def test_groups_user_patch(self): - """Test case for groups_user_patch - - Partial update a User Group # noqa: E501 - """ - pass - def test_groups_user_post(self): """Test case for groups_user_post diff --git a/jcapiv2/test/test_users_api.py b/jcapiv2/test/test_users_api.py index 75c0a74..b4b4d0e 100644 --- a/jcapiv2/test/test_users_api.py +++ b/jcapiv2/test/test_users_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestUsersApi(unittest.TestCase): """UsersApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.users_api.UsersApi() # noqa: E501 + self.api = UsersApi() # noqa: E501 def tearDown(self): pass @@ -50,6 +49,13 @@ def test_graph_user_member_of(self): """ pass + def test_graph_user_traverse_active_directory(self): + """Test case for graph_user_traverse_active_directory + + List the Active Directory instances bound to a User # noqa: E501 + """ + pass + def test_graph_user_traverse_application(self): """Test case for graph_user_traverse_application @@ -106,10 +112,31 @@ def test_graph_user_traverse_system_group(self): """ pass - def test_users_send_emails(self): - """Test case for users_send_emails + def test_push_endpoints_delete(self): + """Test case for push_endpoints_delete + + Delete a Push Endpoint associated with a User # noqa: E501 + """ + pass + + def test_push_endpoints_get(self): + """Test case for push_endpoints_get + + Get a push endpoint associated with a User # noqa: E501 + """ + pass + + def test_push_endpoints_list(self): + """Test case for push_endpoints_list + + List Push Endpoints associated with a User # noqa: E501 + """ + pass + + def test_push_endpoints_patch(self): + """Test case for push_endpoints_patch - Send User Emails # noqa: E501 + Update a push endpoint associated with a User # noqa: E501 """ pass diff --git a/jcapiv2/test/test_workday_fields.py b/jcapiv2/test/test_workday_fields.py index 98a9f4d..9bc8acf 100644 --- a/jcapiv2/test/test_workday_fields.py +++ b/jcapiv2/test/test_workday_fields.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_workday_import_api.py b/jcapiv2/test/test_workday_import_api.py index 209b833..fc711ca 100644 --- a/jcapiv2/test/test_workday_import_api.py +++ b/jcapiv2/test/test_workday_import_api.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest @@ -24,7 +23,7 @@ class TestWorkdayImportApi(unittest.TestCase): """WorkdayImportApi unit test stubs""" def setUp(self): - self.api = jcapiv2.api.workday_import_api.WorkdayImportApi() # noqa: E501 + self.api = WorkdayImportApi() # noqa: E501 def tearDown(self): pass @@ -43,13 +42,6 @@ def test_workdays_deauthorize(self): """ pass - def test_workdays_delete(self): - """Test case for workdays_delete - - Delete Workday # noqa: E501 - """ - pass - def test_workdays_get(self): """Test case for workdays_get @@ -92,13 +84,6 @@ def test_workdays_put(self): """ pass - def test_workdays_settings(self): - """Test case for workdays_settings - - Get Workday Settings (incomplete) # noqa: E501 - """ - pass - def test_workdays_workers(self): """Test case for workdays_workers diff --git a/jcapiv2/test/test_workday_input.py b/jcapiv2/test/test_workday_input.py index 05445d4..beda351 100644 --- a/jcapiv2/test/test_workday_input.py +++ b/jcapiv2/test/test_workday_input.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_workday_output.py b/jcapiv2/test/test_workday_output.py index 321b235..dc163b5 100644 --- a/jcapiv2/test/test_workday_output.py +++ b/jcapiv2/test/test_workday_output.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_workday_request.py b/jcapiv2/test/test_workday_request.py deleted file mode 100644 index 4ea1bc4..0000000 --- a/jcapiv2/test/test_workday_request.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - JumpCloud APIs - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 - - OpenAPI spec version: 2.0 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -from __future__ import absolute_import - -import unittest - -import jcapiv2 -from jcapiv2.models.workday_request import WorkdayRequest # noqa: E501 -from jcapiv2.rest import ApiException - - -class TestWorkdayRequest(unittest.TestCase): - """WorkdayRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testWorkdayRequest(self): - """Test WorkdayRequest""" - # FIXME: construct object with mandatory attributes with example values - # model = jcapiv2.models.workday_request.WorkdayRequest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/jcapiv2/test/test_workday_worker.py b/jcapiv2/test/test_workday_worker.py index af02256..cc1aa48 100644 --- a/jcapiv2/test/test_workday_worker.py +++ b/jcapiv2/test/test_workday_worker.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/test/test_workdayoutput_auth.py b/jcapiv2/test/test_workdayoutput_auth.py index e3e0b90..a165895 100644 --- a/jcapiv2/test/test_workdayoutput_auth.py +++ b/jcapiv2/test/test_workdayoutput_auth.py @@ -1,16 +1,15 @@ # coding: utf-8 """ - JumpCloud APIs + JumpCloud API - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # noqa: E501 + # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) # noqa: E501 OpenAPI spec version: 2.0 - + Contact: support@jumpcloud.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ - from __future__ import absolute_import import unittest diff --git a/jcapiv2/tox.ini b/jcapiv2/tox.ini index 3d0be61..a310bec 100644 --- a/jcapiv2/tox.ini +++ b/jcapiv2/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py3 +envlist = py3 [testenv] deps=-r{toxinidir}/requirements.txt From 2af8523dd96546dbb5fe4d8693e1377d4eb67ef8 Mon Sep 17 00:00:00 2001 From: epanipinto-jc Date: Wed, 19 Oct 2022 01:27:24 -0600 Subject: [PATCH 2/5] update instructions --- CONTRIBUTING.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1fb1ca9..a40a433 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,10 +17,18 @@ https://docs.jumpcloud.com/2.0. Update the version number for each package in `config_v1.json` or `config_v2.json`. -To generate the API v1 or v2 client, run the commands below (assuming your -API v1 and v2 specification files are `./input/index1.yaml` and +To generate the API v1 or v2 client, run the commands below: + +Update API v1 and v2 specification files in `./input/index1.yaml` and `./input/index2.yaml`): +```bash +curl https://docs.jumpcloud.com/api/1.0/index.yaml --output input/index1.yaml +curl https://docs.jumpcloud.com/api/2.0/index.yaml --output input/index2.yaml +``` + +Generate SDKs: + ``` docker-compose run --rm swagger-codegen generate -i /swagger-api/yaml/index1.yaml -l python -c /config/config_v1.json -o /swagger-api/out/jcapiv1 docker-compose run --rm swagger-codegen generate -i /swagger-api/yaml/index2.yaml -l python -c /config/config_v2.json -o /swagger-api/out/jcapiv2 From ba72b17685c81cb9258c8550656a954e8793ee5c Mon Sep 17 00:00:00 2001 From: epanipinto-jc Date: Wed, 19 Oct 2022 01:30:07 -0600 Subject: [PATCH 3/5] update instructions --- CONTRIBUTING.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a40a433..d538411 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,13 +23,15 @@ Update API v1 and v2 specification files in `./input/index1.yaml` and `./input/index2.yaml`): ```bash +mkdir input curl https://docs.jumpcloud.com/api/1.0/index.yaml --output input/index1.yaml curl https://docs.jumpcloud.com/api/2.0/index.yaml --output input/index2.yaml ``` Generate SDKs: -``` +```bash +mkdir output docker-compose run --rm swagger-codegen generate -i /swagger-api/yaml/index1.yaml -l python -c /config/config_v1.json -o /swagger-api/out/jcapiv1 docker-compose run --rm swagger-codegen generate -i /swagger-api/yaml/index2.yaml -l python -c /config/config_v2.json -o /swagger-api/out/jcapiv2 ``` @@ -41,7 +43,7 @@ Once you are satisfied with the generated API client, you can replace the existing files under the `jcapiv1` or `jcapiv2` directory with your generated files: -``` +```bash rm -rf jcapiv1 mv output/jcapiv1 . From a8bb9955a6d74073c78293ca9092879df45ec24a Mon Sep 17 00:00:00 2001 From: epanipinto-jc Date: Wed, 19 Oct 2022 02:17:44 -0600 Subject: [PATCH 4/5] sync --- CONTRIBUTING.md | 24 +--- LICENSE | 373 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 380 insertions(+), 17 deletions(-) create mode 100644 LICENSE diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d538411..8787f8d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,32 +18,22 @@ Update the version number for each package in `config_v1.json` or `config_v2.json`. To generate the API v1 or v2 client, run the commands below: - -Update API v1 and v2 specification files in `./input/index1.yaml` and -`./input/index2.yaml`): - ```bash +# Update API v1 and v2 specification files in `./input/index1.yaml` and `./input/index2.yaml`): mkdir input curl https://docs.jumpcloud.com/api/1.0/index.yaml --output input/index1.yaml curl https://docs.jumpcloud.com/api/2.0/index.yaml --output input/index2.yaml -``` - -Generate SDKs: -```bash +# Generate SDKs mkdir output -docker-compose run --rm swagger-codegen generate -i /swagger-api/yaml/index1.yaml -l python -c /config/config_v1.json -o /swagger-api/out/jcapiv1 -docker-compose run --rm swagger-codegen generate -i /swagger-api/yaml/index2.yaml -l python -c /config/config_v2.json -o /swagger-api/out/jcapiv2 -``` +LANG="python" +docker-compose run --rm swagger-codegen generate -i /swagger-api/yaml/index1.yaml -l ${LANG} -c /config/config_v1.json -o /swagger-api/out/jcapiv1 +docker-compose run --rm swagger-codegen generate -i /swagger-api/yaml/index2.yaml -l ${LANG} -c /config/config_v2.json -o /swagger-api/out/jcapiv2 -This will generate the API v1 and v2 client files under the local -`./output/jcapiv1` and `./output/jcapiv2` directories. +# This will generate the API v1 and v2 client files under the local `./output/jcapiv1` and `./output/jcapiv2` directories. -Once you are satisfied with the generated API client, you can replace the -existing files under the `jcapiv1` or `jcapiv2` directory with your generated -files: +# Once you are satisfied with the generated API client, you can replace the existing files under the `jcapiv1` or `jcapiv2` directory with your generated files: -```bash rm -rf jcapiv1 mv output/jcapiv1 . diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a612ad9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. From 458929a2a249d88019868a531697325d9a000381 Mon Sep 17 00:00:00 2001 From: epanipinto-jc Date: Wed, 19 Oct 2022 02:29:15 -0600 Subject: [PATCH 5/5] update docs --- CONTRIBUTING.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8787f8d..a82e42a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,12 +1,12 @@ -### Swagger Code Generation +# Swagger Code Generation This repository relies on the following Dockerfile in order to run Swagger Codegen inside a Docker container: -https://hub.docker.com/r/jimschubert/swagger-codegen-cli/. +https://hub.docker.com/r/parsertongue/swagger-codegen-cli. -We're currently using version 2.3.1 of Swagger Codegen. +We're currently using version 3.0.32 of Swagger Codegen. -### Generating the API Client +## Generating the API Client Copy the Swagger specification YAML files to the local `./input` directory. @@ -18,6 +18,7 @@ Update the version number for each package in `config_v1.json` or `config_v2.json`. To generate the API v1 or v2 client, run the commands below: + ```bash # Update API v1 and v2 specification files in `./input/index1.yaml` and `./input/index2.yaml`): mkdir input